]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
userdb: return ESRCH if we didn't find a single varlink service
authorLennart Poettering <lennart@poettering.net>
Wed, 5 May 2021 20:06:34 +0000 (22:06 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 10 May 2021 16:08:38 +0000 (18:08 +0200)
Clearly communicate to callers that we didn't find a single varlink
service, when a lookup is attempted. Note that the fallback's to NSS,
drop-ins and synthesis might eat up this error again, but we should
really make this case reasonably recognizable, in particular as our
various tools already handle this condition correctly and print a nice
message then.

src/shared/userdb.c

index 3e08b339f5b861aabf0a21d1b598d56d671f0d00..33a1442460eb23f47d99f22e53ee0decb7921330 100644 (file)
@@ -510,7 +510,7 @@ static int userdb_start_query(
         }
 
         if (set_isempty(iterator->links))
-                return ret; /* propagate last error we saw if we couldn't connect to anything. */
+                return ret < 0 ? ret : -ESRCH; /* propagate last error we saw if we couldn't connect to anything. */
 
         /* We connected to some services, in this case, ignore the ones we failed on */
         return 0;