~noskcaj/ubuntu/vivid/gnome-system-monitor/titlebars

« back to all changes in this revision

Viewing changes to src/gsm_pkexec.cpp

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson
  • Date: 2014-02-17 22:12:59 UTC
  • mfrom: (1.4.12) (15 sid)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: package-import@ubuntu.com-20140217221259-khdbenb3wt1b81zw
Tags: 3.11.90-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
gboolean gsm_pkexec_create_root_password_dialog(const char *command)
9
9
{
 
10
    gboolean ret = FALSE;
10
11
    gint *exit_status = NULL;
11
12
    GError *error = NULL;
12
 
    if (!g_spawn_command_line_sync( g_strdup_printf("pkexec %s/gsm-%s", GSM_LIBEXEC_DIR, command), NULL, NULL, exit_status, &error)) {
 
13
    gchar *command_line = g_strdup_printf("pkexec %s/gsm-%s",
 
14
                                          GSM_LIBEXEC_DIR, command);
 
15
    if (!g_spawn_command_line_sync(command_line, NULL, NULL, exit_status, &error)) {
13
16
        g_critical("Could not run pkexec(\"%s\") : %s\n",
14
17
                   command, error->message);
15
18
        g_error_free(error);
16
 
        return FALSE;
17
 
    }
18
 
 
19
 
    g_message("pkexec did fine\n");
20
 
    return TRUE;
 
19
    }
 
20
    else
 
21
    {
 
22
        g_message("pkexec did fine\n");
 
23
        ret = TRUE;
 
24
    }
 
25
 
 
26
    g_free (command_line);
 
27
 
 
28
    return ret;
21
29
}
22
30
 
23
31