diff options
author | Simon Ser <contact@emersion.fr> | 2021-08-06 08:23:03 +0000 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-08-06 22:27:42 +0200 |
commit | 369af8f9e4797be55c4b95facd50dd7cc20565d1 (patch) | |
tree | 4c11314fbd085cfa012ad3e0d936c2f80f4ffe82 /seatd-launch | |
parent | 3a843745c2dee17ec99d3c6b233251a5dc6ff5ad (diff) |
seatd-launch: check for getpwuid errors
Diffstat (limited to 'seatd-launch')
-rw-r--r-- | seatd-launch/seatd-launch.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/seatd-launch/seatd-launch.c b/seatd-launch/seatd-launch.c index cf9f93d..acec145 100644 --- a/seatd-launch/seatd-launch.c +++ b/seatd-launch/seatd-launch.c @@ -33,7 +33,12 @@ int main(int argc, char *argv[]) { char pipebuf[8]; sprintf(pipebuf, "%d", fds[1]); + struct passwd *user = getpwuid(getuid()); + if (!user) { + perror("getpwuid failed"); + _exit(1); + } // TODO: Make seatd accept the numeric UID execlp("seatd", "seatd", "-n", pipebuf, "-u", user->pw_name, "-s", sockbuf, NULL); |