diff options
| author | bptato <nincsnevem662@gmail.com> | 2024-10-31 17:47:20 +0100 |
|---|---|---|
| committer | bptato <nincsnevem662@gmail.com> | 2024-10-31 18:38:16 +0100 |
| commit | bf714c9bb7064338fb77c27fd850daef0f14db50 (patch) | |
| tree | 059e2144ea1922e0b9120f9b234d7cbb0ea5f662 /src/io | |
| parent | d9ca197ed8056c021d4e37ec52aacc6039e24ab7 (diff) | |
| download | chawan-bf714c9bb7064338fb77c27fd850daef0f14db50.tar.gz | |
dynstream: restrict permissions to user
the man page says this isn't really portable, but it's better than
nothing
Diffstat (limited to 'src/io')
| -rw-r--r-- | src/io/dynstream.nim | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/io/dynstream.nim b/src/io/dynstream.nim index 5a106491..19944ed5 100644 --- a/src/io/dynstream.nim +++ b/src/io/dynstream.nim @@ -479,6 +479,7 @@ proc newServerSocket*(fd: cint; sockDir: string; sockDirFd: cint; pid: int): proc newServerSocket*(sockDir: string; sockDirFd: cint; pid: int): ServerSocket = let fd = cint(socket(AF_UNIX, SOCK_STREAM, IPPROTO_IP)) let ssock = newServerSocket(fd, sockDir, sockDirFd, pid) + doAssert fchmod(fd, 0o700) == 0 if sockDirFd == -1: discard tryRemoveFile(ssock.path) if bind_unix_from_c(fd, cstring(ssock.path), cint(ssock.path.len)) != 0: |