~ubuntu-branches/ubuntu/trusty/network-manager-applet/trusty-updates

« back to all changes in this revision

Viewing changes to src/wireless-security/ws-wpa-psk.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2014-03-18 14:48:18 UTC
  • Revision ID: package-import@ubuntu.com-20140318144818-iepmr37nqr0nzxup
Tags: 0.9.8.8-0ubuntu3
debian/patches/11-user-connections.patch: Allow users with access to modify
their own connection to create wireless connections without using
system-wide privileges. (LP: #1116317)

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
{
93
93
        GtkWidget *widget;
94
94
        const char *key;
 
95
        NMSettingConnection *s_con;
95
96
        NMSettingWireless *s_wireless;
96
97
        NMSettingWirelessSecurity *s_wireless_sec;
97
98
        const char *mode;
98
99
        gboolean is_adhoc = FALSE;
99
100
 
 
101
        s_con = nm_connection_get_setting_connection (connection);
100
102
        s_wireless = nm_connection_get_setting_wireless (connection);
101
103
        g_assert (s_wireless);
102
104
 
113
115
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wpa_psk_entry"));
114
116
        key = gtk_entry_get_text (GTK_ENTRY (widget));
115
117
        g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_PSK, key, NULL);
 
118
        /* If the connection is user-owned, mark the secrets as agent-owned */
 
119
        if (s_con && nm_setting_connection_get_num_permissions (s_con))
 
120
                g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_PSK_FLAGS, NM_SETTING_SECRET_FLAG_AGENT_OWNED, NULL);
116
121
 
117
122
        wireless_security_clear_ciphers (connection);
118
123
        if (is_adhoc) {