Set sticky bit on socket

According to the XDG Base Directory Specification this should
prevent the file from being deleted by temporary cleanup
procedures.
This commit is contained in:
Marc André Tanner 2015-08-03 12:30:27 +02:00
parent 42962ff827
commit 15ae398ea5
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}