]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: fix assertions in manager_dispatch_user_lookup_fd()
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Apr 2024 11:30:10 +0000 (13:30 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Apr 2024 11:32:25 +0000 (13:32 +0200)
assert_se() should not be used here, these checks are paranoia only and
have no side-effect after all.

hence fix this to use assert(), or in fact ASSERT_PTR()

src/core/manager.c

index 11a81139868387bb08bd3ab3576d268ec7b49a83..89c80821b944dddc1c9aa912da5cb4f5e4df8723 100644 (file)
@@ -4776,13 +4776,12 @@ static int manager_dispatch_user_lookup_fd(sd_event_source *source, int fd, uint
                 char unit_name[UNIT_NAME_MAX+1];
         } _packed_ buffer;
 
-        Manager *m = userdata;
+        Manager *m = ASSERT_PTR(userdata);
         ssize_t l;
         size_t n;
         Unit *u;
 
-        assert_se(source);
-        assert_se(m);
+        assert(source);
 
         /* Invoked whenever a child process succeeded resolving its user/group to use and sent us the
          * resulting UID/GID in a datagram. We parse the datagram here and pass it off to the unit, so that