From f5bc8ab12b3ffb2936dbaf718a22e99cebc6da51 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Sat, 8 Aug 2020 15:27:43 +0200 Subject: seatd: Use path-based chmod/chown The fd variants do not seem to work for sockets --- seatd/seatd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'seatd') 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)); } } -- cgit v1.2.3