seatd-launch: check for getpwuid errors

This commit is contained in:
Simon Ser 2021-08-06 08:23:03 +00:00 committed by Kenny Levinsen
parent 3a843745c2
commit 369af8f9e4

View file

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