seatd: Use path-based chmod/chown
The fd variants do not seem to work for sockets
This commit is contained in:
parent
24e2fc7861
commit
f5bc8ab12b
1 changed files with 2 additions and 2 deletions
|
@ -42,10 +42,10 @@ static int open_socket(char *path, int uid, int gid) {
|
|||
return -1;
|
||||
}
|
||||
if (uid != 0 || gid != 0) {
|
||||
if (fchown(fd, uid, gid) == -1) {
|
||||
if (chown(path, uid, gid) == -1) {
|
||||
log_errorf("could not chown socket to uid %d, gid %d: %s", uid, gid,
|
||||
strerror(errno));
|
||||
} else if (fchmod(fd, 0770) == -1) {
|
||||
} else if (chmod(path, 0770) == -1) {
|
||||
log_errorf("could not chmod socket: %s", strerror(errno));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue