Comment 9 for bug 967978

Revision history for this message
Matt Fischer (mfisch) wrote :

The button is only shown if you are in the admin group. On one of my laptops, my user is, on another fresh install, it is not. I do not know why that is, but the logic needs to be re-examined:

static gboolean
is_admin ()
{
        gid_t groups [1024];
        int i, ngroups;
        struct group *admin;

        admin = getgrnam ("admin");
        if (admin == NULL)
                return FALSE;

        ngroups = getgroups (1024, groups);
        if (ngroups < 0) {
                perror ("getgroups");
                return FALSE;
        }

        for (i = 0; i < ngroups; ++i) {
                if (groups[i] == admin->gr_gid)
                        return TRUE;
        }

        return FALSE;
}

        /* System wide proxy settings */
        if (is_admin ()) {
                g_signal_connect (G_OBJECT (gtk_builder_get_object (panel->priv->builder, "system_proxy_button")), "clicked",
                                  G_CALLBACK (on_proxy_apply_system_wide), panel);
        } else
                gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "system_proxy_button")));

Perhaps the cause is this change?
"Move "admin" group to "sudo""
https://bugs.launchpad.net/ubuntu/+source/policykit-1/+bug/893842