Debian Codegraph @

src/cups-pk-helper-mechanism.c

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2 * vim: set et ts=8 sw=8:
3 *
4 * Copyright (C) 2008 Novell, Inc.
5 *
6 * Authors: Vincent Untz
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 * The code is originally based on gnome-clock-applet-mechanism.c, which
23 * is under the same license and with the following copyright:
24 *
25 * Copyright (C) 2007 David Zeuthen <[email protected]>
26 *
27 */
28
29 #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:413:9`!
30 # include "config.h"cxx . . $ `<file>/config.h`/
31 #endif
32
33 #include <stdlib.h>
34 #include <stdio.h>
35 #include <fcntl.h>
36 #include <unistd.h>
37 #include <string.h>
38 #include <sys/wait.h>
39 #include <errno.h>
40 #include <sys/time.h>
41
42 #include <glib.h>
43 #include <glib-object.h>
44 #include <gio/gio.h>
45
46 #include <polkit/polkit.h>
47
48 #include <pwd.h>
49
50 #include "cups-pk-helper-mechanism.h"cxx . . $ `<file>/src/cups-pk-helper-mechanism.h`/
51 #include "cph-iface-mechanism.h"cxx . . $ `<file>/src/cph-iface-mechanism.h`/
52 #include "cups.h"cxx . . $ `<file>/src/cups.h`/
53
54 #define CPH_SERVICE_DBUScxx . . $ `src/cups-pk-helper-mechanism.c:54:9`! "org.freedesktop.DBus"
55 #define CPH_PATH_DBUScxx . . $ `src/cups-pk-helper-mechanism.c:55:9`! "/org/freedesktop/DBus"
56 #define CPH_INTERFACE_DBUScxx . . $ `src/cups-pk-helper-mechanism.c:56:9`! "org.freedesktop.DBus"
57
58 /* error */
59
60 static const GDBusErrorEntrycxx . . $ GDBusErrorEntry# cph_error_entriescxx . . $ cph_error_entries.[] =
61 {
62 { CPH_MECHANISM_ERROR_GENERALcxx . . $ CPH_MECHANISM_ERROR_GENERAL., "org.opensuse.CupsPkHelper.Mechanism.GeneralError" },
63 { CPH_MECHANISM_ERROR_NOT_PRIVILEGEDcxx . . $ CPH_MECHANISM_ERROR_NOT_PRIVILEGED., "org.opensuse.CupsPkHelper.Mechanism.NotPrivileged" }
64 };
65
66 GQuarkcxx . . $ GQuark#
67 cph_mechanism_error_quarkcxx . . $ cph_mechanism_error_quark(db52760e79bf9054). (void)
68 {
69 static gsizecxx . . $ gsize# ret = 0;
70
71 if (ret == 0) {
72 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (CPH_MECHANISM_NUM_ERRORS == G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (cph_error_entries));
73
74 g_dbus_error_register_error_domaincxx . . $ g_dbus_error_register_error_domain(970625dfbce980e9). ("cph-mechanism-error",
75 &ret,
76 cph_error_entriescxx . . $ cph_error_entries.,
77 G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (cph_error_entries));
78 }
79
80 return ret;
81 }
82
83 /* mechanism object */
84
85 G_DEFINE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1834:9`! (CphMechanism, cph_mechanism, CPH_IFACE_TYPE_MECHANISM_SKELETONcxx . . $ `src/cph-iface-mechanism.h:1160:9`!)
86
87 #define CPH_MECHANISM_GET_PRIVATEcxx . . $ `src/cups-pk-helper-mechanism.c:87:9`!(o) (G_TYPE_INSTANCE_GET_PRIVATEcxx . . $ `<external>/9567554376676449156/gtype.h:688:9`! ((o), CPH_TYPE_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:39:9`!, CphMechanismPrivate))
88
89 struct CphMechanismPrivatecxx . . $ CphMechanismPrivate#
90 {
91 gbooleancxx . . $ gboolean# exportedcxx . . $ CphMechanismPrivate#exported.;
92 gbooleancxx . . $ gboolean# connectedcxx . . $ CphMechanismPrivate#connected.;
93 PolkitAuthoritycxx . . $ PolkitAuthority# *pol_authcxx . . $ CphMechanismPrivate#pol_auth.;
94 CphCupscxx . . $ CphCups# *cupscxx . . $ CphMechanismPrivate#cups.;
95 GDBusProxycxx . . $ GDBusProxy# *dbus_proxycxx . . $ CphMechanismPrivate#dbus_proxy.;
96 };
97
98 enumcxx . . $ $anonymous_type_e87fbf031b0a53a_0# {
99 CALLEDcxx . . $ CALLED.,
100 LAST_SIGNALcxx . . $ LAST_SIGNAL.
101 };
102
103 static guintcxx . . $ guint# signalscxx . . $ signals.[LAST_SIGNALcxx . . $ LAST_SIGNAL.] = { 0 };
104
105 static GObjectcxx . . $ GObject# *cph_mechanism_constructorcxx . . $ cph_mechanism_constructor(3429e4e6460ec865). (GTypecxx . . $ GType# type,
106 guintcxx . . $ guint# n_construct_properties,
107 GObjectConstructParamcxx . . $ GObjectConstructParam# *construct_properties);
108 static void cph_mechanism_disposecxx . . $ cph_mechanism_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object);
109 static void cph_mechanism_finalizecxx . . $ cph_mechanism_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object);
110
111 static void cph_mechanism_connect_signalscxx . . $ cph_mechanism_connect_signals(450a3200f2662a35). (CphMechanismcxx . . $ CphMechanism# *mechanism);
112
113 static void
114 cph_mechanism_class_initcxx . . $ cph_mechanism_class_init(2f1935f74c7a6e3e). (CphMechanismClasscxx . . $ CphMechanismClass# *klass)
115 {
116 GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass);
117
118 object_class->constructorcxx . . $ _GObjectClass#constructor. = cph_mechanism_constructorcxx . . $ cph_mechanism_constructor(3429e4e6460ec865).;
119 object_class->disposecxx . . $ _GObjectClass#dispose. = cph_mechanism_disposecxx . . $ cph_mechanism_dispose(6087475fa43034d3).;
120 object_class->finalizecxx . . $ _GObjectClass#finalize. = cph_mechanism_finalizecxx . . $ cph_mechanism_finalize(6087475fa43034d3).;
121
122 signalscxx . . $ signals.[CALLEDcxx . . $ CALLED.] =
123 g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). ("called",
124 G_OBJECT_CLASS_TYPEcxx . . $ `<external>/1341695927569185362/gobject.h:117:9`! (object_class),
125 G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST.,
126 G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (CphMechanismClass, called),
127 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
128 g_cclosure_marshal_VOID__VOIDcxx . . $ g_cclosure_marshal_VOID__VOID(cba270afb0f82555).,
129 G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!,
130 0);
131
132 g_type_class_add_privatecxx . . $ g_type_class_add_private(5500c4293b1bbef0). (klass, sizeof (CphMechanismPrivatecxx . . $ CphMechanismPrivate#));
133 }
134
135 static GObjectcxx . . $ GObject# *
136 cph_mechanism_constructorcxx . . $ cph_mechanism_constructor(3429e4e6460ec865). (GTypecxx . . $ GType# type,
137 guintcxx . . $ guint# n_construct_properties,
138 GObjectConstructParamcxx . . $ GObjectConstructParam# *construct_properties)
139 {
140 GObjectcxx . . $ GObject# *obj;
141 CphMechanismcxx . . $ CphMechanism# *mechanism;
142
143 obj = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (cph_mechanism_parent_class)->constructorcxx . . $ _GObjectClass#constructor. (
144 type,
145 n_construct_properties,
146 construct_properties);
147
148 mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (obj);
149 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups. = cph_cups_newcxx . . $ cph_cups_new(a270b4116d4f578f). ();
150
151 if (!mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.) {
152 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (mechanism);
153 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
154 }
155
156 return obj;
157 }
158
159 static void
160 cph_mechanism_initcxx . . $ cph_mechanism_init(450a3200f2662a35). (CphMechanismcxx . . $ CphMechanism# *mechanism)
161 {
162 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv. = CPH_MECHANISM_GET_PRIVATEcxx . . $ `src/cups-pk-helper-mechanism.c:87:9`! (mechanism);
163
164 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->exportedcxx . . $ CphMechanismPrivate#exported. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
165 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->connectedcxx . . $ CphMechanismPrivate#connected. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
166 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->pol_authcxx . . $ CphMechanismPrivate#pol_auth. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
167 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
168 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->dbus_proxycxx . . $ CphMechanismPrivate#dbus_proxy. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
169 }
170
171 static void
172 cph_mechanism_disposecxx . . $ cph_mechanism_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
173 {
174 CphMechanismcxx . . $ CphMechanism# *mechanism;
175
176 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (object != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
177 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (CPH_IS_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:42:9`! (object));
178
179 mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
180
181 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->pol_authcxx . . $ CphMechanismPrivate#pol_auth. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
182 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->pol_authcxx . . $ CphMechanismPrivate#pol_auth.);
183 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->pol_authcxx . . $ CphMechanismPrivate#pol_auth. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
184
185 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
186 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.);
187 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
188
189 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->dbus_proxycxx . . $ CphMechanismPrivate#dbus_proxy. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
190 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->dbus_proxycxx . . $ CphMechanismPrivate#dbus_proxy.);
191 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->dbus_proxycxx . . $ CphMechanismPrivate#dbus_proxy. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
192
193 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (cph_mechanism_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object);
194 }
195
196 static void
197 cph_mechanism_finalizecxx . . $ cph_mechanism_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
198 {
199 CphMechanismcxx . . $ CphMechanism# *mechanism;
200
201 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (object != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
202 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (CPH_IS_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:42:9`! (object));
203
204 mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
205
206 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->exportedcxx . . $ CphMechanismPrivate#exported.)
207 g_dbus_interface_skeleton_unexportcxx . . $ g_dbus_interface_skeleton_unexport(ea7137ee396aca18). (G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (mechanism));
208 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->exportedcxx . . $ CphMechanismPrivate#exported. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
209
210 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (cph_mechanism_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object);
211 }
212
213 CphMechanismcxx . . $ CphMechanism# *
214 cph_mechanism_newcxx . . $ cph_mechanism_new(ae60338589fb0fb1). (void)
215 {
216 GObjectcxx . . $ GObject# *object;
217
218 object = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (CPH_TYPE_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:39:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
219
220 return CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
221 }
222
223 gbooleancxx . . $ gboolean#
224 cph_mechanism_registercxx . . $ cph_mechanism_register(e62b3dea34b256d5). (CphMechanismcxx . . $ CphMechanism# *mechanism,
225 GDBusConnectioncxx . . $ GDBusConnection# *connection,
226 const char *object_path,
227 GErrorcxx . . $ GError# **error)
228 {
229 gbooleancxx . . $ gboolean# ret;
230
231 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (CPH_IS_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:42:9`! (mechanism), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
232 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
233
234 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->exportedcxx . . $ CphMechanismPrivate#exported. && mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->pol_authcxx . . $ CphMechanismPrivate#pol_auth. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
235 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
236
237 if (!mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->exportedcxx . . $ CphMechanismPrivate#exported.) {
238 ret = g_dbus_interface_skeleton_exportcxx . . $ g_dbus_interface_skeleton_export(b7cdb5e81947cba7). (G_DBUS_INTERFACE_SKELETONcxx . . $ `<external>/1991948168568871819/gdbusinterfaceskeleton.h:32:9`! (mechanism),
239 connection,
240 object_path,
241 error);
242 if (!ret)
243 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
244
245 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->exportedcxx . . $ CphMechanismPrivate#exported. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
246 }
247
248 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->pol_authcxx . . $ CphMechanismPrivate#pol_auth. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
249 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->pol_authcxx . . $ CphMechanismPrivate#pol_auth. = polkit_authority_get_synccxx . . $ polkit_authority_get_sync(d283deaa0e9274a6). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, error);
250 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->pol_authcxx . . $ CphMechanismPrivate#pol_auth. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
251 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
252 }
253
254 cph_mechanism_connect_signalscxx . . $ cph_mechanism_connect_signals(450a3200f2662a35). (mechanism);
255
256 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
257 }
258
259 /* polkit helpers */
260
261 static gbooleancxx . . $ gboolean#
262 _check_polkit_for_action_internalcxx . . $ _check_polkit_for_action_internal(1d691b5157c78dfc). (CphMechanismcxx . . $ CphMechanism# *mechanism,
263 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
264 const char *action_method,
265 gbooleancxx . . $ gboolean# allow_user_interaction,
266 GErrorcxx . . $ GError# **error)
267 {
268 const char *sender;
269 PolkitSubjectcxx . . $ PolkitSubject# *subject;
270 PolkitAuthorizationResultcxx . . $ PolkitAuthorizationResult# *pk_result;
271 char *action;
272 GErrorcxx . . $ GError# *local_error;
273
274 g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
275
276 local_error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
277
278 action = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("org.opensuse.cupspkhelper.mechanism.%s",
279 action_method);
280
281 /* Check that caller is privileged */
282 sender = g_dbus_method_invocation_get_sendercxx . . $ g_dbus_method_invocation_get_sender(fb2cbbb785aa0d4d). (context);
283 subject = polkit_system_bus_name_newcxx . . $ polkit_system_bus_name_new(5ece0143962e04fa). (sender);
284
285 pk_result = polkit_authority_check_authorization_synccxx . . $ polkit_authority_check_authorization_sync(c7abb3334b2c247a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->pol_authcxx . . $ CphMechanismPrivate#pol_auth.,
286 subject,
287 action,
288 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
289 allow_user_interaction ?
290 POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTIONcxx . . $ POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION. :
291 POLKIT_CHECK_AUTHORIZATION_FLAGS_NONEcxx . . $ POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE.,
292 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
293 &local_error);
294 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (subject);
295
296 if (local_error) {
297 g_propagate_errorcxx . . $ g_propagate_error(902e08a176509aff). (error, local_error);
298 g_freecxx . . $ g_free(5d22bdacc48458e8). (action);
299
300 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
301 }
302
303 if (!polkit_authorization_result_get_is_authorizedcxx . . $ polkit_authorization_result_get_is_authorized(b81f7479307ef0f5). (pk_result)) {
304 g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error,
305 CPH_MECHANISM_ERRORcxx . . $ `src/cups-pk-helper-mechanism.h:70:9`!,
306 CPH_MECHANISM_ERROR_NOT_PRIVILEGEDcxx . . $ CPH_MECHANISM_ERROR_NOT_PRIVILEGED.,
307 "Not Authorized for action: %s", action);
308 g_freecxx . . $ g_free(5d22bdacc48458e8). (action);
309 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (pk_result);
310
311 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
312 }
313
314 g_freecxx . . $ g_free(5d22bdacc48458e8). (action);
315 g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (pk_result);
316
317 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
318 }
319
320 static gbooleancxx . . $ gboolean#
321 _check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (CphMechanismcxx . . $ CphMechanism# *mechanism,
322 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
323 const char *first_action_method,
324 ...)
325 {
326 gbooleancxx . . $ gboolean# retval;
327 GErrorcxx . . $ GError# *error;
328 va_listcxx . . $ va_list# var_args;
329 const char *action_method;
330
331 retval = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
332 error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
333
334 /* We check if the user is authorized for any of the specificed action
335 * methods. We only allow user interaction for the last one. Therefore,
336 * callers of this function should choose with care the order,
337 * especially if we don't want to prompt for a password too often and
338 * if we don't want to authorize too many things at once. */
339 va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`! (var_args, first_action_method);
340 action_method = first_action_method;
341
342 while (action_method) {
343 char *next_action_method;
344
345 if (error != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
346 g_error_freecxx . . $ g_error_free(2ff7d11a2ecc01bd). (error);
347 error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
348 }
349
350 next_action_method = va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`! (var_args, char *);
351
352 retval = _check_polkit_for_action_internalcxx . . $ _check_polkit_for_action_internal(1d691b5157c78dfc). (mechanism, context,
353 action_method,
354 next_action_method == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
355 &error);
356 if (retval)
357 break;
358
359 action_method = next_action_method;
360 }
361
362 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`! (var_args);
363
364 if (!retval) {
365 if (!error) {
366 /* This should never happen, but let's be paranoid */
367 error = g_error_newcxx . . $ g_error_new(c11b45e4af983f9e). (CPH_MECHANISM_ERRORcxx . . $ `src/cups-pk-helper-mechanism.h:70:9`!,
368 CPH_MECHANISM_ERROR_GENERALcxx . . $ CPH_MECHANISM_ERROR_GENERAL.,
369 "Unknown error when checking for "
370 "authorization");
371 }
372
373 g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (context, error);
374 g_error_freecxx . . $ g_error_free(2ff7d11a2ecc01bd). (error);
375 }
376
377 return retval;
378 }
379
380 static gbooleancxx . . $ gboolean#
381 _check_polkit_for_actioncxx . . $ _check_polkit_for_action(aa239b07e0b12316). (CphMechanismcxx . . $ CphMechanism# *mechanism,
382 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
383 const char *action_method)
384 {
385 return _check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
386 action_method, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
387 }
388
389 static gbooleancxx . . $ gboolean#
390 _check_polkit_for_printercxx . . $ _check_polkit_for_printer(ba8ac26dd6ebb072). (CphMechanismcxx . . $ CphMechanism# *mechanism,
391 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
392 const char *printer_name,
393 const char *uri)
394 {
395 gbooleancxx . . $ gboolean# is_local;
396
397 is_local = cph_cups_is_printer_localcxx . . $ cph_cups_is_printer_local(d2a4bae5b1c86351). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
398 printer_name) &&
399 (!uri || cph_cups_is_printer_uri_localcxx . . $ cph_cups_is_printer_uri_local(5c4306d8553b3696). (uri));
400
401 return _check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
402 "all-edit",
403 "printeraddremove",
404 is_local ? "printer-local-edit"
405 : "printer-remote-edit",
406 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
407 }
408
409 static gbooleancxx . . $ gboolean#
410 _check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (CphMechanismcxx . . $ CphMechanism# *mechanism,
411 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
412 const char *printer_name)
413 {
414 if (cph_cups_is_classcxx . . $ cph_cups_is_class(d2a4bae5b1c86351). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., printer_name)) {
415 return _check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
416 "all-edit",
417 "printeraddremove",
418 "class-edit", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
419 } else {
420 return _check_polkit_for_printercxx . . $ _check_polkit_for_printer(ba8ac26dd6ebb072). (mechanism, context,
421 printer_name, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
422 }
423 }
424
425 static const char *
426 _cph_mechanism_get_action_for_namecxx . . $ _cph_mechanism_get_action_for_name(20dce2b6b27cdb69). (CphMechanismcxx . . $ CphMechanism# *mechanism,
427 const char *name)
428 {
429 if (cph_cups_is_classcxx . . $ cph_cups_is_class(d2a4bae5b1c86351). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., name))
430 return "class-edit";
431
432 if (cph_cups_is_printer_localcxx . . $ cph_cups_is_printer_local(d2a4bae5b1c86351). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., name))
433 return "printer-local-edit";
434
435 return "printer-remote-edit";
436 }
437
438 static void
439 _cph_mechanism_ensure_dbus_proxycxx . . $ _cph_mechanism_ensure_dbus_proxy(fedf1599e77d4fe2). (CphMechanismcxx . . $ CphMechanism# *mechanism,
440 GDBusConnectioncxx . . $ GDBusConnection# *connection)
441 {
442 GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
443
444 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->dbus_proxycxx . . $ CphMechanismPrivate#dbus_proxy. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
445 return;
446
447 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->dbus_proxycxx . . $ CphMechanismPrivate#dbus_proxy. = g_dbus_proxy_new_synccxx . . $ g_dbus_proxy_new_sync(f819688676c400fd). (connection,
448 G_DBUS_PROXY_FLAGS_NONEcxx . . $ G_DBUS_PROXY_FLAGS_NONE.,
449 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
450 CPH_SERVICE_DBUScxx . . $ `src/cups-pk-helper-mechanism.c:54:9`!,
451 CPH_PATH_DBUScxx . . $ `src/cups-pk-helper-mechanism.c:55:9`!,
452 CPH_INTERFACE_DBUScxx . . $ `src/cups-pk-helper-mechanism.c:56:9`!,
453 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
454 &error);
455
456 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->dbus_proxycxx . . $ CphMechanismPrivate#dbus_proxy. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
457 if (error)
458 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Could not get proxy to dbus service: %s", error->message);
459 else
460 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Could not get proxy to dbus service user");
461
462 g_error_freecxx . . $ g_error_free(2ff7d11a2ecc01bd). (error);
463 }
464 }
465
466 static gbooleancxx . . $ gboolean#
467 _cph_mechanism_get_sender_uidcxx . . $ _cph_mechanism_get_sender_uid(5e514bd7fb42c3b7). (CphMechanismcxx . . $ CphMechanism# *mechanism,
468 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
469 unsigned int *sender_uid)
470 {
471 GErrorcxx . . $ GError# *error;
472 GDBusConnectioncxx . . $ GDBusConnection# *connection;
473 const char *sender;
474 GVariantcxx . . $ GVariant# *result;
475
476 *sender_uid = 0;
477
478 connection = g_dbus_method_invocation_get_connectioncxx . . $ g_dbus_method_invocation_get_connection(8c6afd006dd99032). (context);
479 _cph_mechanism_ensure_dbus_proxycxx . . $ _cph_mechanism_ensure_dbus_proxy(fedf1599e77d4fe2). (mechanism, connection);
480 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->dbus_proxycxx . . $ CphMechanismPrivate#dbus_proxy. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
481 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
482
483 sender = g_dbus_method_invocation_get_sendercxx . . $ g_dbus_method_invocation_get_sender(fb2cbbb785aa0d4d). (context);
484
485 error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
486 result = g_dbus_proxy_call_synccxx . . $ g_dbus_proxy_call_sync(b1357f5ab0745181). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->dbus_proxycxx . . $ CphMechanismPrivate#dbus_proxy.,
487 "GetConnectionUnixUser",
488 g_variant_newcxx . . $ g_variant_new(59b7d1999758b6d9). ("(s)", sender),
489 G_DBUS_CALL_FLAGS_NONEcxx . . $ G_DBUS_CALL_FLAGS_NONE.,
490 -1,
491 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
492 &error);
493
494 if (result == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
495 if (error)
496 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Could not get unix user: %s", error->message);
497 else
498 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("Could not get unix user");
499
500 g_error_freecxx . . $ g_error_free(2ff7d11a2ecc01bd). (error);
501 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
502 }
503
504 g_variant_getcxx . . $ g_variant_get(671e9cd8f09cd612). (result, "(u)", sender_uid);
505 g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84). (result);
506
507 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
508 }
509
510 static char *
511 _cph_mechanism_get_sender_user_namecxx . . $ _cph_mechanism_get_sender_user_name(6f94b5e3751ec441). (CphMechanismcxx . . $ CphMechanism# *mechanism,
512 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context)
513 {
514 unsigned int sender_uid;
515 struct passwdcxx . . $ passwd# *password_entry;
516 char *user_name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
517
518 if (!_cph_mechanism_get_sender_uidcxx . . $ _cph_mechanism_get_sender_uid(5e514bd7fb42c3b7). (mechanism, context, &sender_uid))
519 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
520
521 password_entry = getpwuidcxx . . $ getpwuid(fd5493c96892938c). ((uid_tcxx . . $ uid_t#) sender_uid);
522
523 if (password_entry != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
524 user_name = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (password_entry->pw_name);
525
526 return user_name;
527 }
528
529 /* helpers */
530
531 static const char *
532 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (CphMechanismcxx . . $ CphMechanism# *mechanism,
533 gbooleancxx . . $ gboolean# failed)
534 {
535 const char *error;
536
537 if (failed) {
538 error = cph_cups_last_status_to_stringcxx . . $ cph_cups_last_status_to_string(fe5dba7ae85eaaa1). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.);
539 if (!error || error[0] == '\0')
540 error = "Unknown error";
541 } else
542 error = "";
543
544 return error;
545 }
546
547 static void
548 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (CphMechanismcxx . . $ CphMechanism# *mechanism)
549 {
550 g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (mechanism, signalscxx . . $ signals.[CALLEDcxx . . $ CALLED.], 0);
551 }
552
553 /* exported methods */
554
555 static gbooleancxx . . $ gboolean#
556 cph_mechanism_file_getcxx . . $ cph_mechanism_file_get(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
557 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
558 const char *resource,
559 const char *filename)
560 {
561 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
562 unsigned int sender_uid;
563 gbooleancxx . . $ gboolean# ret;
564
565 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
566
567 if (!_cph_mechanism_get_sender_uidcxx . . $ _cph_mechanism_get_sender_uid(5e514bd7fb42c3b7). (mechanism, context, &sender_uid)) {
568 GErrorcxx . . $ GError# *error;
569
570 error = g_error_newcxx . . $ g_error_new(c11b45e4af983f9e). (CPH_MECHANISM_ERRORcxx . . $ `src/cups-pk-helper-mechanism.h:70:9`!,
571 CPH_MECHANISM_ERROR_GENERALcxx . . $ CPH_MECHANISM_ERROR_GENERAL.,
572 "Cannot determine sender UID");
573 g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (context, error);
574 g_error_freecxx . . $ g_error_free(2ff7d11a2ecc01bd). (error);
575
576 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
577 }
578
579 if (!_check_polkit_for_actioncxx . . $ _check_polkit_for_action(aa239b07e0b12316). (mechanism, context, "server-settings"))
580 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
581
582 ret = cph_cups_file_getcxx . . $ cph_cups_file_get(a69052b54a5198d7). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
583 resource, filename, sender_uid);
584
585 cph_iface_mechanism_complete_file_getcxx . . $ cph_iface_mechanism_complete_file_get(e59615c611c7720d). (
586 object, context,
587 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
588 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
589 }
590
591 static gbooleancxx . . $ gboolean#
592 cph_mechanism_file_putcxx . . $ cph_mechanism_file_put(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
593 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
594 const char *resource,
595 const char *filename)
596 {
597 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
598 unsigned int sender_uid;
599 gbooleancxx . . $ gboolean# ret;
600
601 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
602
603 if (!_cph_mechanism_get_sender_uidcxx . . $ _cph_mechanism_get_sender_uid(5e514bd7fb42c3b7). (mechanism, context, &sender_uid)) {
604 GErrorcxx . . $ GError# *error;
605
606 error = g_error_newcxx . . $ g_error_new(c11b45e4af983f9e). (CPH_MECHANISM_ERRORcxx . . $ `src/cups-pk-helper-mechanism.h:70:9`!,
607 CPH_MECHANISM_ERROR_GENERALcxx . . $ CPH_MECHANISM_ERROR_GENERAL.,
608 "Cannot determine sender UID");
609 g_dbus_method_invocation_return_gerrorcxx . . $ g_dbus_method_invocation_return_gerror(f84b6a1e02aa551). (context, error);
610 g_error_freecxx . . $ g_error_free(2ff7d11a2ecc01bd). (error);
611
612 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
613 }
614
615 if (!_check_polkit_for_actioncxx . . $ _check_polkit_for_action(aa239b07e0b12316). (mechanism, context, "server-settings"))
616 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
617
618 ret = cph_cups_file_putcxx . . $ cph_cups_file_put(a69052b54a5198d7). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
619 resource, filename, sender_uid);
620
621 cph_iface_mechanism_complete_file_putcxx . . $ cph_iface_mechanism_complete_file_put(e59615c611c7720d). (
622 object, context,
623 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
624 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
625 }
626
627 static gbooleancxx . . $ gboolean#
628 cph_mechanism_server_get_settingscxx . . $ cph_mechanism_server_get_settings(bf52472ad38e96ca). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
629 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context)
630 {
631 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
632 gbooleancxx . . $ gboolean# ret;
633 GVariantcxx . . $ GVariant# *settings = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
634
635 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
636
637 if (!_check_polkit_for_actioncxx . . $ _check_polkit_for_action(aa239b07e0b12316). (mechanism, context, "server-settings"))
638 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
639
640 ret = cph_cups_server_get_settingscxx . . $ cph_cups_server_get_settings(2b91273638f4b07a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
641 &settings);
642
643 if (settings == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
644 settings = g_variant_new_arraycxx . . $ g_variant_new_array(d7b437745c64019c). (G_VARIANT_TYPE_DICT_ENTRYcxx . . $ `<external>/14064154155447831270/gvarianttype.h:227:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0);
645
646 cph_iface_mechanism_complete_server_get_settingscxx . . $ cph_iface_mechanism_complete_server_get_settings(bd00301474db3793). (
647 object, context,
648 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret),
649 settings);
650 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
651 }
652
653 static gbooleancxx . . $ gboolean#
654 cph_mechanism_server_set_settingscxx . . $ cph_mechanism_server_set_settings(fa5193a47470b54d). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
655 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
656 GVariantcxx . . $ GVariant# *settings)
657 {
658 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
659 gbooleancxx . . $ gboolean# ret;
660
661 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
662
663 if (!_check_polkit_for_actioncxx . . $ _check_polkit_for_action(aa239b07e0b12316). (mechanism, context, "server-settings"))
664 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
665
666 ret = cph_cups_server_set_settingscxx . . $ cph_cups_server_set_settings(2dc23f8e7f1136de). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., settings);
667
668 cph_iface_mechanism_complete_server_set_settingscxx . . $ cph_iface_mechanism_complete_server_set_settings(e59615c611c7720d). (
669 object, context,
670 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
671 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
672 }
673
674 static gbooleancxx . . $ gboolean#
675 cph_mechanism_devices_getcxx . . $ cph_mechanism_devices_get(c750580079d512e9). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
676 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
677 int timeout,
678 int limit,
679 const char *const *include_schemes,
680 const char *const *exclude_schemes)
681 {
682 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
683 gbooleancxx . . $ gboolean# ret;
684 GVariantcxx . . $ GVariant# *devices = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
685
686 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
687
688 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
689 "all-edit",
690 "devices-get",
691 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
692 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
693
694 ret = cph_cups_devices_getcxx . . $ cph_cups_devices_get(df68b11a853fe234). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
695 timeout,
696 limit,
697 include_schemes,
698 exclude_schemes,
699 &devices);
700
701 if (devices == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
702 devices = g_variant_new_arraycxx . . $ g_variant_new_array(d7b437745c64019c). (G_VARIANT_TYPE_DICT_ENTRYcxx . . $ `<external>/14064154155447831270/gvarianttype.h:227:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0);
703
704 cph_iface_mechanism_complete_devices_getcxx . . $ cph_iface_mechanism_complete_devices_get(bd00301474db3793). (
705 object, context,
706 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret),
707 devices);
708 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
709 }
710
711 static gbooleancxx . . $ gboolean#
712 cph_mechanism_printer_addcxx . . $ cph_mechanism_printer_add(8c7536c90e430234). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
713 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
714 const char *name,
715 const char *uri,
716 const char *ppd,
717 const char *info,
718 const char *location)
719 {
720 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
721 gbooleancxx . . $ gboolean# ret;
722
723 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
724
725 if (!_check_polkit_for_printercxx . . $ _check_polkit_for_printer(ba8ac26dd6ebb072). (mechanism, context, name, uri))
726 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
727
728 ret = cph_cups_printer_addcxx . . $ cph_cups_printer_add(b0e35bbae47f60e5). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
729 name, uri, ppd, info, location);
730
731 cph_iface_mechanism_complete_printer_addcxx . . $ cph_iface_mechanism_complete_printer_add(e59615c611c7720d). (
732 object, context,
733 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
734 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
735 }
736
737 static gbooleancxx . . $ gboolean#
738 cph_mechanism_printer_add_with_ppd_filecxx . . $ cph_mechanism_printer_add_with_ppd_file(8c7536c90e430234). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
739 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
740 const char *name,
741 const char *uri,
742 const char *ppdfile,
743 const char *info,
744 const char *location)
745 {
746 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
747 gbooleancxx . . $ gboolean# ret;
748
749 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
750
751 if (!_check_polkit_for_printercxx . . $ _check_polkit_for_printer(ba8ac26dd6ebb072). (mechanism, context, name, uri))
752 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
753
754 ret = cph_cups_printer_add_with_ppd_filecxx . . $ cph_cups_printer_add_with_ppd_file(b0e35bbae47f60e5). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
755 name, uri, ppdfile,
756 info, location);
757
758 cph_iface_mechanism_complete_printer_add_with_ppd_filecxx . . $ cph_iface_mechanism_complete_printer_add_with_ppd_file(e59615c611c7720d). (
759 object, context,
760 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
761 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
762 }
763
764 static gbooleancxx . . $ gboolean#
765 cph_mechanism_printer_set_devicecxx . . $ cph_mechanism_printer_set_device(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
766 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
767 const char *name,
768 const char *device)
769 {
770 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
771 gbooleancxx . . $ gboolean# ret;
772
773 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
774
775 if (!_check_polkit_for_printercxx . . $ _check_polkit_for_printer(ba8ac26dd6ebb072). (mechanism, context, name, device))
776 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
777
778 ret = cph_cups_printer_set_uricxx . . $ cph_cups_printer_set_uri(8deabc5eba159f7a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
779 name, device);
780
781 cph_iface_mechanism_complete_printer_set_devicecxx . . $ cph_iface_mechanism_complete_printer_set_device(e59615c611c7720d). (
782 object, context,
783 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
784 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
785 }
786
787 static gbooleancxx . . $ gboolean#
788 cph_mechanism_printer_set_defaultcxx . . $ cph_mechanism_printer_set_default(51381034a6f75157). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
789 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
790 const char *name)
791 {
792 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
793 gbooleancxx . . $ gboolean# ret;
794 const char *last_action;
795
796 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
797
798 last_action = _cph_mechanism_get_action_for_namecxx . . $ _cph_mechanism_get_action_for_name(20dce2b6b27cdb69). (mechanism, name);
799 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
800 "all-edit",
801 "printeraddremove",
802 /* this is not the last check because
803 * it's likely most useful to the user
804 * to give "printer-X-edit" powers */
805 "printer-default",
806 /* quite important, since it's
807 * automatically called after adding a
808 * printer */
809 last_action,
810 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
811 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
812
813 ret = cph_cups_printer_set_defaultcxx . . $ cph_cups_printer_set_default(d2a4bae5b1c86351). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., name);
814
815 cph_iface_mechanism_complete_printer_set_defaultcxx . . $ cph_iface_mechanism_complete_printer_set_default(e59615c611c7720d). (
816 object, context,
817 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
818 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
819 }
820
821 static gbooleancxx . . $ gboolean#
822 cph_mechanism_printer_set_enabledcxx . . $ cph_mechanism_printer_set_enabled(768871f97f3197ec). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
823 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
824 const char *name,
825 gbooleancxx . . $ gboolean# enabled)
826 {
827 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
828 gbooleancxx . . $ gboolean# ret;
829 const char *last_action;
830
831 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
832
833 last_action = _cph_mechanism_get_action_for_namecxx . . $ _cph_mechanism_get_action_for_name(20dce2b6b27cdb69). (mechanism, name);
834 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
835 "all-edit",
836 "printeraddremove",
837 /* this is not the last check because
838 * it's likely most useful to the user
839 * to give "printer-X-edit" powers */
840 "printer-enable",
841 /* quite important, since it's
842 * automatically called after adding a
843 * printer */
844 last_action,
845 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
846 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
847
848 ret = cph_cups_printer_set_enabledcxx . . $ cph_cups_printer_set_enabled(430f7c4278a83922). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
849 name, enabled);
850
851 cph_iface_mechanism_complete_printer_set_enabledcxx . . $ cph_iface_mechanism_complete_printer_set_enabled(e59615c611c7720d). (
852 object, context,
853 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
854 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
855 }
856
857 static gbooleancxx . . $ gboolean#
858 cph_mechanism_printer_set_accept_jobscxx . . $ cph_mechanism_printer_set_accept_jobs(739a8433f1736070). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
859 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
860 const char *name,
861 gbooleancxx . . $ gboolean# enabled,
862 const char *reason)
863 {
864 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
865 gbooleancxx . . $ gboolean# ret;
866
867 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
868
869 if (!_check_polkit_for_printercxx . . $ _check_polkit_for_printer(ba8ac26dd6ebb072). (mechanism, context, name, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
870 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
871
872 if (reason && reason[0] == '\0')
873 reason = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
874
875 ret = cph_cups_printer_set_accept_jobscxx . . $ cph_cups_printer_set_accept_jobs(786b6556d8bc742a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
876 name, enabled, reason);
877
878 cph_iface_mechanism_complete_printer_set_accept_jobscxx . . $ cph_iface_mechanism_complete_printer_set_accept_jobs(e59615c611c7720d). (
879 object, context,
880 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
881 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
882 }
883
884 static gbooleancxx . . $ gboolean#
885 cph_mechanism_printer_deletecxx . . $ cph_mechanism_printer_delete(51381034a6f75157). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
886 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
887 const char *name)
888 {
889 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
890 gbooleancxx . . $ gboolean# ret;
891
892 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
893
894 if (!_check_polkit_for_printercxx . . $ _check_polkit_for_printer(ba8ac26dd6ebb072). (mechanism, context, name, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
895 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
896
897 ret = cph_cups_printer_deletecxx . . $ cph_cups_printer_delete(d2a4bae5b1c86351). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., name);
898
899 cph_iface_mechanism_complete_printer_deletecxx . . $ cph_iface_mechanism_complete_printer_delete(e59615c611c7720d). (
900 object, context,
901 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
902 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
903 }
904
905 static gbooleancxx . . $ gboolean#
906 cph_mechanism_printer_class_renamecxx . . $ cph_mechanism_printer_class_rename(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
907 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
908 const char *old_printer_name,
909 const char *new_printer_name)
910 {
911 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
912 gbooleancxx . . $ gboolean# ret;
913
914 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
915
916 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, old_printer_name))
917 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
918
919 ret = cph_cups_printer_class_renamecxx . . $ cph_cups_printer_class_rename(8deabc5eba159f7a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., old_printer_name, new_printer_name);
920
921 cph_iface_mechanism_complete_printer_renamecxx . . $ cph_iface_mechanism_complete_printer_rename(e59615c611c7720d). (
922 object, context,
923 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
924 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
925 }
926
927 static gbooleancxx . . $ gboolean#
928 cph_mechanism_class_add_printercxx . . $ cph_mechanism_class_add_printer(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
929 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
930 const char *name,
931 const char *printer)
932 {
933 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
934 gbooleancxx . . $ gboolean# ret;
935
936 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
937
938 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
939 "all-edit",
940 "printeraddremove",
941 "class-edit",
942 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
943 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
944
945 ret = cph_cups_class_add_printercxx . . $ cph_cups_class_add_printer(8deabc5eba159f7a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
946 name, printer);
947
948 cph_iface_mechanism_complete_class_add_printercxx . . $ cph_iface_mechanism_complete_class_add_printer(e59615c611c7720d). (
949 object, context,
950 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
951 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
952 }
953
954 static gbooleancxx . . $ gboolean#
955 cph_mechanism_class_delete_printercxx . . $ cph_mechanism_class_delete_printer(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
956 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
957 const char *name,
958 const char *printer)
959 {
960 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
961 gbooleancxx . . $ gboolean# ret;
962
963 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
964
965 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
966 "all-edit",
967 "printeraddremove",
968 "class-edit",
969 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
970 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
971
972 ret = cph_cups_class_delete_printercxx . . $ cph_cups_class_delete_printer(8deabc5eba159f7a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
973 name, printer);
974
975 cph_iface_mechanism_complete_class_delete_printercxx . . $ cph_iface_mechanism_complete_class_delete_printer(e59615c611c7720d). (
976 object, context,
977 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
978 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
979 }
980
981 static gbooleancxx . . $ gboolean#
982 cph_mechanism_class_deletecxx . . $ cph_mechanism_class_delete(51381034a6f75157). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
983 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
984 const char *name)
985 {
986 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
987 gbooleancxx . . $ gboolean# ret;
988
989 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
990
991 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
992 "all-edit",
993 "printeraddremove",
994 "class-edit",
995 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
996 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
997
998 ret = cph_cups_class_deletecxx . . $ cph_cups_class_delete(d2a4bae5b1c86351). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., name);
999
1000 cph_iface_mechanism_complete_class_deletecxx . . $ cph_iface_mechanism_complete_class_delete(e59615c611c7720d). (
1001 object, context,
1002 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1003 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1004 }
1005
1006 static gbooleancxx . . $ gboolean#
1007 cph_mechanism_printer_set_infocxx . . $ cph_mechanism_printer_set_info(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1008 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1009 const char *name,
1010 const char *info)
1011 {
1012 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1013 gbooleancxx . . $ gboolean# ret;
1014
1015 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1016
1017 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1018 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1019
1020 ret = cph_cups_printer_class_set_infocxx . . $ cph_cups_printer_class_set_info(8deabc5eba159f7a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1021 name, info);
1022
1023 cph_iface_mechanism_complete_printer_set_infocxx . . $ cph_iface_mechanism_complete_printer_set_info(e59615c611c7720d). (
1024 object, context,
1025 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1026 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1027 }
1028
1029 static gbooleancxx . . $ gboolean#
1030 cph_mechanism_printer_set_locationcxx . . $ cph_mechanism_printer_set_location(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1031 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1032 const char *name,
1033 const char *location)
1034 {
1035 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1036 gbooleancxx . . $ gboolean# ret;
1037
1038 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1039
1040 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1041 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1042
1043 ret = cph_cups_printer_class_set_locationcxx . . $ cph_cups_printer_class_set_location(8deabc5eba159f7a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1044 name, location);
1045
1046 cph_iface_mechanism_complete_printer_set_locationcxx . . $ cph_iface_mechanism_complete_printer_set_location(e59615c611c7720d). (
1047 object, context,
1048 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1049 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1050 }
1051
1052 static gbooleancxx . . $ gboolean#
1053 cph_mechanism_printer_set_sharedcxx . . $ cph_mechanism_printer_set_shared(768871f97f3197ec). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1054 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1055 const char *name,
1056 gbooleancxx . . $ gboolean# shared)
1057 {
1058 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1059 gbooleancxx . . $ gboolean# ret;
1060
1061 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1062
1063 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1064 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1065
1066 ret = cph_cups_printer_class_set_sharedcxx . . $ cph_cups_printer_class_set_shared(430f7c4278a83922). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1067 name, shared);
1068
1069 cph_iface_mechanism_complete_printer_set_sharedcxx . . $ cph_iface_mechanism_complete_printer_set_shared(e59615c611c7720d). (
1070 object, context,
1071 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1072 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1073 }
1074
1075 static gbooleancxx . . $ gboolean#
1076 cph_mechanism_printer_set_job_sheetscxx . . $ cph_mechanism_printer_set_job_sheets(90bb411d183e4183). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1077 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1078 const char *name,
1079 const char *start,
1080 const char *end)
1081 {
1082 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1083 gbooleancxx . . $ gboolean# ret;
1084
1085 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1086
1087 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1088 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1089
1090 ret = cph_cups_printer_class_set_job_sheetscxx . . $ cph_cups_printer_class_set_job_sheets(9408b2ae6e28805f). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1091 name, start, end);
1092
1093 cph_iface_mechanism_complete_printer_set_job_sheetscxx . . $ cph_iface_mechanism_complete_printer_set_job_sheets(e59615c611c7720d). (
1094 object, context,
1095 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1096 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1097 }
1098
1099 static gbooleancxx . . $ gboolean#
1100 cph_mechanism_printer_set_error_policycxx . . $ cph_mechanism_printer_set_error_policy(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1101 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1102 const char *name,
1103 const char *policy)
1104 {
1105 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1106 gbooleancxx . . $ gboolean# ret;
1107
1108 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1109
1110 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1111 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1112
1113 ret = cph_cups_printer_class_set_error_policycxx . . $ cph_cups_printer_class_set_error_policy(8deabc5eba159f7a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1114 name, policy);
1115
1116 cph_iface_mechanism_complete_printer_set_error_policycxx . . $ cph_iface_mechanism_complete_printer_set_error_policy(e59615c611c7720d). (
1117 object, context,
1118 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1119 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1120 }
1121
1122 static gbooleancxx . . $ gboolean#
1123 cph_mechanism_printer_set_op_policycxx . . $ cph_mechanism_printer_set_op_policy(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1124 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1125 const char *name,
1126 const char *policy)
1127 {
1128 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1129 gbooleancxx . . $ gboolean# ret;
1130
1131 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1132
1133 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1134 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1135
1136 ret = cph_cups_printer_class_set_op_policycxx . . $ cph_cups_printer_class_set_op_policy(8deabc5eba159f7a). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1137 name, policy);
1138
1139 cph_iface_mechanism_complete_printer_set_op_policycxx . . $ cph_iface_mechanism_complete_printer_set_op_policy(e59615c611c7720d). (
1140 object, context,
1141 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1142 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1143 }
1144
1145 static gbooleancxx . . $ gboolean#
1146 cph_mechanism_printer_set_users_allowedcxx . . $ cph_mechanism_printer_set_users_allowed(2034872b128896f3). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1147 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1148 const char *name,
1149 const char *const *users)
1150 {
1151 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1152 gbooleancxx . . $ gboolean# ret;
1153
1154 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1155
1156 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1157 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1158
1159 ret = cph_cups_printer_class_set_users_allowedcxx . . $ cph_cups_printer_class_set_users_allowed(b9140d54d1ec2b30). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1160 name, users);
1161
1162 cph_iface_mechanism_complete_printer_set_users_allowedcxx . . $ cph_iface_mechanism_complete_printer_set_users_allowed(e59615c611c7720d). (
1163 object, context,
1164 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1165 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1166 }
1167
1168 static gbooleancxx . . $ gboolean#
1169 cph_mechanism_printer_set_users_deniedcxx . . $ cph_mechanism_printer_set_users_denied(2034872b128896f3). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1170 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1171 const char *name,
1172 const char *const *users)
1173 {
1174 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1175 gbooleancxx . . $ gboolean# ret;
1176
1177 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1178
1179 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1180 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1181
1182 ret = cph_cups_printer_class_set_users_deniedcxx . . $ cph_cups_printer_class_set_users_denied(b9140d54d1ec2b30). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1183 name, users);
1184
1185 cph_iface_mechanism_complete_printer_set_users_deniedcxx . . $ cph_iface_mechanism_complete_printer_set_users_denied(e59615c611c7720d). (
1186 object, context,
1187 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1188 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1189 }
1190
1191 static gbooleancxx . . $ gboolean#
1192 cph_mechanism_printer_add_option_defaultcxx . . $ cph_mechanism_printer_add_option_default(c6a1cd694e95929). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1193 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1194 const char *name,
1195 const char *option,
1196 const char *const *values)
1197 {
1198 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1199 gbooleancxx . . $ gboolean# ret;
1200
1201 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1202
1203 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1204 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1205
1206 ret = cph_cups_printer_class_set_option_defaultcxx . . $ cph_cups_printer_class_set_option_default(eb1760e316fc7011). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1207 name, option, values);
1208
1209 cph_iface_mechanism_complete_printer_add_option_defaultcxx . . $ cph_iface_mechanism_complete_printer_add_option_default(e59615c611c7720d). (
1210 object, context,
1211 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1212 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1213 }
1214
1215 static gbooleancxx . . $ gboolean#
1216 cph_mechanism_printer_delete_option_defaultcxx . . $ cph_mechanism_printer_delete_option_default(41eb9bae3afd0615). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1217 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1218 const char *name,
1219 const char *option)
1220 {
1221 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1222 gbooleancxx . . $ gboolean# ret;
1223
1224 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1225
1226 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1227 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1228
1229 ret = cph_cups_printer_class_set_option_defaultcxx . . $ cph_cups_printer_class_set_option_default(eb1760e316fc7011). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1230 name, option, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1231
1232 cph_iface_mechanism_complete_printer_delete_option_defaultcxx . . $ cph_iface_mechanism_complete_printer_delete_option_default(e59615c611c7720d). (
1233 object, context,
1234 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1235 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1236 }
1237
1238 static gbooleancxx . . $ gboolean#
1239 cph_mechanism_printer_add_optioncxx . . $ cph_mechanism_printer_add_option(c6a1cd694e95929). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1240 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1241 const char *name,
1242 const char *option,
1243 const char *const *values)
1244 {
1245 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1246 gbooleancxx . . $ gboolean# ret;
1247
1248 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1249
1250 if (!_check_polkit_for_printer_classcxx . . $ _check_polkit_for_printer_class(aa239b07e0b12316). (mechanism, context, name))
1251 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1252
1253 ret = cph_cups_printer_class_set_optioncxx . . $ cph_cups_printer_class_set_option(eb1760e316fc7011). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1254 name, option, values);
1255
1256 cph_iface_mechanism_complete_printer_add_optioncxx . . $ cph_iface_mechanism_complete_printer_add_option(e59615c611c7720d). (
1257 object, context,
1258 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1259 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1260 }
1261
1262 static gbooleancxx . . $ gboolean#
1263 cph_mechanism_job_cancel_purgecxx . . $ cph_mechanism_job_cancel_purge(e4a5ae23951ce83d). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1264 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1265 int id,
1266 gbooleancxx . . $ gboolean# purge)
1267 {
1268 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1269 CphJobStatuscxx . . $ CphJobStatus# job_status;
1270 gbooleancxx . . $ gboolean# ret;
1271 char *user_name;
1272
1273 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1274
1275 user_name = _cph_mechanism_get_sender_user_namecxx . . $ _cph_mechanism_get_sender_user_name(6f94b5e3751ec441). (mechanism, context);
1276 job_status = cph_cups_job_get_statuscxx . . $ cph_cups_job_get_status(5059be8c177b392). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1277 id, user_name);
1278
1279 switch (job_status) {
1280 case CPH_JOB_STATUS_OWNED_BY_USERcxx . . $ CPH_JOB_STATUS_OWNED_BY_USER.: {
1281 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
1282 "all-edit",
1283 "job-not-owned-edit",
1284 "job-edit",
1285 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
1286 goto out;
1287 break;
1288 }
1289 case CPH_JOB_STATUS_NOT_OWNED_BY_USERcxx . . $ CPH_JOB_STATUS_NOT_OWNED_BY_USER.: {
1290 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
1291 "all-edit",
1292 "job-not-owned-edit",
1293 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
1294 goto out;
1295 break;
1296 }
1297 case CPH_JOB_STATUS_INVALIDcxx . . $ CPH_JOB_STATUS_INVALID.: {
1298 cph_iface_mechanism_complete_job_cancel_purgecxx . . $ cph_iface_mechanism_complete_job_cancel_purge(e59615c611c7720d). (
1299 object, context,
1300 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!));
1301 goto out;
1302 }
•1303 default:
1304 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`!("Invalid value in enum");
1305 }
1306
1307 ret = cph_cups_job_cancelcxx . . $ cph_cups_job_cancel(c067b03ae278f726). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., id, purge, user_name);
1308
1309 cph_iface_mechanism_complete_job_cancel_purgecxx . . $ cph_iface_mechanism_complete_job_cancel_purge(e59615c611c7720d). (
1310 object, context,
1311 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1312
1313 out:
1314 g_freecxx . . $ g_free(5d22bdacc48458e8). (user_name);
1315
1316 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1317 }
1318
1319 static gbooleancxx . . $ gboolean#
1320 cph_mechanism_job_cancelcxx . . $ cph_mechanism_job_cancel(47919404fb961074). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1321 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1322 int id)
1323 {
1324 /* This only works because cph_iface_mechanism_complete_job_cancel and
1325 * cph_iface_mechanism_complete_job_cancel_purge do the same thing. */
1326 return cph_mechanism_job_cancel_purgecxx . . $ cph_mechanism_job_cancel_purge(e4a5ae23951ce83d). (object, context, id, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!);
1327 }
1328
1329 static gbooleancxx . . $ gboolean#
1330 cph_mechanism_job_restartcxx . . $ cph_mechanism_job_restart(47919404fb961074). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1331 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1332 int id)
1333 {
1334 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1335 CphJobStatuscxx . . $ CphJobStatus# job_status;
1336 gbooleancxx . . $ gboolean# ret;
1337 char *user_name;
1338
1339 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1340
1341 user_name = _cph_mechanism_get_sender_user_namecxx . . $ _cph_mechanism_get_sender_user_name(6f94b5e3751ec441). (mechanism, context);
1342 job_status = cph_cups_job_get_statuscxx . . $ cph_cups_job_get_status(5059be8c177b392). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1343 id, user_name);
1344
1345 switch (job_status) {
1346 case CPH_JOB_STATUS_OWNED_BY_USERcxx . . $ CPH_JOB_STATUS_OWNED_BY_USER.: {
1347 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
1348 "all-edit",
1349 "job-not-owned-edit",
1350 "job-edit",
1351 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
1352 goto out;
1353 break;
1354 }
1355 case CPH_JOB_STATUS_NOT_OWNED_BY_USERcxx . . $ CPH_JOB_STATUS_NOT_OWNED_BY_USER.: {
1356 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
1357 "all-edit",
1358 "job-not-owned-edit",
1359 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
1360 goto out;
1361 break;
1362 }
1363 case CPH_JOB_STATUS_INVALIDcxx . . $ CPH_JOB_STATUS_INVALID.: {
1364 cph_iface_mechanism_complete_job_restartcxx . . $ cph_iface_mechanism_complete_job_restart(e59615c611c7720d). (
1365 object, context,
1366 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!));
1367 goto out;
1368 }
•1369 default:
1370 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`!("Invalid value in enum");
1371 }
1372
1373 ret = cph_cups_job_restartcxx . . $ cph_cups_job_restart(51772e7e05d22d73). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., id, user_name);
1374
1375 cph_iface_mechanism_complete_job_restartcxx . . $ cph_iface_mechanism_complete_job_restart(e59615c611c7720d). (
1376 object, context,
1377 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1378
1379 out:
1380 g_freecxx . . $ g_free(5d22bdacc48458e8). (user_name);
1381
1382 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1383 }
1384
1385 static gbooleancxx . . $ gboolean#
1386 cph_mechanism_job_set_hold_untilcxx . . $ cph_mechanism_job_set_hold_until(f6ee7a4a83258831). (CphIfaceMechanismcxx . . $ CphIfaceMechanism# *object,
1387 GDBusMethodInvocationcxx . . $ GDBusMethodInvocation# *context,
1388 int id,
1389 const char *job_hold_until)
1390 {
1391 CphMechanismcxx . . $ CphMechanism# *mechanism = CPH_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:40:9`! (object);
1392 CphJobStatuscxx . . $ CphJobStatus# job_status;
1393 gbooleancxx . . $ gboolean# ret;
1394 char *user_name;
1395
1396 _cph_mechanism_emit_calledcxx . . $ _cph_mechanism_emit_called(450a3200f2662a35). (mechanism);
1397
1398 user_name = _cph_mechanism_get_sender_user_namecxx . . $ _cph_mechanism_get_sender_user_name(6f94b5e3751ec441). (mechanism, context);
1399 job_status = cph_cups_job_get_statuscxx . . $ cph_cups_job_get_status(5059be8c177b392). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups.,
1400 id, user_name);
1401
1402 switch (job_status) {
1403 case CPH_JOB_STATUS_OWNED_BY_USERcxx . . $ CPH_JOB_STATUS_OWNED_BY_USER.: {
1404 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
1405 "all-edit",
1406 "job-not-owned-edit",
1407 "job-edit",
1408 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
1409 goto out;
1410 break;
1411 }
1412 case CPH_JOB_STATUS_NOT_OWNED_BY_USERcxx . . $ CPH_JOB_STATUS_NOT_OWNED_BY_USER.: {
1413 if (!_check_polkit_for_action_vcxx . . $ _check_polkit_for_action_v(3688b355b88e98bc). (mechanism, context,
1414 "all-edit",
1415 "job-not-owned-edit",
1416 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
1417 goto out;
1418 break;
1419 }
1420 case CPH_JOB_STATUS_INVALIDcxx . . $ CPH_JOB_STATUS_INVALID.: {
1421 cph_iface_mechanism_complete_job_set_hold_untilcxx . . $ cph_iface_mechanism_complete_job_set_hold_until(e59615c611c7720d). (
1422 object, context,
1423 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!));
1424 goto out;
1425 }
•1426 default:
1427 g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`!("Invalid value in enum");
1428 }
1429
1430 ret = cph_cups_job_set_hold_untilcxx . . $ cph_cups_job_set_hold_until(b3cddc12226d67a2). (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->cupscxx . . $ CphMechanismPrivate#cups., id, job_hold_until, user_name);
1431
1432 cph_iface_mechanism_complete_job_set_hold_untilcxx . . $ cph_iface_mechanism_complete_job_set_hold_until(e59615c611c7720d). (
1433 object, context,
1434 _cph_mechanism_return_errorcxx . . $ _cph_mechanism_return_error(c2c933787539f1c). (mechanism, !ret));
1435
1436 out:
1437 g_freecxx . . $ g_free(5d22bdacc48458e8). (user_name);
1438
1439 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1440 }
1441
1442 /* connect methors */
1443
1444 static void
1445 cph_mechanism_connect_signalscxx . . $ cph_mechanism_connect_signals(450a3200f2662a35). (CphMechanismcxx . . $ CphMechanism# *mechanism)
1446 {
1447 g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (CPH_IS_MECHANISMcxx . . $ `src/cups-pk-helper-mechanism.h:42:9`! (mechanism));
1448
1449 if (mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->connectedcxx . . $ CphMechanismPrivate#connected.)
1450 return;
1451
1452 mechanism->privcxx . . $ $anonymous_type_46239d3296982716_0#priv.->connectedcxx . . $ CphMechanismPrivate#connected. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
1453
1454 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1455 "handle-class-add-printer",
1456 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_class_add_printer),
1457 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1458 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1459 "handle-class-delete",
1460 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_class_delete),
1461 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1462 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1463 "handle-class-delete-printer",
1464 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_class_delete_printer),
1465 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1466 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1467 "handle-devices-get",
1468 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_devices_get),
1469 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1470 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1471 "handle-file-get",
1472 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_file_get),
1473 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1474 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1475 "handle-file-put",
1476 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_file_put),
1477 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1478 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1479 "handle-job-cancel",
1480 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_job_cancel),
1481 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1482 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1483 "handle-job-cancel-purge",
1484 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_job_cancel_purge),
1485 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1486 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1487 "handle-job-restart",
1488 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_job_restart),
1489 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1490 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1491 "handle-job-set-hold-until",
1492 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_job_set_hold_until),
1493 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1494 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1495 "handle-printer-add",
1496 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_add),
1497 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1498 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1499 "handle-printer-add-option",
1500 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_add_option),
1501 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1502 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1503 "handle-printer-add-option-default",
1504 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_add_option_default),
1505 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1506 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1507 "handle-printer-add-with-ppd-file",
1508 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_add_with_ppd_file),
1509 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1510 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1511 "handle-printer-delete",
1512 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_delete),
1513 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1514 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1515 "handle-printer-delete-option-default",
1516 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_delete_option_default),
1517 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1518 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1519 "handle-printer-rename",
1520 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_class_rename),
1521 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1522 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1523 "handle-printer-set-accept-jobs",
1524 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_accept_jobs),
1525 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1526 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1527 "handle-printer-set-default",
1528 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_default),
1529 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1530 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1531 "handle-printer-set-device",
1532 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_device),
1533 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1534 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1535 "handle-printer-set-enabled",
1536 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_enabled),
1537 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1538 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1539 "handle-printer-set-error-policy",
1540 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_error_policy),
1541 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1542 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1543 "handle-printer-set-info",
1544 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_info),
1545 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1546 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1547 "handle-printer-set-job-sheets",
1548 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_job_sheets),
1549 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1550 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1551 "handle-printer-set-location",
1552 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_location),
1553 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1554 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1555 "handle-printer-set-op-policy",
1556 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_op_policy),
1557 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1558 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1559 "handle-printer-set-shared",
1560 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_shared),
1561 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1562 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1563 "handle-printer-set-users-allowed",
1564 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_users_allowed),
1565 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1566 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1567 "handle-printer-set-users-denied",
1568 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_printer_set_users_denied),
1569 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1570 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1571 "handle-server-get-settings",
1572 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_server_get_settings),
1573 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1574 g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (mechanism,
1575 "handle-server-set-settings",
1576 G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (cph_mechanism_server_set_settings),
1577 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1578 }