]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
userdb: Fix return value of groupdb_by_name()
authorMichal Koutný <mkoutny@suse.com>
Mon, 3 Mar 2025 18:15:42 +0000 (19:15 +0100)
committerMichal Koutný <mkoutny@suse.com>
Mon, 3 Mar 2025 18:26:52 +0000 (19:26 +0100)
The commit 7419291670 ("userdb: move UserDBMatch handling from userdbctl
into generic userdb code to allow it to be done server side")
unintentionally passes return value from group_record_match() as its
return value and thus diverges from other search functions that return 0
on success. Align that by returning 0 instead of 1, all existing callers
are invariant to this change.

src/shared/userdb.c

index ea352de0004ffed6ef2957f3f2b65f11853860db..18b98685dbd6f1687aa4dfc7455b5642da43d81c 100644 (file)
@@ -1356,7 +1356,7 @@ int groupdb_by_name(const char *name, const UserDBMatch *match, UserDBFlags flag
         if (ret)
                 *ret = TAKE_PTR(gr);
 
-        return r;
+        return 0;
 }
 
 static int groupdb_by_gid_fallbacks(