]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device-monitor: do not trigger assertion when uid_map is not empty
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Sep 2022 00:26:07 +0000 (09:26 +0900)
committerLennart Poettering <lennart@poettering.net>
Fri, 16 Sep 2022 11:05:51 +0000 (13:05 +0200)
Follow-up for c0aa23cf1ed4b3cbbcaf8b19d47e6e29dc28c9a0.

src/libsystemd/sd-device/device-monitor.c

index 8b1b01ee0f055fa28760753ef828be6725f0d956..072c6b94d3589cbaa3511c596802317760f19a3e 100644 (file)
@@ -469,6 +469,7 @@ static bool check_sender_uid(sd_device_monitor *m, uid_t uid) {
                 return true;
 
         if (m->n_uid_range == SIZE_MAX) {
+                m->n_uid_range = 0;
                 r = uid_range_load_userns(&m->mapped_userns_uid_range, &m->n_uid_range, NULL);
                 if (r < 0)
                         log_monitor_errno(m, r, "Failed to load UID ranges mapped to the current user namespace, ignoring: %m");