]> git.ipfire.org Git - telemetry.git/commitdiff
priv: Properly fail if we could not find the daemon user
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Feb 2026 15:22:29 +0000 (15:22 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Feb 2026 15:22:29 +0000 (15:22 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/priv.c

index f033b4e464d7aa11698a63a7b12b9ad9b401fdc2..963c3c1e3761a8884c9ccde32313b7f371b8911a 100644 (file)
@@ -161,8 +161,8 @@ int td_priv_drop_privileges(td_ctx* ctx, const char* user) {
        // Fetch information about the desired user
        passwd = getpwnam(user);
        if (!passwd) {
-               ERROR(ctx, "Could not find user %s: %m\n", user);
-               return -errno;
+               ERROR(ctx, "Could not find user '%s'\n", user);
+               return -ENOENT;
        }
 
        uid_t uid = passwd->pw_uid;