]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: make return parameter of dynamic_user_lookup_name() optional
authorLennart Poettering <lennart@poettering.net>
Wed, 7 Aug 2019 10:48:45 +0000 (12:48 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 15 Jan 2020 14:28:52 +0000 (15:28 +0100)
src/core/dynamic-user.c

index 75373407b4852cd7cf1739eba93a88c960845231..e00109ee4ac979dd97999560d47c9e79d9d95718 100644 (file)
@@ -529,7 +529,6 @@ int dynamic_user_current(DynamicUser *d, uid_t *ret) {
         int r;
 
         assert(d);
-        assert(ret);
 
         /* Get the currently assigned UID for the user, if there's any. This simply pops the data from the storage socket, and pushes it back in right-away. */
 
@@ -545,7 +544,9 @@ int dynamic_user_current(DynamicUser *d, uid_t *ret) {
         if (r < 0)
                 return r;
 
-        *ret = uid;
+        if (ret)
+                *ret = uid;
+
         return 0;
 }
 
@@ -732,7 +733,6 @@ int dynamic_user_lookup_name(Manager *m, const char *name, uid_t *ret) {
 
         assert(m);
         assert(name);
-        assert(ret);
 
         /* A friendly call for translating a dynamic user's name into its UID */