abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 15ae398ea51f9adb282d7cf93a998a8ea401fd21
parent 42962ff82763825879393626df9563976a98bd51
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Mon,  3 Aug 2015 12:30:27 +0200

Set sticky bit on socket

According to the XDG Base Directory Specification this should
prevent the file from being deleted by temporary cleanup
procedures.

Diffstat:
server.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server.c b/server.c @@ -42,7 +42,7 @@ static int server_create_socket(const char *name) { int r = bind(fd, (struct sockaddr*)&sockaddr, socklen); umask(mask); - if (r == -1) { + if (r == -1 || chmod(sockaddr.sun_path, S_ISVTX|S_IRUSR|S_IWUSR) == -1) { close(fd); return -1; }