]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- handle exception of get_unix_userid (see bsc#1265853)
authorArvin Schnell <aschnell@suse.de>
Mon, 8 Jun 2026 09:09:33 +0000 (11:09 +0200)
committerArvin Schnell <aschnell@suse.de>
Mon, 8 Jun 2026 09:09:33 +0000 (11:09 +0200)
server/snapperd.cc

index 82d86d858309365589740cb1ed8844c813a17bbb..cb642b1c0520df3a9cf9d2d39f9f2daa975490dc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2012-2015] Novell, Inc.
- * Copyright (c) [2018-2025] SUSE LLC
+ * Copyright (c) [2018-2026] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -113,7 +113,21 @@ MyMainLoop::method_call(DBus::Message& msg)
        {
            y2deb("client connected invisible '" << name << "'");
            add_client_match(name);
-           client = clients.add(name, get_unix_userid(msg));
+
+           uid_t uid = -1;
+
+           try
+           {
+               uid = get_unix_userid(msg);
+           }
+           catch (const Exception& e)
+           {
+               SN_CAUGHT(e);
+               y2err("failed to get uid of client");
+               return;
+           }
+
+           client = clients.add(name, uid);
            set_idle_timeout(seconds(-1));
        }