From: Arvin Schnell Date: Mon, 8 Jun 2026 09:09:33 +0000 (+0200) Subject: - handle exception of get_unix_userid (see bsc#1265853) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed39ec1432e2b091d95d3d2d1c398668bb682637;p=thirdparty%2Fsnapper.git - handle exception of get_unix_userid (see bsc#1265853) --- diff --git a/server/snapperd.cc b/server/snapperd.cc index 82d86d85..cb642b1c 100644 --- a/server/snapperd.cc +++ b/server/snapperd.cc @@ -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)); }