aboutsummaryrefslogtreecommitdiff
path: root/seatd
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-08-08 15:27:43 +0200
committerKenny Levinsen <kl@kl.wtf>2020-08-08 15:27:43 +0200
commitf5bc8ab12b3ffb2936dbaf718a22e99cebc6da51 (patch)
tree33db54658741b4c2c4763232d96c4c18d9d0e1b1 /seatd
parent24e2fc78619506b94280971292880a02414f2d8d (diff)
seatd: Use path-based chmod/chown
The fd variants do not seem to work for sockets
Diffstat (limited to 'seatd')
-rw-r--r--seatd/seatd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/seatd/seatd.c b/seatd/seatd.c
index 30b0c27..ada6e75 100644
--- a/seatd/seatd.c
+++ b/seatd/seatd.c
@@ -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));
}
}