diff options
Diffstat (limited to 'src/cups-pk-helper-mechanism.c')
-rw-r--r-- | src/cups-pk-helper-mechanism.c | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/src/cups-pk-helper-mechanism.c b/src/cups-pk-helper-mechanism.c index 6a6a628..0857524 100644 --- a/src/cups-pk-helper-mechanism.c +++ b/src/cups-pk-helper-mechanism.c @@ -58,7 +58,7 @@ static gboolean do_exit (gpointer user_data) { - if (user_data != NULL) + if (user_data != NULL) g_object_unref (CPH_MECHANISM (user_data)); exit (0); @@ -480,7 +480,9 @@ _cph_mechanism_get_callers_user_name (CphMechanism *mechanism, sender = dbus_g_method_get_sender (context); dbus_error_init (&dbus_error); - sender_uid = dbus_bus_get_unix_user (dbus_g_connection_get_connection (mechanism->priv->system_bus_connection), sender, &dbus_error); + sender_uid = dbus_bus_get_unix_user ( + dbus_g_connection_get_connection (mechanism->priv->system_bus_connection), + sender, &dbus_error); password_entry = getpwuid ((uid_t) sender_uid); if (password_entry != NULL) @@ -1045,21 +1047,26 @@ cph_mechanism_job_cancel (CphMechanism *mechanism, { CphJobStatus job_status; gboolean ret; - char *user_name = NULL; + char *user_name; reset_killtimer (mechanism); user_name = _cph_mechanism_get_callers_user_name (mechanism, context); - job_status = cph_cups_job_get_status (mechanism->priv->cups, id, user_name); + job_status = cph_cups_job_get_status (mechanism->priv->cups, + id, user_name); switch (job_status) { case CPH_JOB_STATUS_OWNED_BY_USER: { - if (!_check_polkit_for_action_v (mechanism, context, "job-not-owned-edit", "job-edit", NULL)) + if (!_check_polkit_for_action_v (mechanism, context, + "job-not-owned-edit", + "job-edit", + NULL)) return FALSE; break; } case CPH_JOB_STATUS_NOT_OWNED_BY_USER: { - if (!_check_polkit_for_action (mechanism, context, "job-not-owned-edit")) + if (!_check_polkit_for_action (mechanism, context, + "job-not-owned-edit")) return FALSE; break; } @@ -1082,21 +1089,26 @@ cph_mechanism_job_restart (CphMechanism *mechanism, { CphJobStatus job_status; gboolean ret; - char *user_name = NULL; + char *user_name; reset_killtimer (mechanism); user_name = _cph_mechanism_get_callers_user_name (mechanism, context); - job_status = cph_cups_job_get_status (mechanism->priv->cups, id, user_name); + job_status = cph_cups_job_get_status (mechanism->priv->cups, + id, user_name); switch (job_status) { case CPH_JOB_STATUS_OWNED_BY_USER: { - if (!_check_polkit_for_action_v (mechanism, context, "job-not-owned-edit", "job-edit", NULL)) + if (!_check_polkit_for_action_v (mechanism, context, + "job-not-owned-edit", + "job-edit", + NULL)) return FALSE; break; } case CPH_JOB_STATUS_NOT_OWNED_BY_USER: { - if (!_check_polkit_for_action (mechanism, context, "job-not-owned-edit")) + if (!_check_polkit_for_action (mechanism, context, + "job-not-owned-edit")) return FALSE; break; } @@ -1120,21 +1132,26 @@ cph_mechanism_job_set_hold_until (CphMechanism *mechanism, { CphJobStatus job_status; gboolean ret; - char *user_name = NULL; + char *user_name; reset_killtimer (mechanism); user_name = _cph_mechanism_get_callers_user_name (mechanism, context); - job_status = cph_cups_job_get_status (mechanism->priv->cups, id, user_name); + job_status = cph_cups_job_get_status (mechanism->priv->cups, + id, user_name); switch (job_status) { case CPH_JOB_STATUS_OWNED_BY_USER: { - if (!_check_polkit_for_action_v (mechanism, context, "job-not-owned-edit", "job-edit", NULL)) + if (!_check_polkit_for_action_v (mechanism, context, + "job-not-owned-edit", + "job-edit", + NULL)) return FALSE; break; } case CPH_JOB_STATUS_NOT_OWNED_BY_USER: { - if (!_check_polkit_for_action (mechanism, context, "job-not-owned-edit")) + if (!_check_polkit_for_action (mechanism, context, + "job-not-owned-edit")) return FALSE; break; } |