OBS User unknown
2007-08-03 19:52:32 +00:00
committed by Git OBS Bridge
parent 41650006ea
commit a8a83a91a7
26 changed files with 1801 additions and 26090 deletions
+18
View File
@@ -1,3 +1,21 @@
-------------------------------------------------------------------
Fri Aug 3 12:00:44 CEST 2007 - sbrabec@suse.cz
- Updated gnome-patch-translation support.
-------------------------------------------------------------------
Fri Aug 3 11:30:17 CEST 2007 - tambet@suse.de
- Update to the latest version from upstream:
Add support for 2-phase authentication.
Add support for rfkill switch.
- Add an editor for stored wireless networks.
- Fix the packaging bug where the log file was not owned by the package
(Novell #280464).
- Fix the issue where NM doesn't honor YaST Static IP Settings
(Novell #271757).
- Fix the packaging issue to not require gnome-panel (Novell #229291).
-------------------------------------------------------------------
Tue May 15 10:07:27 CEST 2007 - pgajdos@suse.cz
+99 -40
View File
@@ -1,5 +1,5 @@
#
# spec file for package NetworkManager (Version 0.6.4)
# spec file for package NetworkManager (Version 0.6.5)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,7 +11,7 @@
# norootforbuild
Name: NetworkManager
BuildRequires: dhcdbd gconf2-devel gnome-keyring-devel gnome-panel-devel gnome-patch-translation hal-devel intltool iproute2 libgcrypt-devel libglade2-devel libgpg-error-devel libnl-devel libnotify-devel libtool wireless-tools wpa_supplicant
BuildRequires: dhcdbd fdupes gconf2-devel gnome-keyring-devel gnome-patch-translation hal-devel intltool iproute2 libgcrypt-devel libglade2-devel libgnomeui-devel libgpg-error-devel libnl-devel libnotify-devel libtool wireless-tools wpa_supplicant
%if %suse_version > 1010
BuildRequires: dbus-1-glib-devel
%else
@@ -23,33 +23,41 @@ BuildRequires: dbus-1-devel dbus-1-glib
%define wpa_supplicant_version 0.4.8-14
%define resmgr_version 0.9.8
%define dhcp_version 3.0.3-22
%define gtk_version 2.6.0
%define keyring_version 0.4.4
%define gtk_version 2.6.0
%define keyring_version 0.4.4
%define libnl_version 1.0-6
%define dhcdbd_version 1.12-19
%define sysconfig_version 0.50.9-13.3
License: GNU General Public License (GPL)
License: GPL v2 or later
Group: Productivity/Networking/System
URL: http://www.gnome.org/projects/NetworkManager/
Autoreqprov: on
Version: 0.6.4
Release: 93
Version: 0.6.5
Release: 1
Summary: Network Link Manager and User Applications
Source0: NetworkManager-%{version}.tar.gz
Source1: nm-icons.tar.gz
Source2: nfs
Source3: nm-disconnect-wireless-on-exit.sh
Patch0: nm-0.6-branch.patch
Patch1: nm-make-wireless-menu-item-inactive-rml.patch
Patch2: nm-configure-networking-rml.patch
Patch3: nm-never-restart-nm-applet-rml.patch
Patch4: nm-madwifi-strength-rml.patch
Patch5: nm-wireless-driver-workarounds-rml.patch
Patch6: nm-resolv-conf-header-rml.patch
Patch7: nm-fix-adhoc-icon-rml.patch
Patch8: nm-fallback.patch
Patch9: nm-applet-disconnect-on-exit.patch
Patch10: nm-dbus-request-name-flags-fix-thoenig-01.patch
Source0: NetworkManager-%{version}.tar.bz2
Source1: network-manager-applet-%{version}.tar.bz2
Source2: nm-editor.tgz
Source3: nm-icons.tar.gz
Source4: nfs
Source5: nm-disconnect-wireless-on-exit.sh
Patch0: nm-wireless-driver-workarounds-rml.patch
Patch1: nm-resolv-conf-header-rml.patch
Patch2: nm-fallback.patch
Patch3: nm-222902.patch
Patch4: nm-191251.patch
Patch5: nm-0.6.5-killswitch-fix.patch
Patch6: nm-271757.patch
Patch7: nm-applet-0.6.5-build.patch
Patch8: nm-make-wireless-menu-item-inactive-rml.patch
Patch9: nm-configure-networking-rml.patch
Patch10: nm-never-restart-nm-applet-rml.patch
Patch11: nm-fix-adhoc-icon-rml.patch
Patch12: nm-applet-disconnect-on-exit.patch
Patch13: nm-243959.patch
Patch14: nm-applet-fallback.patch
Patch15: nm-save-passwds-in-keyring.patch
Patch16: nm-applet-editor.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: sysconfig >= %{sysconfig_version} /usr/bin/sed
Recommends: %{name}-client
@@ -85,7 +93,6 @@ Summary: GNOME applications for use with NetworkManager
Group: System/GUI/GNOME
Provides: %{name}-client
Requires: %{name} = %{version}-%{release}
Requires: gnome-panel libgnomesu
Requires: dbus-1 >= %{dbus_version}
Requires: dbus-1-glib >= %{dbus_version}
Requires: hal >= %{hal_version}
@@ -147,23 +154,36 @@ Authors:
Robert Love <rml@novell.com>
%prep
%setup -b 1
%setup -a 1 -a 2 -a 3
cd nm-applet-0.6.5
gnome-patch-translation-prepare
cd ..
%patch0 -p1
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p0
%patch5 -p0
%patch6 -p0
%patch7 -p0
%patch8 -p1
%patch9 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
mv editor nm-applet-0.6.5/
# applet
%patch7 -p1
%patch8 -p0
%patch9 -p0
%patch10 -p0
%patch11 -p0
%patch12 -p0
%patch13 -p0
%patch14 -p0
%patch15 -p0
%patch16 -p1
cd nm-applet-0.6.5
gnome-patch-translation-update
# Prepare directory for gnome-patch-translation-collect:
mv gnome-patch-translation ..
cd ..
%build
sed -i s/" --sm-disable"// nm-applet.desktop
intltoolize --force
autoreconf
%configure\
@@ -172,21 +192,41 @@ autoreconf
--with-gcrypt=yes\
--with-distro=suse
make %{?jobs:-j%jobs}
# applet
pushd nm-applet-0.6.5
sed -i s/" --sm-disable"// nm-applet.desktop
autoreconf -i
intltoolize --force
%configure\
--disable-static\
--with-notify
make
popd
%install
%fdupes -s $RPM_BUILD_ROOT
%makeinstall
mkdir -p $RPM_BUILD_ROOT/var/log/
touch $RPM_BUILD_ROOT/var/log/NetworkManager
# applet
pushd nm-applet-0.6.5
make install DESTDIR=$RPM_BUILD_ROOT
popd
%find_lang %{name}
cp -r ../nm-icons/* $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/
%find_lang nm-applet
cat nm-applet.lang >> %{name}.lang
cp -r nm-icons/* $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/
cp test/nm-tool $RPM_BUILD_ROOT%{_bindir}/
cp test/nm-online $RPM_BUILD_ROOT%{_bindir}/
install %{S:2} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/
cp %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/NetworkManager/
install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/
cp %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/NetworkManager/
%clean
rm -rf $RPM_BUILD_ROOT
%post
%run_ldconfig
/sbin/ldconfig
if [ "$1" = 1 ]; then
if grep "network_manager.*always" etc/YaST2/ProductFeatures &> /dev/null; then
sed -i '/^NETWORKMANAGER=.*no/s/no/yes/' etc/sysconfig/network/config
@@ -194,8 +234,11 @@ if [ "$1" = 1 ]; then
fi
fi
%postun
%run_ldconfig
%postun -p /sbin/ldconfig
%post glib -p /sbin/ldconfig
%postun glib -p /sbin/ldconfig
%files -f %{name}.lang
%defattr(-,root,root)
@@ -209,13 +252,17 @@ fi
%{_sbindir}/*
%{_sysconfdir}/dbus-1/system.d/NetworkManager.conf
%{_sysconfdir}/NetworkManager
%ghost %config(noreplace) /var/log/NetworkManager
%files gnome
%defattr(-,root,root)
%{_bindir}/nm-applet
%{_bindir}/nm-vpn-properties
%{_bindir}/nm-editor
%{_datadir}/gnome/autostart/nm-applet.desktop
%{_datadir}/nm-applet
%{_datadir}/nm-editor
%{_datadir}/applications/nm-editor.desktop
%{_datadir}/icons/hicolor/*/apps/*.png
%{_datadir}/gnome-vpn-properties
%{_sysconfdir}/dbus-1/system.d/nm-applet.conf
@@ -232,6 +279,18 @@ fi
%{_libdir}/libnm_glib.so.*
%changelog
* Fri Aug 03 2007 - sbrabec@suse.cz
- Updated gnome-patch-translation support.
* Fri Aug 03 2007 - tambet@suse.de
- Update to the latest version from upstream:
Add support for 2-phase authentication.
Add support for rfkill switch.
- Add an editor for stored wireless networks.
- Fix the packaging bug where the log file was not owned by the package
(Novell #280464).
- Fix the issue where NM doesn't honor YaST Static IP Settings
(Novell #271757).
- Fix the packaging issue to not require gnome-panel (Novell #229291).
* Tue May 15 2007 - pgajdos@suse.cz
- removed invalid PreReq: gtk2 >= {%%gtk_version} gnome-icon-theme
- added Requires: gtk2 >= {%%gtk_version}
Binary file not shown.
Binary file not shown.
Binary file not shown.
-25347
View File
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
Index: NetworkManager-0.6.5/src/NetworkManager.c
===================================================================
--- NetworkManager-0.6.5.orig/src/NetworkManager.c
+++ NetworkManager-0.6.5/src/NetworkManager.c
@@ -826,6 +826,10 @@ void nm_hal_init (NMData *data)
nm_add_initial_killswitch_devices (data);
nm_add_initial_devices (data);
}
+
+ /* If there weren't any killswitches, mark hardware RF to on */
+ if (g_slist_length (data->killswitch_list) == 0)
+ data->hw_rf_enabled = TRUE;
}
+143
View File
@@ -0,0 +1,143 @@
Index: NetworkManager-0.6.5/src/vpn-manager/nm-dbus-vpn.c
===================================================================
--- NetworkManager-0.6.5.orig/src/vpn-manager/nm-dbus-vpn.c
+++ NetworkManager-0.6.5/src/vpn-manager/nm-dbus-vpn.c
@@ -410,8 +410,6 @@ static void nm_dbus_vpn_connections_upda
NMData * data = (NMData *) user_data;
DBusMessage * reply;
DBusMessageIter iter, array_iter;
- GSList * remove_list = NULL;
- GSList * elt;
g_return_if_fail (pcall);
g_return_if_fail (data != NULL);
@@ -427,22 +425,15 @@ static void nm_dbus_vpn_connections_upda
nm_info ("Updating VPN Connections...");
- remove_list = nm_vpn_manager_vpn_connection_list_copy (data->vpn_manager);
-
dbus_message_iter_init (reply, &iter);
dbus_message_iter_recurse (&iter, &array_iter);
while (dbus_message_iter_get_arg_type (&array_iter) == DBUS_TYPE_STRING)
{
DBusMessage * message;
const char * con_name;
- NMVPNConnection * vpn;
dbus_message_iter_get_basic (&array_iter, &con_name);
- /* If the connection already exists, remove it from the remove list */
- if ((vpn = nm_vpn_manager_find_connection_by_name (data->vpn_manager, con_name)))
- remove_list = g_slist_remove (remove_list, vpn);
-
if ((message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH, NMI_DBUS_INTERFACE, "getVPNConnectionProperties")))
{
DBusPendingCall * vpn_pcall = NULL;
@@ -463,15 +454,6 @@ static void nm_dbus_vpn_connections_upda
}
dbus_message_unref (reply);
- /* VPN connections left in the remove list aren't known by NMI, therefore we delete them */
- for (elt = remove_list; elt; elt = g_slist_next (elt))
- {
- nm_vpn_manager_remove_connection (data->vpn_manager, elt->data);
- nm_vpn_connection_unref (elt->data);
- }
-
- g_slist_free (remove_list);
-
out:
dbus_pending_call_unref (pcall);
}
@@ -527,6 +509,8 @@ static gboolean nm_dbus_vpn_connections_
g_return_val_if_fail (data->dbus_connection != NULL, FALSE);
g_return_val_if_fail (data->vpn_manager != NULL, FALSE);
+ nm_vpn_manager_clear_connections (data->vpn_manager);
+
if (!(message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH, NMI_DBUS_INTERFACE, "getVPNConnections")))
{
nm_warning ("nm_dbus_vpn_connections_update (): Couldn't allocate the dbus message");
Index: NetworkManager-0.6.5/src/vpn-manager/nm-vpn-manager.c
===================================================================
--- NetworkManager-0.6.5.orig/src/vpn-manager/nm-vpn-manager.c
+++ NetworkManager-0.6.5/src/vpn-manager/nm-vpn-manager.c
@@ -130,28 +130,6 @@ NMVPNService *nm_vpn_manager_find_servic
/*
- * nm_vpn_manager_vpn_connection_list_copy
- *
- * Make a shallow copy of the VPN connection list, should
- * only be used by nm-dbus-vpn.c
- *
- */
-GSList *nm_vpn_manager_vpn_connection_list_copy (NMVPNManager *manager)
-{
- GSList * list;
- GSList * elt;
-
- g_return_val_if_fail (manager != NULL, NULL);
-
- list = g_slist_copy (manager->connections);
- for (elt = list; elt; elt = g_slist_next (elt))
- nm_vpn_connection_ref (elt->data);
-
- return list;
-}
-
-
-/*
* nm_vpn_manager_add_connection
*
* Add a new VPN connection if none already exits, otherwise update the existing one.
@@ -227,6 +205,29 @@ void nm_vpn_manager_remove_connection (N
/*
+ * nm_vpn_manager_clear_connections
+ *
+ * Remove all VPN connections.
+ *
+ */
+void
+nm_vpn_manager_clear_connections (NMVPNManager *manager)
+{
+ GSList *connections;
+ GSList *iter;
+
+ g_return_if_fail (manager != NULL);
+
+ connections = g_slist_copy (manager->connections);
+
+ for (iter = connections; iter; iter = iter->next)
+ nm_vpn_manager_remove_connection (manager, (NMVPNConnection *) iter->data);
+
+ g_slist_free (connections);
+}
+
+
+/*
* nm_vpn_manager_get_connection_names
*
* Return an array of strings of all the VPN Connection names
Index: NetworkManager-0.6.5/src/vpn-manager/nm-vpn-manager.h
===================================================================
--- NetworkManager-0.6.5.orig/src/vpn-manager/nm-vpn-manager.h
+++ NetworkManager-0.6.5/src/vpn-manager/nm-vpn-manager.h
@@ -29,13 +29,12 @@
NMVPNManager * nm_vpn_manager_new (NMData *app_data);
NMVPNConnection * nm_vpn_manager_add_connection (NMVPNManager *manager, const char *name, const char *service_name, const char *user_name);
void nm_vpn_manager_remove_connection (NMVPNManager *manager, NMVPNConnection *vpn);
+void nm_vpn_manager_clear_connections (NMVPNManager *manager);
char ** nm_vpn_manager_get_connection_names (NMVPNManager *manager);
void nm_vpn_manager_dispose (NMVPNManager *manager);
NMVPNActRequest * nm_vpn_manager_get_vpn_act_request (NMVPNManager *manager);
-GSList * nm_vpn_manager_vpn_connection_list_copy (NMVPNManager *manager);
-
void nm_vpn_manager_activate_vpn_connection (NMVPNManager *manager, NMVPNConnection *vpn, char **password_items,
int password_count, char **data_items, int data_count,
char **user_routes, int user_routes_count );
+13
View File
@@ -0,0 +1,13 @@
Index: NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
===================================================================
--- NetworkManager-0.6.5.orig/src/nm-device-802-11-wireless.c
+++ NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
@@ -2637,7 +2637,7 @@ supplicant_status_cb (GIOChannel *source
if ((self->priv->link_timeout == NULL) && !self->priv->scanning)
{
GMainContext * context = nm_device_get_main_context (dev);
- self->priv->link_timeout = g_timeout_source_new (8000);
+ self->priv->link_timeout = g_timeout_source_new (16000);
g_source_set_callback (self->priv->link_timeout,
link_timeout_cb,
self,
+56
View File
@@ -0,0 +1,56 @@
Index: nm-applet-0.6.5/src/applet-dbus-info.c
===================================================================
--- nm-applet-0.6.5/src/applet-dbus-info.c.orig
+++ nm-applet-0.6.5/src/applet-dbus-info.c
@@ -841,6 +841,16 @@ nmi_dbus_get_vpn_connection_routes (DBus
}
+static void
+save_network_info_keyring_cb (GnomeKeyringResult result,
+ guint32 val,
+ gpointer user_data)
+{
+ if (result != GNOME_KEYRING_RESULT_OK)
+ nm_warning ("Error saving secret for wireless network '%s' in keyring: %d", (char *) user_data, result);
+}
+
+
/*
* nmi_save_network_info
*
@@ -942,8 +952,6 @@ nmi_save_network_info (NMApplet *applet,
GnomeKeyringAttributeList * attributes;
GnomeKeyringAttribute attr;
char * display_name;
- GnomeKeyringResult ret;
- guint32 item_id;
display_name = g_strdup_printf (_("Passphrase for wireless network %s"), essid);
@@ -953,16 +961,15 @@ nmi_save_network_info (NMApplet *applet,
attr.value.string = g_strdup (essid);
g_array_append_val (attributes, attr);
- ret = gnome_keyring_item_create_sync (NULL,
- GNOME_KEYRING_ITEM_GENERIC_SECRET,
- display_name,
- attributes,
- nm_gconf_wso_get_key (gconf_wso),
- TRUE,
- &item_id);
- if (ret != GNOME_KEYRING_RESULT_OK)
- nm_warning ("Error saving secret for wireless network '%s' in keyring: %d", essid, ret);
-
+ gnome_keyring_item_create (NULL,
+ GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ display_name,
+ attributes,
+ nm_gconf_wso_get_key (gconf_wso),
+ TRUE,
+ save_network_info_keyring_cb,
+ g_strdup (essid),
+ (GDestroyNotify) g_free);
g_free (display_name);
gnome_keyring_attribute_list_free (attributes);
}
+133
View File
@@ -0,0 +1,133 @@
Index: NetworkManager-0.6.5/src/backends/NetworkManagerSuSE.c
===================================================================
--- NetworkManager-0.6.5.orig/src/backends/NetworkManagerSuSE.c
+++ NetworkManager-0.6.5/src/backends/NetworkManagerSuSE.c
@@ -32,6 +32,9 @@
#include <signal.h>
#include <sys/stat.h>
#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <string.h>
#include "NetworkManagerSystem.h"
#include "NetworkManagerUtils.h"
@@ -425,6 +428,38 @@ out:
}
+static gboolean
+parse_netmask (const char *buf, guint32 *netmask)
+{
+ gboolean success = FALSE;
+
+ if (strstr (buf, ".")) {
+ struct in_addr addr;
+
+ if (inet_aton (buf, &addr)) {
+ *netmask = addr.s_addr;
+ success = TRUE;
+ }
+ } else {
+ int maskval;
+
+ maskval = atoi (buf);
+ if (maskval >= 0 && maskval <= 32) {
+ guint32 mask = 0;
+
+ while (maskval > 0) {
+ mask = (mask >> 1) + 0x80000000;
+ maskval--;
+ }
+
+ *netmask = htonl (mask);
+ success = TRUE;
+ }
+ }
+
+ return success;
+}
+
/*
* nm_system_device_get_system_config
*
@@ -674,14 +709,38 @@ found:
buf = svGetValue (file, "IPADDR");
if (buf)
{
- struct in_addr ip;
- int ret;
-
- ret = inet_aton (buf, &ip);
- if (ret)
- nm_ip4_config_set_address (sys_data->config, ip.s_addr);
- else
+ char **pieces;
+ char *ip_str = NULL;
+ char *netmask_str = NULL;
+
+ pieces = g_strsplit (buf, "/", 0);
+ if (g_strv_length (pieces) == 1) {
+ ip_str = buf;
+ } else if (g_strv_length (pieces) == 2) {
+ ip_str = pieces[0];
+ netmask_str = pieces[1];
+ } else
error = TRUE;
+
+ if (!error && ip_str) {
+ struct in_addr ip;
+
+ if (inet_aton (ip_str, &ip))
+ nm_ip4_config_set_address (sys_data->config, ip.s_addr);
+ else
+ error = TRUE;
+ }
+
+ if (!error && netmask_str) {
+ guint32 netmask;
+
+ if (parse_netmask (netmask_str, &netmask))
+ nm_ip4_config_set_netmask (sys_data->config, netmask);
+ else
+ error = TRUE;
+ }
+
+ g_strfreev (pieces);
free (buf);
}
else
@@ -696,7 +755,8 @@ found:
if ((buf = svGetValue (file, "NETMASK")))
{
- nm_ip4_config_set_netmask (sys_data->config, inet_addr (buf));
+ if (nm_ip4_config_get_netmask (sys_data->config) == 0)
+ nm_ip4_config_set_netmask (sys_data->config, inet_addr (buf));
free (buf);
}
else
Index: NetworkManager-0.6.5/gnome/vpn-properties/nm-vpn-properties.c
===================================================================
--- NetworkManager-0.6.5.orig/gnome/vpn-properties/nm-vpn-properties.c
+++ NetworkManager-0.6.5/gnome/vpn-properties/nm-vpn-properties.c
@@ -39,6 +39,7 @@
#include <gtk/gtkwindow.h>
#include <glade/glade.h>
#include <gconf/gconf-client.h>
+#include <libgnomeui/libgnomeui.h>
#include <glib/gi18n.h>
#define NM_VPN_API_SUBJECT_TO_CHANGE
Index: NetworkManager-0.6.5/gnome/vpn-properties/Makefile.am
===================================================================
--- NetworkManager-0.6.5.orig/gnome/vpn-properties/Makefile.am
+++ NetworkManager-0.6.5/gnome/vpn-properties/Makefile.am
@@ -26,7 +26,6 @@ nm_vpn_properties_CFLAGS =
-DGLADEDIR=\""$(gladedir)"\" \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
- -DGNOME_DISABLE_DEPRECATED \
-DGNOMELOCALEDIR=\"$(datadir)/locale\" \
-DVERSION=\"$(VERSION)\" \
$(NULL)
+57
View File
@@ -0,0 +1,57 @@
--- NetworkManager-0.6.5/nm-applet-0.6.5/src/Makefile.am.buildfix 2007-02-02 10:53:26.000000000 -0500
+++ NetworkManager-0.6.5/nm-applet-0.6.5/src/Makefile.am 2007-03-15 14:20:32.000000000 -0400
@@ -2,6 +2,9 @@
bin_PROGRAMS = nm-applet
+INCLUDES = -I${top_srcdir}/../include \
+ -I${top_srcdir}/../libnm-util
+
nm_applet_CPPFLAGS = \
$(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
@@ -12,7 +15,6 @@
$(GCONF_CFLAGS) \
$(LIBGNOMEUI_CFLAGS) \
$(GNOME_KEYRING_CFLAGS) \
- $(NM_CFLAGS) \
-DICONDIR=\""$(datadir)/icons"\" \
-DGLADEDIR=\""$(gladedir)"\" \
-DBINDIR=\""$(bindir)"\" \
@@ -112,7 +114,7 @@
$(GCONF_LIBS) \
$(LIBGNOMEUI_LIBS) \
$(GNOME_KEYRING_LIBS) \
- $(NM_LIBS) \
+ -L${top_srcdir}/../libnm-util $(top_builddir)/../libnm-util/libnm-util.la \
$(NULL)
if WITH_NOTIFY
--- NetworkManager-0.6.5/nm-applet-0.6.5/configure.ac.buildfix 2007-03-15 11:51:49.000000000 -0400
+++ NetworkManager-0.6.5/nm-applet-0.6.5/configure.ac 2007-03-15 16:33:34.000000000 -0400
@@ -18,10 +18,10 @@
dnl This doesn't depend on gnome support, only on gnome-common, autogen already
dnl uses gnome-autogen
dnl
-GNOME_COMMON_INIT
-GNOME_DEBUG_CHECK
-GNOME_COMPILE_WARNINGS([maximum])
-GNOME_MAINTAINER_MODE_DEFINES
+dnl GNOME_COMMON_INIT
+dnl GNOME_DEBUG_CHECK
+dnl GNOME_COMPILE_WARNINGS([maximum])
+dnl GNOME_MAINTAINER_MODE_DEFINES
dnl
dnl Required headers
@@ -112,10 +112,6 @@
AC_SUBST(GOBJECT_CFLAGS)
AC_SUBST(GOBJECT_LIBS)
-PKG_CHECK_MODULES(NM, NetworkManager)
-AC_SUBST(NM_CFLAGS)
-AC_SUBST(NM_LIBS)
-
AC_ARG_WITH(notify, AC_HELP_STRING([--with-notify], [Use libnotify]), enable_notify=$withval, enable_notify=auto)
PKG_CHECK_MODULES(GTK, gtk+-2.0)
+22 -19
View File
@@ -1,7 +1,8 @@
diff -urN NetworkManager-0.6.4/gnome/applet/applet.c NetworkManager-new/gnome/applet/applet.c
--- NetworkManager-0.6.4/gnome/applet/applet.c 2006-11-10 13:25:14.000000000 +0200
+++ NetworkManager-new/gnome/applet/applet.c 2006-11-10 13:24:22.000000000 +0200
@@ -1195,6 +1195,48 @@
Index: nm-applet-0.6.5/src/applet.c
===================================================================
--- nm-applet-0.6.5/src/applet.c.orig
+++ nm-applet-0.6.5/src/applet.c
@@ -1195,6 +1195,48 @@ done:
}
@@ -50,7 +51,7 @@ diff -urN NetworkManager-0.6.4/gnome/applet/applet.c NetworkManager-new/gnome/ap
/*
* nma_redraw_timeout
*
@@ -1984,7 +2026,13 @@
@@ -1984,7 +2026,13 @@ static void nma_set_wireless_enabled_cb
state = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget));
if (applet->wireless_enabled != state)
@@ -64,7 +65,7 @@ diff -urN NetworkManager-0.6.4/gnome/applet/applet.c NetworkManager-new/gnome/ap
}
@@ -1996,7 +2044,13 @@
@@ -1996,7 +2044,13 @@ static void nma_set_networking_enabled_c
state = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget));
if ((applet->nm_state == NM_STATE_ASLEEP && state) || (applet->nm_state != NM_STATE_ASLEEP && !state))
@@ -78,7 +79,7 @@ diff -urN NetworkManager-0.6.4/gnome/applet/applet.c NetworkManager-new/gnome/ap
}
@@ -2574,6 +2628,36 @@
@@ -2577,6 +2631,36 @@ static void G_GNUC_NORETURN nma_destroy
}
@@ -115,22 +116,23 @@ diff -urN NetworkManager-0.6.4/gnome/applet/applet.c NetworkManager-new/gnome/ap
/*
* nma_get_instance
*
@@ -2645,6 +2729,11 @@
if (!applet->connection)
nma_start_dbus_connection_watch (applet);
@@ -2656,6 +2740,11 @@ static GtkWidget * nma_get_instance (NMA
g_signal_connect (applet, "destroy", G_CALLBACK (nma_destroy), NULL);
g_signal_connect (applet, "style-set", G_CALLBACK (nma_theme_change_cb), NULL);
+ g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
+ update_network_state,
+ g_object_ref (applet),
+ (GDestroyNotify) g_object_unref);
+
/* Load pixmaps and create applet widgets */
nma_setup_widgets (applet);
return GTK_WIDGET (applet);
}
diff -urN NetworkManager-0.6.4/gnome/applet/applet.h NetworkManager-new/gnome/applet/applet.h
--- NetworkManager-0.6.4/gnome/applet/applet.h 2006-11-10 13:25:13.000000000 +0200
+++ NetworkManager-new/gnome/applet/applet.h 2006-11-10 13:18:58.000000000 +0200
@@ -156,6 +156,9 @@
Index: nm-applet-0.6.5/src/applet.h
===================================================================
--- nm-applet-0.6.5/src/applet.h.orig
+++ nm-applet-0.6.5/src/applet.h
@@ -157,6 +157,9 @@ void nma_set_state (NMApplet *ap
void nma_set_running (NMApplet *applet, gboolean running);
void nma_update_state (NMApplet *applet);
@@ -140,9 +142,10 @@ diff -urN NetworkManager-0.6.4/gnome/applet/applet.h NetworkManager-new/gnome/ap
int nm_null_safe_strcmp (const char *s1, const char *s2);
#endif
diff -urN NetworkManager-0.6.4/gnome/applet/main.c NetworkManager-new/gnome/applet/main.c
--- NetworkManager-0.6.4/gnome/applet/main.c 2006-11-10 13:25:14.000000000 +0200
+++ NetworkManager-new/gnome/applet/main.c 2006-11-10 13:18:48.000000000 +0200
Index: nm-applet-0.6.5/src/main.c
===================================================================
--- nm-applet-0.6.5/src/main.c.orig
+++ nm-applet-0.6.5/src/main.c
@@ -36,7 +36,14 @@
static void session_die (GnomeClient *client, gpointer client_data)
{
+124
View File
@@ -0,0 +1,124 @@
Index: NetworkManager-0.6.5/nm-applet-0.6.5/configure.ac
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/configure.ac
+++ NetworkManager-0.6.5/nm-applet-0.6.5/configure.ac
@@ -249,6 +249,7 @@ fi
AC_OUTPUT([
Makefile
src/Makefile
+editor/Makefile
icons/Makefile
po/Makefile.in
])
Index: NetworkManager-0.6.5/nm-applet-0.6.5/Makefile.am
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/Makefile.am
+++ NetworkManager-0.6.5/nm-applet-0.6.5/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = src icons po
+SUBDIRS = src editor icons po
EXTRA_DIST = \
CONTRIBUTING \
Index: NetworkManager-0.6.5/nm-applet-0.6.5/po/POTFILES.in
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/po/POTFILES.in
+++ NetworkManager-0.6.5/nm-applet-0.6.5/po/POTFILES.in
@@ -19,3 +19,11 @@ src/wso-wep-hex.c
src/wso-wep-passphrase.c
src/wso-wpa-eap.c
src/wso-wpa-psk.c
+editor/bssid-editor-dialog.c
+editor/editor-app.c
+editor/editor-gconf-helper.c
+editor/editor-keyring-helper.c
+editor/widget-wso-wep.c
+editor/widget-wso-wpa-enterprise.c
+editor/widget-wso-wpa-personal.c
+editor/editor.glade
Index: NetworkManager-0.6.5/nm-applet-0.6.5/src/applet.c
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/src/applet.c
+++ NetworkManager-0.6.5/nm-applet-0.6.5/src/applet.c
@@ -1614,6 +1614,28 @@ static void nma_menu_add_custom_essid_it
}
+static void edit_essid_items_selected (GtkWidget *menu_item, NMApplet *applet)
+{
+ g_spawn_command_line_async ("nm-editor", NULL);
+}
+
+
+static void nma_menu_add_edit_essid_item (GtkWidget *menu, NMApplet *applet)
+{
+ GtkWidget *menu_item;
+ GtkWidget *label;
+
+ menu_item = gtk_menu_item_new ();
+ label = gtk_label_new_with_mnemonic (_("_Edit Wireless Networks..."));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_container_add (GTK_CONTAINER (menu_item), label);
+ gtk_widget_show_all (menu_item);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect (menu_item, "activate", G_CALLBACK (edit_essid_items_selected), applet);
+}
+
+
+
static void new_network_item_selected (GtkWidget *menu_item, NMApplet *applet)
{
nma_other_network_dialog_run (applet, TRUE);
@@ -2014,6 +2036,7 @@ static void nma_menu_add_devices (GtkWid
nma_menu_add_separator_item (menu);
nma_menu_add_custom_essid_item (menu, applet);
nma_menu_add_create_network_item (menu, applet);
+ nma_menu_add_edit_essid_item (menu, applet);
}
}
Index: NetworkManager-0.6.5/nm-applet-0.6.5/editor/Makefile.am
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/editor/Makefile.am
+++ NetworkManager-0.6.5/nm-applet-0.6.5/editor/Makefile.am
@@ -1,6 +1,6 @@
NULL=
-INCLUDES = -I${top_srcdir} -I${top_srcdir}/utils -I${top_srcdir}/include -I${top_srcdir}/libnm-util
+INCLUDES = -I${top_srcdir}/../include -I${top_srcdir}/../libnm-util
bin_PROGRAMS = nm-editor
@@ -55,8 +55,8 @@ nm_editor_LDADD = \
$(GCONF_LIBS) \
$(LIBGNOMEUI_LIBS) \
$(GNOME_KEYRING_LIBS) \
- $(top_builddir)/utils/libnmutils.la \
- $(top_builddir)/libnm-util/libnm-util.la \
+ $(top_builddir)/../utils/libnmutils.la \
+ $(top_builddir)/../libnm-util/libnm-util.la \
$(NULL)
Index: NetworkManager-0.6.5/nm-applet-0.6.5/editor/editor-app.c
===================================================================
--- NetworkManager-0.6.5.orig/nm-applet-0.6.5/editor/editor-app.c
+++ NetworkManager-0.6.5/nm-applet-0.6.5/editor/editor-app.c
@@ -197,7 +197,7 @@ gboolean quit_editor(WE_DATA *we_data)
if(we_data != NULL)
{
if(we_data->editor_xml != NULL)
- g_free(we_data->editor_xml);
+ g_object_unref(we_data->editor_xml);
if(we_data->gconf_client != NULL)
g_object_unref(we_data->gconf_client);
if(we_data->glade_file != NULL)
@@ -894,7 +894,7 @@ void update_security_widget(gint option,
if(we_data->sub_xml != NULL)
{
- g_free(we_data->sub_xml);
+ g_object_unref(we_data->sub_xml);
we_data->sub_xml = NULL;
}
+391
View File
@@ -0,0 +1,391 @@
Index: nm-applet-0.6.5/src/applet-dbus-devices.c
===================================================================
--- nm-applet-0.6.5/src/applet-dbus-devices.c.orig
+++ nm-applet-0.6.5/src/applet-dbus-devices.c
@@ -1266,7 +1266,7 @@ void nma_dbus_device_remove_one_device (
*
*/
void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid,
- WirelessSecurityOption * opt)
+ gboolean fallback, WirelessSecurityOption * opt)
{
DBusMessage * message;
gboolean success = TRUE;
@@ -1285,6 +1285,7 @@ void nma_dbus_set_device (DBusConnection
/* Build up the required args */
dbus_message_append_args (message, DBUS_TYPE_OBJECT_PATH, &dev_path,
DBUS_TYPE_STRING, &essid,
+ DBUS_TYPE_BOOLEAN, &fallback,
DBUS_TYPE_INVALID);
/* If we have specific wireless security options, add them */
Index: nm-applet-0.6.5/src/applet-dbus-devices.h
===================================================================
--- nm-applet-0.6.5/src/applet-dbus-devices.h.orig
+++ nm-applet-0.6.5/src/applet-dbus-devices.h
@@ -49,7 +49,7 @@ void nma_dbus_device_remove_one_device
void nma_dbus_device_update_one_network (NMApplet *applet, const char *dev_path, const char *net_path, const char *active_net_path);
void nma_dbus_device_remove_one_network (NMApplet *applet, const char *dev_path, const char *net_path);
void nma_dbus_update_strength (NMApplet *applet, const char *dev_path, const char *net_path, int strength);
-void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid, WirelessSecurityOption *opt);
+void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid, gboolean fallback, WirelessSecurityOption *opt);
void nma_dbus_create_network (DBusConnection *connection, NetworkDevice *dev, const char *essid, WirelessSecurityOption *opt);
void nma_free_data_model (NMApplet *applet);
Index: nm-applet-0.6.5/src/applet-dbus-info.c
===================================================================
--- nm-applet-0.6.5/src/applet-dbus-info.c.orig
+++ nm-applet-0.6.5/src/applet-dbus-info.c
@@ -428,7 +428,7 @@ nmi_dbus_get_network_properties (DBusCon
char * escaped_network = NULL;
char * essid = NULL;
gint timestamp = -1;
- gboolean trusted = FALSE;
+ gboolean fallback = FALSE;
DBusMessageIter iter, array_iter;
GConfClient * client;
NMGConfWSO * gconf_wso;
@@ -468,9 +468,9 @@ nmi_dbus_get_network_properties (DBusCon
if (!nm_gconf_get_int_helper (client, GCONF_PATH_WIRELESS_NETWORKS, "timestamp", escaped_network, &timestamp) || (timestamp < 0))
timestamp = 0;
- /* Trusted status */
- if (!nm_gconf_get_bool_helper (client, GCONF_PATH_WIRELESS_NETWORKS, "trusted", escaped_network, &trusted))
- trusted = FALSE;
+ /* Fallback status */
+ if (!nm_gconf_get_bool_helper (client, GCONF_PATH_WIRELESS_NETWORKS, "fallback", escaped_network, &fallback))
+ fallback = FALSE;
/* Grab the list of stored access point BSSIDs */
gconf_key = g_strdup_printf ("%s/%s/bssids", GCONF_PATH_WIRELESS_NETWORKS, escaped_network);
@@ -501,8 +501,8 @@ nmi_dbus_get_network_properties (DBusCon
/* Second arg: Timestamp (INT32) */
dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &timestamp);
- /* Third arg: Trusted (BOOLEAN) */
- dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &trusted);
+ /* Third arg: Fallback? (BOOLEAN) */
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &fallback);
/* Fourth arg: List of AP BSSIDs (ARRAY, STRING) */
dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING_AS_STRING, &array_iter);
@@ -861,12 +861,14 @@ static void
nmi_save_network_info (NMApplet *applet,
const char *essid,
gboolean automatic,
+ gboolean fallback,
const char *bssid,
NMGConfWSO * gconf_wso)
{
- char * key;
- GConfEntry * gconf_entry;
- char * escaped_network;
+ char * key;
+ GConfEntry * gconf_entry;
+ char * escaped_network;
+ GConfValue * value;
g_return_if_fail (applet != NULL);
g_return_if_fail (essid != NULL);
@@ -897,9 +899,18 @@ nmi_save_network_info (NMApplet *applet,
g_free (key);
}
+ /*
+ * XXX: We don't want to move a network from fallback to non-fallback because the user
+ * connected via other means. We need a better way to do this.
+ */
+ key = g_strdup_printf ("%s/%s/fallback", GCONF_PATH_WIRELESS_NETWORKS, escaped_network);
+ value = gconf_client_get (applet->gconf_client, key, NULL);
+ if (!value || value->type != GCONF_VALUE_BOOL || (!gconf_value_get_bool (value) && fallback))
+ gconf_client_set_bool (applet->gconf_client, key, fallback, NULL);
+ g_free (key);
+
if (bssid && (strlen (bssid) >= 11))
{
- GConfValue * value;
GSList * new_bssid_list = NULL;
gboolean found = FALSE;
@@ -994,6 +1005,7 @@ nmi_dbus_update_network_info (DBusConnec
NMApplet * applet = (NMApplet *) user_data;
char * essid = NULL;
gboolean automatic;
+ gboolean fallback;
NMGConfWSO * gconf_wso = NULL;
DBusMessageIter iter;
char * bssid;
@@ -1024,7 +1036,15 @@ nmi_dbus_update_network_info (DBusConnec
}
dbus_message_iter_get_basic (&iter, &automatic);
- /* Third argument: Access point's BSSID */
+ /* Third argument: Fallback? (BOOLEAN) */
+ if (!dbus_message_iter_next (&iter) || (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_BOOLEAN))
+ {
+ nm_warning ("%s:%d - message argument 'fallback' was invalid.", __FILE__, __LINE__);
+ goto out;
+ }
+ dbus_message_iter_get_basic (&iter, &fallback);
+
+ /* Fourth argument: Access point's BSSID */
if (!dbus_message_iter_next (&iter) || (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING))
{
nm_warning ("%s:%d - message argument 'bssid' was invalid.", __FILE__, __LINE__);
@@ -1042,7 +1062,7 @@ nmi_dbus_update_network_info (DBusConnec
goto out;
}
- nmi_save_network_info (applet, essid, automatic, bssid, gconf_wso);
+ nmi_save_network_info (applet, essid, automatic, fallback, bssid, gconf_wso);
g_object_unref (G_OBJECT (gconf_wso));
out:
Index: nm-applet-0.6.5/src/applet.c
===================================================================
--- nm-applet-0.6.5/src/applet.c.orig
+++ nm-applet-0.6.5/src/applet.c
@@ -1352,7 +1352,7 @@ static void nma_menu_item_activate (GtkM
if ((tag = g_object_get_data (G_OBJECT (item), "network")))
net = network_device_get_wireless_network_by_essid (dev, tag);
- nma_dbus_set_device (applet->connection, dev, net ? wireless_network_get_essid (net) : NULL, NULL);
+ nma_dbus_set_device (applet->connection, dev, net ? wireless_network_get_essid (net) : NULL, FALSE, NULL);
network_device_unref (dev);
nmi_dbus_signal_user_interface_activated (applet->connection);
Index: nm-applet-0.6.5/src/applet.glade
===================================================================
--- nm-applet-0.6.5/src/applet.glade.orig
+++ nm-applet-0.6.5/src/applet.glade
@@ -426,7 +426,7 @@ You have chosen to log in to the wireles
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="n_rows">4</property>
+ <property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -548,8 +548,8 @@ You have chosen to log in to the wireles
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@@ -569,8 +569,8 @@ WEP 64/128-bit ASCII
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@@ -589,9 +589,31 @@ WEP 64/128-bit ASCII
<packing>
<property name="left_attach">0</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="fallback_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Fallback on this Network</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">fill</property>
+ <property name="y_options"></property>
</packing>
</child>
</widget>
Index: nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c
===================================================================
--- nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c.orig
+++ nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c
@@ -346,3 +346,80 @@ nm_gconf_wso_wpa_eap_get_type (void)
}
return type;
}
+
+typedef struct {
+ GtkComboBox *combo;
+ gint value;
+} ComboSelectInfo;
+
+static gboolean
+combo_select (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
+{
+ ComboSelectInfo *info = user_data;
+ GValue val = { 0, };
+ gint i;
+
+ gtk_tree_model_get_value (model, iter, 1, &val);
+ i = g_value_get_int (&val);
+
+ if (i == info->value) {
+ gtk_combo_box_set_active_iter (info->combo, iter);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/* Ugh. Please avert your eyes. */
+void
+nm_gconf_wpa_eap_populate_dialog (NMGConfWSOWPA_EAP *wso, GladeXML *xml)
+{
+ GtkWidget *widget;
+ GtkTreeModel *model;
+ ComboSelectInfo info;
+
+ g_return_if_fail (wso != NULL);
+ g_return_if_fail (xml != NULL);
+
+ if (wso->priv->identity != NULL) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_identity_entry");
+ gtk_entry_set_text (GTK_ENTRY (widget), wso->priv->identity);
+ }
+
+ if (wso->priv->passwd != NULL) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_passwd_entry");
+ gtk_entry_set_text (GTK_ENTRY (widget), wso->priv->passwd);
+ }
+
+ if (wso->priv->anon_identity != NULL) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_anon_identity_entry");
+ gtk_entry_set_text (GTK_ENTRY (widget), wso->priv->anon_identity);
+ }
+
+ widget = glade_xml_get_widget (xml, "wpa_eap_eap_method_combo");
+ info.combo = GTK_COMBO_BOX (widget);
+ info.value = wso->priv->eap_method;
+ gtk_tree_model_foreach (gtk_combo_box_get_model (info.combo),
+ combo_select, &info);
+
+ widget = glade_xml_get_widget (xml, "wpa_eap_key_type_combo");
+ info.combo = GTK_COMBO_BOX (widget);
+ info.value = wso->priv->key_type;
+ gtk_tree_model_foreach (gtk_combo_box_get_model (info.combo),
+ combo_select, &info);
+
+ if (wso->priv->client_cert_file != NULL && g_file_test (wso->priv->client_cert_file, G_FILE_TEST_EXISTS)) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_client_cert_file_chooser_button");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->client_cert_file);
+ }
+
+ if (wso->priv->ca_cert_file != NULL && g_file_test (wso->priv->ca_cert_file, G_FILE_TEST_EXISTS)) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_ca_cert_file_chooser_button");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->ca_cert_file);
+ }
+
+ if (wso->priv->private_key_file != NULL && g_file_test (wso->priv->private_key_file, G_FILE_TEST_EXISTS)) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_private_key_file_chooser_button");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->private_key_file);
+ }
+}
Index: nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h
===================================================================
--- nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h.orig
+++ nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h
@@ -59,4 +59,7 @@ NMGConfWSOWPA_EAP * nm_gconf_wso_wpa_eap
NMGConfWSOWPA_EAP * nm_gconf_wso_wpa_eap_new_deserialize_gconf (GConfClient *client, const char *network, int we_cipher);
+/* Ugh. Please avert your eyes. */
+void nm_gconf_wpa_eap_populate_dialog (NMGConfWSOWPA_EAP *wso, GladeXML *xml);
+
#endif /* NM_GCONF_WSO_WPA_EAP_H */
Index: nm-applet-0.6.5/src/other-network-dialog.c
===================================================================
--- nm-applet-0.6.5/src/other-network-dialog.c.orig
+++ nm-applet-0.6.5/src/other-network-dialog.c
@@ -410,19 +410,24 @@ static void nma_ond_response_cb (GtkDial
WirelessSecurityOption * opt;
GtkComboBox * security_combo;
GtkTreeIter iter;
+ GtkWidget * fallback_button;
char * str;
NetworkDevice * dev;
+ gboolean fallback;
gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter);
gtk_tree_model_get (model, &iter, NAME_COLUMN, &str, DEV_COLUMN, &dev, -1);
+ fallback_button = glade_xml_get_widget (xml, "fallback_button");
+ fallback = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (fallback_button));
+
security_combo = GTK_COMBO_BOX (glade_xml_get_widget (xml, "security_combo"));
opt = wsm_get_option_for_active (wsm, security_combo);
if (create_network)
nma_dbus_create_network (applet->connection, dev, essid, opt);
else
- nma_dbus_set_device (applet->connection, dev, essid, opt);
+ nma_dbus_set_device (applet->connection, dev, essid, fallback, opt);
}
}
Index: nm-applet-0.6.5/src/passphrase-dialog.c
===================================================================
--- nm-applet-0.6.5/src/passphrase-dialog.c.orig
+++ nm-applet-0.6.5/src/passphrase-dialog.c
@@ -37,6 +37,9 @@
#include "NetworkManager.h"
#include "wireless-security-manager.h"
+#include "nm-gconf-wso-wpa-eap.h"
+#include "wso-private.h"
+
static GladeXML *get_dialog_xml (GtkWidget *dialog)
{
g_return_val_if_fail (dialog != NULL, NULL);
@@ -269,6 +272,24 @@ nmi_passphrase_dialog_new (NMApplet *app
g_signal_connect (G_OBJECT (dialog), "response", GTK_SIGNAL_FUNC (nmi_passphrase_dialog_response_received), dialog);
+ /* Ugh. Avert your eyes, please. */
+ {
+ /* Pre-populate the dialog if we have information about this network. */
+ NMGConfWSO *wso;
+ const char *essid;
+ char *escaped_network;
+
+ essid = wireless_network_get_essid (net);
+ escaped_network = gconf_escape_key (essid, strlen (essid));
+ wso = nm_gconf_wso_new_deserialize_gconf (applet->gconf_client, escaped_network);
+ g_free (escaped_network);
+
+ if (wso != NULL && NM_IS_GCONF_WSO_WPA_EAP (wso)) {
+ WirelessSecurityOption *wso_widget = wsm_get_option_for_active (wsm, GTK_COMBO_BOX (security_combo));
+ nm_gconf_wpa_eap_populate_dialog (NM_GCONF_WSO_WPA_EAP (wso), wso_widget->uixml);
+ }
+ }
+
/* Bash focus-stealing prevention in the face */
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS);
gtk_widget_realize (dialog);
+28 -35
View File
@@ -1,12 +1,8 @@
? gnome/applet/applet.gladep
Index: gnome/applet/applet.c
Index: nm-applet-0.6.5/src/applet.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/gnome/applet/applet.c,v
retrieving revision 1.112.2.3
diff -u -r1.112.2.3 applet.c
--- gnome/applet/applet.c 9 Mar 2006 21:51:24 -0000 1.112.2.3
+++ gnome/applet/applet.c 15 Mar 2006 16:01:28 -0000
@@ -271,16 +271,43 @@
--- nm-applet-0.6.5/src/applet.c.orig
+++ nm-applet-0.6.5/src/applet.c
@@ -273,16 +273,43 @@ static gboolean nma_update_info (NMApple
return TRUE;
}
@@ -15,7 +11,7 @@ diff -u -r1.112.2.3 applet.c
+static gboolean nma_run_yast (GtkWidget *info_dialog)
{
- GtkWidget *info_dialog;
+ char *argv[] = { "/usr/bin/gnomesu", "/sbin/yast2", "lan", NULL };
+ char *argv[] = { "/opt/gnome/bin/gnomesu", "/sbin/yast2", "lan", NULL };
+ GError *err = NULL;
- info_dialog = glade_xml_get_widget (applet->info_dialog_xml, "info_dialog");
@@ -54,14 +50,14 @@ diff -u -r1.112.2.3 applet.c
}
}
@@ -1822,10 +1849,42 @@
@@ -1742,10 +1769,42 @@ static void nma_menu_add_vpn_menu (GtkWi
}
+static void nma_config_dialup_cb (GtkMenu *item, gpointer data)
+{
+ char *modem_argv[] = { "/usr/bin/gnomesu", "/sbin/yast2", "modem", NULL };
+ char *isdn_argv[] = { "/usr/bin/gnomesu", "/sbin/yast2", "isdn", NULL };
+ char *modem_argv[] = { "/opt/gnome/bin/gnomesu", "/sbin/yast2", "modem", NULL };
+ char *isdn_argv[] = { "/opt/gnome/bin/gnomesu", "/sbin/yast2", "isdn", NULL };
+ char **argv;
+ gboolean modem = (gboolean) data;
+ GError *err = NULL;
@@ -97,7 +93,7 @@ diff -u -r1.112.2.3 applet.c
GSList *elt;
g_return_if_fail (menu != NULL);
@@ -1855,6 +1914,14 @@
@@ -1777,6 +1836,14 @@ static void nma_menu_add_dialup_menu (Gt
gtk_menu_shell_append (GTK_MENU_SHELL (dialup_menu), GTK_WIDGET (disconnect_item));
}
@@ -112,7 +108,7 @@ diff -u -r1.112.2.3 applet.c
gtk_menu_item_set_submenu (item, GTK_WIDGET (dialup_menu));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), GTK_WIDGET (item));
gtk_widget_show_all (GTK_WIDGET (item));
@@ -2570,6 +2637,9 @@
@@ -2518,6 +2585,9 @@ static void G_GNUC_NORETURN nma_destroy
*/
static GtkWidget * nma_get_instance (NMApplet *applet)
{
@@ -122,7 +118,7 @@ diff -u -r1.112.2.3 applet.c
gtk_widget_hide (GTK_WIDGET (applet));
applet->nm_running = FALSE;
@@ -2589,6 +2659,15 @@
@@ -2545,6 +2615,15 @@ static GtkWidget * nma_get_instance (NMA
}
applet->info_dialog_xml = glade_xml_new (applet->glade_file, "info_dialog", NULL);
@@ -138,14 +134,11 @@ diff -u -r1.112.2.3 applet.c
applet->gconf_client = gconf_client_get_default ();
if (!applet->gconf_client)
Index: gnome/applet/applet.glade
Index: nm-applet-0.6.5/src/applet.glade
===================================================================
RCS file: /cvs/gnome/NetworkManager/gnome/applet/applet.glade,v
retrieving revision 1.4.2.2
diff -u -r1.4.2.2 applet.glade
--- gnome/applet/applet.glade 10 Mar 2006 16:38:19 -0000 1.4.2.2
+++ gnome/applet/applet.glade 15 Mar 2006 16:01:28 -0000
@@ -852,24 +852,9 @@
--- nm-applet-0.6.5/src/applet.glade.orig
+++ nm-applet-0.6.5/src/applet.glade
@@ -855,24 +855,9 @@ WEP 64/128-bit ASCII
<property name="spacing">6</property>
<child internal-child="action_area">
@@ -171,7 +164,7 @@ diff -u -r1.4.2.2 applet.glade
</widget>
<packing>
<property name="padding">0</property>
@@ -924,7 +909,7 @@
@@ -927,7 +912,7 @@ WEP 64/128-bit ASCII
<widget class="GtkTable" id="table1">
<property name="border_width">1</property>
<property name="visible">True</property>
@@ -179,15 +172,11 @@ diff -u -r1.4.2.2 applet.glade
+ <property name="n_rows">16</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">3</property>
@@ -1689,6 +1674,165 @@
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
<property name="row_spacing">6</property>
@@ -1696,6 +1681,165 @@ WEP 64/128-bit ASCII
<property name="y_options"></property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkButton" id="closebutton1">
@@ -343,6 +332,10 @@ diff -u -r1.4.2.2 applet.glade
+ <property name="right_attach">2</property>
+ <property name="top_attach">14</property>
+ <property name="bottom_attach">15</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
@@ -1,16 +0,0 @@
--- src/NetworkManagerDbus.c 2006-11-12 22:00:43.000000000 +0100
+++ src/NetworkManagerDbus.c 2006-11-12 21:59:36.000000000 +0100
@@ -833,10 +833,10 @@
}
dbus_error_init (&error);
-#if (DBUS_VERSION_MAJOR == 0) && (DBUS_VERSION_MINOR >= 60)
- flags = DBUS_NAME_FLAG_DO_NOT_QUEUE; /* Prohibit replacement is now the default */
-#else
+#if (DBUS_VERSION_MAJOR == 0) && (DBUS_VERSION_MINOR < 60)
flags = DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT;
+#else
+ flags = DBUS_NAME_FLAG_DO_NOT_QUEUE; /* Prohibit replacement is now the default */
#endif
ret = dbus_bus_request_name (connection, NM_DBUS_SERVICE, flags, &error);
if (dbus_error_is_set (&error))
BIN
View File
Binary file not shown.
+131 -510
View File
@@ -1,480 +1,7 @@
Index: NetworkManager-0.6.4/gnome/applet/applet.c
Index: NetworkManager-0.6.5/src/NetworkManagerAP.c
===================================================================
--- NetworkManager-0.6.4.orig/gnome/applet/applet.c
+++ NetworkManager-0.6.4/gnome/applet/applet.c
@@ -1310,7 +1310,7 @@ static void nma_menu_item_activate (GtkM
if ((tag = g_object_get_data (G_OBJECT (item), "network")))
net = network_device_get_wireless_network_by_essid (dev, tag);
- nma_dbus_set_device (applet->connection, dev, net ? wireless_network_get_essid (net) : NULL, NULL);
+ nma_dbus_set_device (applet->connection, dev, net ? wireless_network_get_essid (net) : NULL, FALSE, NULL);
network_device_unref (dev);
nmi_dbus_signal_user_interface_activated (applet->connection);
Index: NetworkManager-0.6.4/gnome/applet/applet-dbus-devices.c
===================================================================
--- NetworkManager-0.6.4.orig/gnome/applet/applet-dbus-devices.c
+++ NetworkManager-0.6.4/gnome/applet/applet-dbus-devices.c
@@ -1253,7 +1253,7 @@ void nma_dbus_device_remove_one_device (
*
*/
void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid,
- WirelessSecurityOption * opt)
+ gboolean fallback, WirelessSecurityOption * opt)
{
DBusMessage * message;
gboolean success = TRUE;
@@ -1272,6 +1272,7 @@ void nma_dbus_set_device (DBusConnection
/* Build up the required args */
dbus_message_append_args (message, DBUS_TYPE_OBJECT_PATH, &dev_path,
DBUS_TYPE_STRING, &essid,
+ DBUS_TYPE_BOOLEAN, &fallback,
DBUS_TYPE_INVALID);
/* If we have specific wireless security options, add them */
Index: NetworkManager-0.6.4/gnome/applet/applet-dbus-devices.h
===================================================================
--- NetworkManager-0.6.4.orig/gnome/applet/applet-dbus-devices.h
+++ NetworkManager-0.6.4/gnome/applet/applet-dbus-devices.h
@@ -49,7 +49,7 @@ void nma_dbus_device_remove_one_device
void nma_dbus_device_update_one_network (NMApplet *applet, const char *dev_path, const char *net_path, const char *active_net_path);
void nma_dbus_device_remove_one_network (NMApplet *applet, const char *dev_path, const char *net_path);
void nma_dbus_update_strength (NMApplet *applet, const char *dev_path, const char *net_path, int strength);
-void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid, WirelessSecurityOption *opt);
+void nma_dbus_set_device (DBusConnection *connection, NetworkDevice *dev, const char *essid, gboolean fallback, WirelessSecurityOption *opt);
void nma_dbus_create_network (DBusConnection *connection, NetworkDevice *dev, const char *essid, WirelessSecurityOption *opt);
void nma_free_data_model (NMApplet *applet);
Index: NetworkManager-0.6.4/gnome/applet/applet-dbus-info.c
===================================================================
--- NetworkManager-0.6.4.orig/gnome/applet/applet-dbus-info.c
+++ NetworkManager-0.6.4/gnome/applet/applet-dbus-info.c
@@ -395,7 +395,7 @@ nmi_dbus_get_network_properties (DBusCon
char * escaped_network = NULL;
char * essid = NULL;
gint timestamp = -1;
- gboolean trusted = FALSE;
+ gboolean fallback = FALSE;
DBusMessageIter iter, array_iter;
GConfClient * client;
NMGConfWSO * gconf_wso;
@@ -435,9 +435,9 @@ nmi_dbus_get_network_properties (DBusCon
if (!nm_gconf_get_int_helper (client, GCONF_PATH_WIRELESS_NETWORKS, "timestamp", escaped_network, &timestamp) || (timestamp < 0))
timestamp = 0;
- /* Trusted status */
- if (!nm_gconf_get_bool_helper (client, GCONF_PATH_WIRELESS_NETWORKS, "trusted", escaped_network, &trusted))
- trusted = FALSE;
+ /* Fallback status */
+ if (!nm_gconf_get_bool_helper (client, GCONF_PATH_WIRELESS_NETWORKS, "fallback", escaped_network, &fallback))
+ fallback = FALSE;
/* Grab the list of stored access point BSSIDs */
gconf_key = g_strdup_printf ("%s/%s/bssids", GCONF_PATH_WIRELESS_NETWORKS, escaped_network);
@@ -468,8 +468,8 @@ nmi_dbus_get_network_properties (DBusCon
/* Second arg: Timestamp (INT32) */
dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &timestamp);
- /* Third arg: Trusted (BOOLEAN) */
- dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &trusted);
+ /* Third arg: Fallback? (BOOLEAN) */
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &fallback);
/* Fourth arg: List of AP BSSIDs (ARRAY, STRING) */
dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING_AS_STRING, &array_iter);
@@ -818,12 +818,14 @@ static void
nmi_save_network_info (NMApplet *applet,
const char *essid,
gboolean automatic,
+ gboolean fallback,
const char *bssid,
NMGConfWSO * gconf_wso)
{
- char * key;
- GConfEntry * gconf_entry;
- char * escaped_network;
+ char * key;
+ GConfEntry * gconf_entry;
+ char * escaped_network;
+ GConfValue * value;
g_return_if_fail (applet != NULL);
g_return_if_fail (essid != NULL);
@@ -854,9 +856,18 @@ nmi_save_network_info (NMApplet *applet,
g_free (key);
}
+ /*
+ * XXX: We don't want to move a network from fallback to non-fallback because the user
+ * connected via other means. We need a better way to do this.
+ */
+ key = g_strdup_printf ("%s/%s/fallback", GCONF_PATH_WIRELESS_NETWORKS, escaped_network);
+ value = gconf_client_get (applet->gconf_client, key, NULL);
+ if (!value || value->type != GCONF_VALUE_BOOL || (!gconf_value_get_bool (value) && fallback))
+ gconf_client_set_bool (applet->gconf_client, key, fallback, NULL);
+ g_free (key);
+
if (bssid && (strlen (bssid) >= 11))
{
- GConfValue * value;
GSList * new_bssid_list = NULL;
gboolean found = FALSE;
@@ -954,6 +965,7 @@ nmi_dbus_update_network_info (DBusConnec
NMApplet * applet = (NMApplet *) user_data;
char * essid = NULL;
gboolean automatic;
+ gboolean fallback;
NMGConfWSO * gconf_wso = NULL;
DBusMessageIter iter;
char * bssid;
@@ -984,7 +996,15 @@ nmi_dbus_update_network_info (DBusConnec
}
dbus_message_iter_get_basic (&iter, &automatic);
- /* Third argument: Access point's BSSID */
+ /* Third argument: Fallback? (BOOLEAN) */
+ if (!dbus_message_iter_next (&iter) || (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_BOOLEAN))
+ {
+ nm_warning ("%s:%d - message argument 'fallback' was invalid.", __FILE__, __LINE__);
+ goto out;
+ }
+ dbus_message_iter_get_basic (&iter, &fallback);
+
+ /* Fourth argument: Access point's BSSID */
if (!dbus_message_iter_next (&iter) || (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING))
{
nm_warning ("%s:%d - message argument 'bssid' was invalid.", __FILE__, __LINE__);
@@ -1002,7 +1022,7 @@ nmi_dbus_update_network_info (DBusConnec
goto out;
}
- nmi_save_network_info (applet, essid, automatic, bssid, gconf_wso);
+ nmi_save_network_info (applet, essid, automatic, fallback, bssid, gconf_wso);
g_object_unref (G_OBJECT (gconf_wso));
out:
Index: NetworkManager-0.6.4/gnome/applet/applet.glade
===================================================================
--- NetworkManager-0.6.4.orig/gnome/applet/applet.glade
+++ NetworkManager-0.6.4/gnome/applet/applet.glade
@@ -426,7 +426,7 @@ You have chosen to log in to the wireles
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="n_rows">4</property>
+ <property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -548,8 +548,8 @@ You have chosen to log in to the wireles
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@@ -569,8 +569,8 @@ WEP 64/128-bit ASCII
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@@ -589,9 +589,31 @@ WEP 64/128-bit ASCII
<packing>
<property name="left_attach">0</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="fallback_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Fallback on this Network</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">fill</property>
+ <property name="y_options"></property>
</packing>
</child>
</widget>
Index: NetworkManager-0.6.4/gnome/applet/nm-gconf-wso-wpa-eap.c
===================================================================
--- NetworkManager-0.6.4.orig/gnome/applet/nm-gconf-wso-wpa-eap.c
+++ NetworkManager-0.6.4/gnome/applet/nm-gconf-wso-wpa-eap.c
@@ -332,3 +332,80 @@ nm_gconf_wso_wpa_eap_get_type (void)
}
return type;
}
+
+typedef struct {
+ GtkComboBox *combo;
+ gint value;
+} ComboSelectInfo;
+
+static gboolean
+combo_select (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
+{
+ ComboSelectInfo *info = user_data;
+ GValue val = { 0, };
+ gint i;
+
+ gtk_tree_model_get_value (model, iter, 1, &val);
+ i = g_value_get_int (&val);
+
+ if (i == info->value) {
+ gtk_combo_box_set_active_iter (info->combo, iter);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/* Ugh. Please avert your eyes. */
+void
+nm_gconf_wpa_eap_populate_dialog (NMGConfWSOWPA_EAP *wso, GladeXML *xml)
+{
+ GtkWidget *widget;
+ GtkTreeModel *model;
+ ComboSelectInfo info;
+
+ g_return_if_fail (wso != NULL);
+ g_return_if_fail (xml != NULL);
+
+ if (wso->priv->identity != NULL) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_identity_entry");
+ gtk_entry_set_text (GTK_ENTRY (widget), wso->priv->identity);
+ }
+
+ if (wso->priv->passwd != NULL) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_passwd_entry");
+ gtk_entry_set_text (GTK_ENTRY (widget), wso->priv->passwd);
+ }
+
+ if (wso->priv->anon_identity != NULL) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_anon_identity_entry");
+ gtk_entry_set_text (GTK_ENTRY (widget), wso->priv->anon_identity);
+ }
+
+ widget = glade_xml_get_widget (xml, "wpa_eap_eap_method_combo");
+ info.combo = GTK_COMBO_BOX (widget);
+ info.value = wso->priv->eap_method;
+ gtk_tree_model_foreach (gtk_combo_box_get_model (info.combo),
+ combo_select, &info);
+
+ widget = glade_xml_get_widget (xml, "wpa_eap_key_type_combo");
+ info.combo = GTK_COMBO_BOX (widget);
+ info.value = wso->priv->key_type;
+ gtk_tree_model_foreach (gtk_combo_box_get_model (info.combo),
+ combo_select, &info);
+
+ if (wso->priv->client_cert_file != NULL && g_file_test (wso->priv->client_cert_file, G_FILE_TEST_EXISTS)) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_client_cert_file_chooser_button");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->client_cert_file);
+ }
+
+ if (wso->priv->ca_cert_file != NULL && g_file_test (wso->priv->ca_cert_file, G_FILE_TEST_EXISTS)) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_ca_cert_file_chooser_button");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->ca_cert_file);
+ }
+
+ if (wso->priv->private_key_file != NULL && g_file_test (wso->priv->private_key_file, G_FILE_TEST_EXISTS)) {
+ widget = glade_xml_get_widget (xml, "wpa_eap_private_key_file_chooser_button");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->private_key_file);
+ }
+}
Index: NetworkManager-0.6.4/gnome/applet/nm-gconf-wso-wpa-eap.h
===================================================================
--- NetworkManager-0.6.4.orig/gnome/applet/nm-gconf-wso-wpa-eap.h
+++ NetworkManager-0.6.4/gnome/applet/nm-gconf-wso-wpa-eap.h
@@ -59,4 +59,7 @@ NMGConfWSOWPA_EAP * nm_gconf_wso_wpa_eap
NMGConfWSOWPA_EAP * nm_gconf_wso_wpa_eap_new_deserialize_gconf (GConfClient *client, const char *network, int we_cipher);
+/* Ugh. Please avert your eyes. */
+void nm_gconf_wpa_eap_populate_dialog (NMGConfWSOWPA_EAP *wso, GladeXML *xml);
+
#endif /* NM_GCONF_WSO_WPA_EAP_H */
Index: NetworkManager-0.6.4/gnome/applet/other-network-dialog.c
===================================================================
--- NetworkManager-0.6.4.orig/gnome/applet/other-network-dialog.c
+++ NetworkManager-0.6.4/gnome/applet/other-network-dialog.c
@@ -410,19 +410,24 @@ static void nma_ond_response_cb (GtkDial
WirelessSecurityOption * opt;
GtkComboBox * security_combo;
GtkTreeIter iter;
+ GtkWidget * fallback_button;
char * str;
NetworkDevice * dev;
+ gboolean fallback;
gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter);
gtk_tree_model_get (model, &iter, NAME_COLUMN, &str, DEV_COLUMN, &dev, -1);
+ fallback_button = glade_xml_get_widget (xml, "fallback_button");
+ fallback = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (fallback_button));
+
security_combo = GTK_COMBO_BOX (glade_xml_get_widget (xml, "security_combo"));
opt = wsm_get_option_for_active (wsm, security_combo);
if (create_network)
nma_dbus_create_network (applet->connection, dev, essid, opt);
else
- nma_dbus_set_device (applet->connection, dev, essid, opt);
+ nma_dbus_set_device (applet->connection, dev, essid, fallback, opt);
}
}
Index: NetworkManager-0.6.4/gnome/applet/passphrase-dialog.c
===================================================================
--- NetworkManager-0.6.4.orig/gnome/applet/passphrase-dialog.c
+++ NetworkManager-0.6.4/gnome/applet/passphrase-dialog.c
@@ -37,6 +37,9 @@
#include "NetworkManager.h"
#include "wireless-security-manager.h"
+#include "nm-gconf-wso-wpa-eap.h"
+#include "wso-private.h"
+
static GladeXML *get_dialog_xml (GtkWidget *dialog)
{
g_return_val_if_fail (dialog != NULL, NULL);
@@ -269,6 +272,24 @@ nmi_passphrase_dialog_new (NMApplet *app
g_signal_connect (G_OBJECT (dialog), "response", GTK_SIGNAL_FUNC (nmi_passphrase_dialog_response_received), dialog);
+ /* Ugh. Avert your eyes, please. */
+ {
+ /* Pre-populate the dialog if we have information about this network. */
+ NMGConfWSO *wso;
+ const char *essid;
+ char *escaped_network;
+
+ essid = wireless_network_get_essid (net);
+ escaped_network = gconf_escape_key (essid, strlen (essid));
+ wso = nm_gconf_wso_new_deserialize_gconf (applet->gconf_client, escaped_network);
+ g_free (escaped_network);
+
+ if (wso != NULL && NM_IS_GCONF_WSO_WPA_EAP (wso)) {
+ WirelessSecurityOption *wso_widget = wsm_get_option_for_active (wsm, GTK_COMBO_BOX (security_combo));
+ nm_gconf_wpa_eap_populate_dialog (NM_GCONF_WSO_WPA_EAP (wso), wso_widget->uixml);
+ }
+ }
+
/* Bash focus-stealing prevention in the face */
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS);
gtk_widget_realize (dialog);
Index: NetworkManager-0.6.4/src/backends/NetworkManagerSuSE.c
===================================================================
--- NetworkManager-0.6.4.orig/src/backends/NetworkManagerSuSE.c
+++ NetworkManager-0.6.4/src/backends/NetworkManagerSuSE.c
@@ -532,14 +532,12 @@ found:
if ((buf = svGetValue (file, "WIRELESS_ESSID")) && strlen (buf) > 1)
{
NMAccessPoint * ap;
- NMAccessPoint * list_ap;
char * key;
char * mode;
+ gboolean success = FALSE;
ap = nm_ap_new ();
nm_ap_set_essid (ap, buf);
- nm_ap_set_timestamp (ap, time (NULL), 0);
- nm_ap_set_trusted (ap, TRUE);
if ((mode = svGetValue (file, "WIRELESS_AUTH_MODE")) && !strcmp (mode, "psk"))
{
@@ -557,11 +555,16 @@ found:
{
nm_ap_security_set_key (NM_AP_SECURITY (security), hash, strlen (hash));
nm_ap_set_security (ap, NM_AP_SECURITY (security));
+ success = TRUE;
}
+ else
+ nm_warning ("Ignoring ESSID '%s' (invalid PSK key).", nm_ap_get_orig_essid (ap));
ieee_802_11_cipher_unref (cipher);
g_object_unref (G_OBJECT (security));
}
+ else
+ nm_warning ("Ignoring ESSID '%s' (PSK mode but no key provided).", nm_ap_get_orig_essid (ap));
}
else if ((key = svGetValue (file, "WIRELESS_KEY_0")) && strlen (key) > 3)
{
@@ -620,7 +623,10 @@ found:
{
nm_ap_security_set_key (NM_AP_SECURITY (security), hash, strlen (hash));
nm_ap_set_security (ap, NM_AP_SECURITY (security));
+ success = TRUE;
}
+ else
+ nm_warning ("Ignoring ESSID '%s' (invalid WEP key).", nm_ap_get_orig_essid (ap));
ieee_802_11_cipher_unref (cipher);
g_object_unref (G_OBJECT (security));
@@ -634,26 +640,20 @@ found:
security = nm_ap_security_new (IW_AUTH_CIPHER_NONE);
nm_ap_set_security (ap, security);
g_object_unref (G_OBJECT (security));
+ success = TRUE;
}
- if ((list_ap = nm_ap_list_get_ap_by_essid (app_data->allowed_ap_list, buf)))
- {
- nm_ap_set_essid (list_ap, nm_ap_get_essid (ap));
- nm_ap_set_timestamp_via_timestamp (list_ap, nm_ap_get_timestamp (ap));
- nm_ap_set_trusted (list_ap, nm_ap_get_trusted (ap));
- nm_ap_set_security (list_ap, nm_ap_get_security (ap));
- }
- else
+ if (success && !nm_ap_list_get_ap_by_essid (app_data->allowed_ap_list, buf))
{
/* New AP, just add it to the list */
+ nm_debug ("Adding '%s' to the list of trusted networks", buf);
nm_ap_list_append_ap (app_data->allowed_ap_list, ap);
- }
- nm_ap_unref (ap);
- nm_debug ("Adding '%s' to the list of trusted networks", buf);
+ /* Ensure all devices get new information copied into their device lists */
+ nm_policy_schedule_device_ap_lists_update_from_allowed (app_data);
+ }
- /* Ensure all devices get new information copied into their device lists */
- nm_policy_schedule_device_ap_lists_update_from_allowed (app_data);
+ nm_ap_unref (ap);
free (key);
free (mode);
Index: NetworkManager-0.6.4/src/NetworkManagerAP.c
===================================================================
--- NetworkManager-0.6.4.orig/src/NetworkManagerAP.c
+++ NetworkManager-0.6.4/src/NetworkManagerAP.c
--- NetworkManager-0.6.5.orig/src/NetworkManagerAP.c
+++ NetworkManager-0.6.5/src/NetworkManagerAP.c
@@ -56,7 +56,7 @@ struct NMAccessPoint
GTimeVal last_seen; /* Last time the AP was seen in a scan */
@@ -511,10 +38,10 @@ Index: NetworkManager-0.6.4/src/NetworkManagerAP.c
}
Index: NetworkManager-0.6.4/src/NetworkManagerAP.h
Index: NetworkManager-0.6.5/src/NetworkManagerAP.h
===================================================================
--- NetworkManager-0.6.4.orig/src/NetworkManagerAP.h
+++ NetworkManager-0.6.4/src/NetworkManagerAP.h
--- NetworkManager-0.6.5.orig/src/NetworkManagerAP.h
+++ NetworkManager-0.6.5/src/NetworkManagerAP.h
@@ -72,8 +72,8 @@ void nm_ap_set_rate (NMAccessPoint
gboolean nm_ap_get_invalid (const NMAccessPoint *ap);
void nm_ap_set_invalid (NMAccessPoint *ap, gboolean invalid);
@@ -526,10 +53,10 @@ Index: NetworkManager-0.6.4/src/NetworkManagerAP.h
gboolean nm_ap_get_artificial (const NMAccessPoint *ap);
void nm_ap_set_artificial (NMAccessPoint *ap, gboolean artificial);
Index: NetworkManager-0.6.4/src/NetworkManagerAPList.c
Index: NetworkManager-0.6.5/src/NetworkManagerAPList.c
===================================================================
--- NetworkManager-0.6.4.orig/src/NetworkManagerAPList.c
+++ NetworkManager-0.6.4/src/NetworkManagerAPList.c
--- NetworkManager-0.6.5.orig/src/NetworkManagerAPList.c
+++ NetworkManager-0.6.5/src/NetworkManagerAPList.c
@@ -422,6 +422,63 @@ NMAccessPoint *nm_ap_list_get_ap_by_addr
return (found_ap);
}
@@ -594,10 +121,10 @@ Index: NetworkManager-0.6.4/src/NetworkManagerAPList.c
/*
* nm_ap_list_merge_scanned_ap
Index: NetworkManager-0.6.4/src/NetworkManagerAPList.h
Index: NetworkManager-0.6.5/src/NetworkManagerAPList.h
===================================================================
--- NetworkManager-0.6.4.orig/src/NetworkManagerAPList.h
+++ NetworkManager-0.6.4/src/NetworkManagerAPList.h
--- NetworkManager-0.6.5.orig/src/NetworkManagerAPList.h
+++ NetworkManager-0.6.5/src/NetworkManagerAPList.h
@@ -51,6 +51,8 @@ void nm_ap_list_copy_properties (NMA
void nm_ap_list_copy_essids_by_address (NMData *app_data, NMDevice80211Wireless *dev, NMAccessPointList *dest, NMAccessPointList *source);
void nm_ap_list_copy_one_essid_by_address (NMData *app_data, NMDevice80211Wireless *dev, NMAccessPoint *ap, NMAccessPointList *search_list);
@@ -607,10 +134,103 @@ Index: NetworkManager-0.6.4/src/NetworkManagerAPList.h
gboolean nm_ap_list_merge_scanned_ap (NMDevice80211Wireless *dev, NMAccessPointList *list, NMAccessPoint *merge_ap);
NMNetworkType nm_ap_list_get_type (NMAccessPointList *list);
Index: NetworkManager-0.6.4/src/nm-dbus-nm.c
Index: NetworkManager-0.6.5/src/backends/NetworkManagerSuSE.c
===================================================================
--- NetworkManager-0.6.4.orig/src/nm-dbus-nm.c
+++ NetworkManager-0.6.4/src/nm-dbus-nm.c
--- NetworkManager-0.6.5.orig/src/backends/NetworkManagerSuSE.c
+++ NetworkManager-0.6.5/src/backends/NetworkManagerSuSE.c
@@ -527,11 +527,10 @@ found:
NMAccessPoint * list_ap;
char * key;
char * mode;
+ gboolean success = FALSE;
ap = nm_ap_new ();
nm_ap_set_essid (ap, buf);
- nm_ap_set_timestamp (ap, time (NULL), 0);
- nm_ap_set_trusted (ap, TRUE);
if ((mode = svGetValue (file, "WIRELESS_AUTH_MODE")) && !strcmp (mode, "psk"))
{
@@ -549,11 +548,16 @@ found:
{
nm_ap_security_set_key (NM_AP_SECURITY (security), hash, strlen (hash));
nm_ap_set_security (ap, NM_AP_SECURITY (security));
+ success = TRUE;
}
+ else
+ nm_warning ("Ignoring ESSID '%s' (invalid PSK key).", nm_ap_get_orig_essid (ap));
ieee_802_11_cipher_unref (cipher);
g_object_unref (G_OBJECT (security));
}
+ else
+ nm_warning ("Ignoring ESSID '%s' (PSK mode but no key provided).", nm_ap_get_orig_essid (ap));
}
else if ((key = svGetValue (file, "WIRELESS_KEY_0")) && strlen (key) > 3)
{
@@ -612,7 +616,10 @@ found:
{
nm_ap_security_set_key (NM_AP_SECURITY (security), hash, strlen (hash));
nm_ap_set_security (ap, NM_AP_SECURITY (security));
+ success = TRUE;
}
+ else
+ nm_warning ("Ignoring ESSID '%s' (invalid WEP key).", nm_ap_get_orig_essid (ap));
ieee_802_11_cipher_unref (cipher);
g_object_unref (G_OBJECT (security));
@@ -626,26 +633,32 @@ found:
security = nm_ap_security_new (IW_AUTH_CIPHER_NONE);
nm_ap_set_security (ap, security);
g_object_unref (G_OBJECT (security));
+ success = TRUE;
}
- if ((list_ap = nm_ap_list_get_ap_by_essid (app_data->allowed_ap_list, buf)))
- {
- nm_ap_set_essid (list_ap, nm_ap_get_essid (ap));
- nm_ap_set_timestamp_via_timestamp (list_ap, nm_ap_get_timestamp (ap));
- nm_ap_set_trusted (list_ap, nm_ap_get_trusted (ap));
- nm_ap_set_security (list_ap, nm_ap_get_security (ap));
- }
- else
+ if (success)
{
- /* New AP, just add it to the list */
- nm_ap_list_append_ap (app_data->allowed_ap_list, ap);
- }
- nm_ap_unref (ap);
+ if ((list_ap = nm_ap_list_get_ap_by_essid (app_data->allowed_ap_list, buf)))
+ {
+ nm_ap_set_essid (list_ap, nm_ap_get_essid (ap));
+ nm_ap_set_timestamp_via_timestamp (list_ap, nm_ap_get_timestamp (ap));
+ nm_ap_set_security (list_ap, nm_ap_get_security (ap));
+ }
+ else
+ {
+ nm_ap_set_timestamp (ap, time (NULL), 0);
+
+ /* New AP, just add it to the list */
+ nm_ap_list_append_ap (app_data->allowed_ap_list, ap);
+ }
+
+ nm_debug ("Adding '%s' to the list of trusted networks", buf);
- nm_debug ("Adding '%s' to the list of trusted networks", buf);
+ /* Ensure all devices get new information copied into their device lists */
+ nm_policy_schedule_device_ap_lists_update_from_allowed (app_data);
+ }
- /* Ensure all devices get new information copied into their device lists */
- nm_policy_schedule_device_ap_lists_update_from_allowed (app_data);
+ nm_ap_unref (ap);
free (key);
free (mode);
Index: NetworkManager-0.6.5/src/nm-dbus-nm.c
===================================================================
--- NetworkManager-0.6.5.orig/src/nm-dbus-nm.c
+++ NetworkManager-0.6.5/src/nm-dbus-nm.c
@@ -262,6 +262,7 @@ static DBusMessage *nm_dbus_nm_set_activ
{
NMAPSecurity * security = NULL;
@@ -643,11 +263,11 @@ Index: NetworkManager-0.6.4/src/nm-dbus-nm.c
if (security)
g_object_unref (G_OBJECT (security));
Index: NetworkManager-0.6.4/src/nm-dbus-nmi.c
Index: NetworkManager-0.6.5/src/nm-dbus-nmi.c
===================================================================
--- NetworkManager-0.6.4.orig/src/nm-dbus-nmi.c
+++ NetworkManager-0.6.4/src/nm-dbus-nmi.c
@@ -223,6 +223,7 @@ gboolean nm_dbus_update_network_info (DB
--- NetworkManager-0.6.5.orig/src/nm-dbus-nmi.c
+++ NetworkManager-0.6.5/src/nm-dbus-nmi.c
@@ -229,6 +229,7 @@ gboolean nm_dbus_update_network_info (DB
{
DBusMessage * message;
gboolean success = FALSE;
@@ -655,7 +275,7 @@ Index: NetworkManager-0.6.4/src/nm-dbus-nmi.c
const char * essid;
gchar * char_bssid;
NMAPSecurity * security;
@@ -245,10 +246,14 @@ gboolean nm_dbus_update_network_info (DB
@@ -251,10 +252,14 @@ gboolean nm_dbus_update_network_info (DB
/* First argument: ESSID (STRING) */
dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &essid);
@@ -672,7 +292,7 @@ Index: NetworkManager-0.6.4/src/nm-dbus-nmi.c
addr = nm_ap_get_address (ap);
if ((nm_ap_get_mode (ap) == IW_MODE_INFRA) && nm_ethernet_address_is_valid (addr))
{
@@ -339,7 +344,7 @@ static void nm_dbus_get_network_data_cb
@@ -345,7 +350,7 @@ static void nm_dbus_get_network_data_cb
DBusMessageIter subiter;
const char * essid = NULL;
gint timestamp_secs = -1;
@@ -681,7 +301,7 @@ Index: NetworkManager-0.6.4/src/nm-dbus-nmi.c
GSList * addr_list = NULL;
NMAPSecurity * security;
NMAccessPoint * ap;
@@ -390,14 +395,14 @@ static void nm_dbus_get_network_data_cb
@@ -396,14 +401,14 @@ static void nm_dbus_get_network_data_cb
}
dbus_message_iter_get_basic (&iter, &timestamp_secs);
@@ -699,7 +319,7 @@ Index: NetworkManager-0.6.4/src/nm-dbus-nmi.c
/* Fourth arg: BSSID addresses (ARRAY, STRING) */
if (!dbus_message_iter_next (&iter)
@@ -436,11 +441,12 @@ static void nm_dbus_get_network_data_cb
@@ -442,11 +447,12 @@ static void nm_dbus_get_network_data_cb
ap = nm_ap_new ();
nm_ap_set_essid (ap, essid);
nm_ap_set_security (ap, security);
@@ -713,7 +333,7 @@ Index: NetworkManager-0.6.4/src/nm-dbus-nmi.c
nm_ap_set_user_addresses (ap, addr_list);
if ((list_ap = nm_ap_list_get_ap_by_essid (cb_data->list, essid)))
@@ -449,8 +455,9 @@ static void nm_dbus_get_network_data_cb
@@ -455,8 +461,9 @@ static void nm_dbus_get_network_data_cb
nm_ap_set_essid (list_ap, nm_ap_get_essid (ap));
nm_ap_set_timestamp_via_timestamp (list_ap, nm_ap_get_timestamp (ap));
@@ -724,11 +344,11 @@ Index: NetworkManager-0.6.4/src/nm-dbus-nmi.c
user_addresses = nm_ap_get_user_addresses (ap);
nm_ap_set_user_addresses (list_ap, user_addresses);
Index: NetworkManager-0.6.4/src/nm-device-802-11-wireless.c
Index: NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
===================================================================
--- NetworkManager-0.6.4.orig/src/nm-device-802-11-wireless.c
+++ NetworkManager-0.6.4/src/nm-device-802-11-wireless.c
@@ -244,12 +244,13 @@ nm_device_802_11_wireless_update_bssid (
--- NetworkManager-0.6.5.orig/src/nm-device-802-11-wireless.c
+++ NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
@@ -242,12 +242,13 @@ nm_device_802_11_wireless_update_bssid (
return;
/* Get the current BSSID. If it is valid but does not match the stored value,
@@ -743,7 +363,7 @@ Index: NetworkManager-0.6.4/src/nm-device-802-11-wireless.c
&& !nm_ethernet_addresses_are_equal (&new_bssid, old_bssid)
&& !nm_null_safe_strcmp (old_essid, new_essid))
{
@@ -792,12 +793,11 @@ nm_device_802_11_wireless_get_best_ap (N
@@ -742,12 +743,11 @@ nm_device_802_11_wireless_get_best_ap (N
NMAPListIter * iter;
NMAccessPoint * scan_ap = NULL;
NMAccessPoint * best_ap = NULL;
@@ -759,7 +379,7 @@ Index: NetworkManager-0.6.4/src/nm-device-802-11-wireless.c
NMData * app_data;
g_return_val_if_fail (self != NULL, NULL);
@@ -883,27 +883,50 @@ nm_device_802_11_wireless_get_best_ap (N
@@ -833,27 +833,50 @@ nm_device_802_11_wireless_get_best_ap (N
}
}
@@ -822,7 +442,7 @@ Index: NetworkManager-0.6.4/src/nm-device-802-11-wireless.c
if (best_ap)
nm_ap_ref (best_ap);
@@ -1837,7 +1860,6 @@ convert_scan_results (gpointer user_data
@@ -1787,7 +1810,6 @@ convert_scan_results (gpointer user_data
NMDevice80211Wireless * self;
GTimeVal cur_time;
NMAPListIter * iter = NULL;
@@ -830,7 +450,7 @@ Index: NetworkManager-0.6.4/src/nm-device-802-11-wireless.c
NMData * app_data;
NMAccessPointList * ap_list;
@@ -1847,17 +1869,22 @@ convert_scan_results (gpointer user_data
@@ -1797,17 +1819,22 @@ convert_scan_results (gpointer user_data
if (!self || !cb_data->results)
return FALSE;
@@ -854,7 +474,7 @@ Index: NetworkManager-0.6.4/src/nm-device-802-11-wireless.c
/* Walk the access point list and remove any access points older than thrice the inactive scan interval */
g_get_current_time (&cur_time);
ap_list = nm_device_802_11_wireless_ap_list_get (self);
@@ -3053,9 +3080,10 @@ supplicant_send_network_config (NMDevice
@@ -2906,9 +2933,10 @@ supplicant_send_network_config (NMDevice
goto out;
/* For non-broadcast networks, we need to set "scan_ssid 1" to scan with probe request frames.
@@ -866,7 +486,7 @@ Index: NetworkManager-0.6.4/src/nm-device-802-11-wireless.c
{
if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL,
"SET_NETWORK %i scan_ssid 1", nwid))
@@ -3363,24 +3391,27 @@ real_activation_failure_handler (NMDevic
@@ -3219,24 +3247,27 @@ real_activation_failure_handler (NMDevic
if ((ap = nm_act_request_get_ap (req)))
{
@@ -911,11 +531,11 @@ Index: NetworkManager-0.6.4/src/nm-device-802-11-wireless.c
}
}
Index: NetworkManager-0.6.4/test/nm-set-fallback
Index: NetworkManager-0.6.5/test/nm-set-fallback
===================================================================
--- /dev/null
+++ NetworkManager-0.6.4/test/nm-set-fallback
@@ -0,0 +1,27 @@
+++ NetworkManager-0.6.5/test/nm-set-fallback
@@ -0,0 +1,28 @@
+#! /bin/sh
+#
+# nm-set-fallback - mark a network as fallback
@@ -943,3 +563,4 @@ Index: NetworkManager-0.6.4/test/nm-set-fallback
+fi
+
+$BIN --set --type=bool $KEY ${2}
+
+4 -7
View File
@@ -1,11 +1,8 @@
Index: gnome/applet/applet.c
Index: nm-applet-0.6.5/src/applet.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/gnome/applet/applet.c,v
retrieving revision 1.112.2.6
diff -u -r1.112.2.6 applet.c
--- gnome/applet/applet.c 17 May 2006 20:03:56 -0000 1.112.2.6
+++ gnome/applet/applet.c 17 May 2006 20:49:51 -0000
@@ -2593,7 +2593,7 @@
--- nm-applet-0.6.5/src/applet.c.orig
+++ nm-applet-0.6.5/src/applet.c
@@ -2741,7 +2741,7 @@ nma_icons_load_from_disk (NMApplet *appl
ICON_LOAD(applet->no_connection_icon, "nm-no-connection");
ICON_LOAD(applet->wired_icon, "nm-device-wired");
-67
View File
@@ -1,67 +0,0 @@
Index: src/nm-device-802-11-wireless.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/nm-device-802-11-wireless.c,v
retrieving revision 1.60.2.8
diff -u -r1.60.2.8 nm-device-802-11-wireless.c
--- src/nm-device-802-11-wireless.c 17 May 2006 14:57:05 -0000 1.60.2.8
+++ src/nm-device-802-11-wireless.c 17 May 2006 15:28:19 -0000
@@ -116,7 +116,8 @@
guint8 **out_res_buf,
guint32 *data_len);
-static int wireless_qual_to_percent (const struct iw_quality *qual,
+static int wireless_qual_to_percent (NMDevice *dev,
+ const struct iw_quality *qual,
const struct iw_quality *max_qual,
const struct iw_quality *avg_qual);
@@ -244,8 +245,9 @@
#endif
if (iw_get_stats (nm_dev_sock_get_fd (sk), iface, &stats, &range, has_range) == 0)
{
- percent = wireless_qual_to_percent (&stats.qual, (const iwqual *)(&self->priv->max_qual),
- (const iwqual *)(&self->priv->avg_qual));
+ percent = wireless_qual_to_percent (NM_DEVICE (self), &stats.qual,
+ (const iwqual *)(&self->priv->max_qual),
+ (const iwqual *)(&self->priv->avg_qual));
}
nm_dev_sock_close (sk);
}
@@ -1148,7 +1150,8 @@
*
*/
static int
-wireless_qual_to_percent (const struct iw_quality *qual,
+wireless_qual_to_percent (NMDevice *dev,
+ const struct iw_quality *qual,
const struct iw_quality *max_qual,
const struct iw_quality *avg_qual)
{
@@ -1177,7 +1180,7 @@
* are free to use whatever they want to calculate "Link Quality".
*/
if ((max_qual->qual != 0) && !(max_qual->updated & IW_QUAL_QUAL_INVALID) && !(qual->updated & IW_QUAL_QUAL_INVALID))
- percent = (int)(100 * ((double)qual->qual / (double)max_qual->qual));
+ percent = (int) (100 * ((double) qual->qual / (double) max_qual->qual));
/* If the driver doesn't specify a complete and valid quality, we have two options:
*
@@ -1243,7 +1246,7 @@
}
/* If the quality percent was 0 or doesn't exist, then try to use signal levels instead */
- if ((percent < 1) && (level_percent >= 0))
+ if ((percent < 1 || !strcmp (nm_device_get_driver (dev), "ath_pci")) && (level_percent >= 0))
percent = level_percent;
#ifdef IW_QUAL_DEBUG
@@ -3301,7 +3304,8 @@
nm_ap_set_freq (ap, iw_freq2float(&(iwe->u.freq)));
break;
case IWEVQUAL:
- nm_ap_set_strength (ap, wireless_qual_to_percent (&(iwe->u.qual),
+ nm_ap_set_strength (ap, wireless_qual_to_percent (&dev->parent,
+ &(iwe->u.qual),
(const iwqual *)(&dev->priv->max_qual),
(const iwqual *)(&dev->priv->avg_qual)));
break;
+5 -11
View File
@@ -1,14 +1,8 @@
gnome/applet/menu-items.c | 9 ---------
1 files changed, 9 deletions(-)
Index: gnome/applet/menu-items.c
Index: nm-applet-0.6.5/src/menu-items.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/gnome/applet/menu-items.c,v
retrieving revision 1.6
diff -u -u -r1.6 menu-items.c
--- gnome/applet/menu-items.c 30 Jun 2005 14:31:24 -0000 1.6
+++ gnome/applet/menu-items.c 30 Jun 2005 19:06:51 -0000
@@ -112,14 +112,6 @@
--- nm-applet-0.6.5.orig/src/menu-items.c
+++ nm-applet-0.6.5/src/menu-items.c
@@ -112,14 +112,6 @@ struct NMWirelessMenuItem
};
@@ -23,7 +17,7 @@ diff -u -u -r1.6 menu-items.c
NMWirelessMenuItem *wireless_menu_item_new (void)
{
NMWirelessMenuItem *item = g_malloc0 (sizeof (NMWirelessMenuItem));
@@ -131,7 +123,6 @@
@@ -129,7 +121,6 @@ NMWirelessMenuItem *wireless_menu_item_n
/* Make sure it looks slightly different if the label determines the width of the widget */
item->label = GTK_LABEL (gtk_label_new (NULL));
gtk_misc_set_padding (GTK_MISC (item->label), 6, 0);
+6 -10
View File
@@ -1,17 +1,13 @@
? gnome/applet/.main.c.swp
Index: gnome/applet/main.c
Index: nm-applet-0.6.5/src/main.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/gnome/applet/main.c,v
retrieving revision 1.10
diff -u -r1.10 main.c
--- gnome/applet/main.c 3 Feb 2006 15:34:27 -0000 1.10
+++ gnome/applet/main.c 3 Feb 2006 16:28:09 -0000
@@ -52,7 +52,7 @@
--- nm-applet-0.6.5.orig/src/main.c
+++ nm-applet-0.6.5/src/main.c
@@ -50,7 +50,7 @@ int main (int argc, char *argv[])
GNOME_PARAM_NONE, GNOME_PARAM_NONE);
client = gnome_master_client ();
- gnome_client_set_restart_style (client, GNOME_RESTART_ANYWAY);
+ gnome_client_set_restart_style (client, GNOME_RESTART_NEVER);
g_signal_connect (client, "save_yourself", G_CALLBACK (session_save), NULL);
g_signal_connect (client, "die", G_CALLBACK (session_die), NULL);
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+6 -15
View File
@@ -1,16 +1,8 @@
--- src/named-manager/Makefile.am
+++ src/named-manager/Makefile.am
@@ -4,6 +4,6 @@
libnamed_manager_la_SOURCES = nm-named-manager.h nm-named-manager.c
-libnamed_manager_la_CPPFLAGS = $(DBUS_CFLAGS) $(GTHREAD_CFLAGS) -DNM_PKGDATADIR=\"$(pkgdatadir)\" -DNM_LOCALSTATEDIR=\"$(localstatedir)\" -DDBUS_API_SUBJECT_TO_CHANGE
+libnamed_manager_la_CPPFLAGS = $(DBUS_CFLAGS) $(GTHREAD_CFLAGS) -DNM_PKGDATADIR=\"$(pkgdatadir)\" -DNM_LOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" -DDBUS_API_SUBJECT_TO_CHANGE
libnamed_manager_la_LIBADD = $(DBUS_LIBS) $(GTHREAD_LIBS)
--- src/named-manager/nm-named-manager.c
+++ src/named-manager/nm-named-manager.c
@@ -367,7 +367,15 @@
Index: NetworkManager-0.6.5/src/named-manager/nm-named-manager.c
===================================================================
--- NetworkManager-0.6.5.orig/src/named-manager/nm-named-manager.c
+++ NetworkManager-0.6.5/src/named-manager/nm-named-manager.c
@@ -367,7 +367,15 @@ rewrite_resolv_conf (NMNamedManager *mgr
if ((f = fopen (tmp_resolv_conf, "w")) == NULL)
goto lose;
@@ -19,7 +11,7 @@
+ goto lose;
+ if (fprintf (f, "# Modified_by: NetworkManager\n") < 0)
+ goto lose;
+ if (fprintf (f, "# Process: " SBINDIR "/NetworkManager\n") < 0)
+ if (fprintf (f, "# Process: /usr/bin/NetworkManager\n") < 0)
+ goto lose;
+ if (fprintf (f, "# Process_id: %d\n", getpid ()) < 0)
+ goto lose;
@@ -27,4 +19,3 @@
goto lose;
searches = compute_searches (mgr, config);
+467
View File
@@ -0,0 +1,467 @@
Index: nm-applet-0.6.5/src/applet-dbus-info.c
===================================================================
--- nm-applet-0.6.5/src/applet-dbus-info.c.orig
+++ nm-applet-0.6.5/src/applet-dbus-info.c
@@ -39,6 +39,7 @@
#include "passphrase-dialog.h"
#include "nm-utils.h"
#include "nm-gconf-wso.h"
+#include "nm-gconf-wso-wpa-eap.h"
#include "gconf-helpers.h"
#include "dbus-method-dispatcher.h"
#include "dbus-helpers.h"
@@ -73,6 +74,7 @@ typedef struct NMGetNetworkKeyCBData
{
NMApplet *applet;
DBusMessage *message;
+ NMGConfWSO *gconf_wso;
NetworkDevice *dev;
char *net_path;
char *essid;
@@ -83,6 +85,7 @@ static void free_network_key_cb_data (NM
if (cb_data)
{
dbus_message_unref (cb_data->message);
+ g_object_unref (cb_data->gconf_wso);
network_device_unref (cb_data->dev);
g_free (cb_data->net_path);
g_free (cb_data->essid);
@@ -92,6 +95,37 @@ static void free_network_key_cb_data (NM
}
+static void
+nmi_dbus_get_eap_key_callback (GnomeKeyringResult result,
+ GList *found_list,
+ gpointer data)
+{
+ NMGetNetworkKeyCBData * cb_data = (NMGetNetworkKeyCBData*) data;
+ NMApplet * applet = cb_data->applet;
+ DBusMessage * message = cb_data->message;
+ NMGConfWSO * gconf_wso = cb_data->gconf_wso;
+ NetworkDevice * dev = cb_data->dev;
+ char * net_path = cb_data->net_path;
+
+ if (result == GNOME_KEYRING_RESULT_OK) {
+ GnomeKeyringFound * found;
+
+ found = found_list->data;
+ nm_gconf_wso_wpa_eap_set_password (NM_GCONF_WSO_WPA_EAP (gconf_wso),
+ found->secret,
+ strlen (found->secret));
+ nmi_dbus_return_user_key (applet->connection, message, gconf_wso);
+ } else {
+ WirelessNetwork *net;
+
+ nmi_passphrase_dialog_destroy (applet);
+ if ((net = network_device_get_wireless_network_by_nm_path (dev, net_path)))
+ applet->passphrase_dialog = nmi_passphrase_dialog_new (applet, 0, dev, net, message);
+ }
+
+ free_network_key_cb_data (cb_data);
+}
+
static void nmi_dbus_get_network_key_callback (GnomeKeyringResult result,
GList *found_list,
gpointer data)
@@ -99,26 +133,30 @@ static void nmi_dbus_get_network_key_cal
NMGetNetworkKeyCBData * cb_data = (NMGetNetworkKeyCBData*) data;
NMApplet * applet = cb_data->applet;
DBusMessage * message = cb_data->message;
+ NMGConfWSO * gconf_wso = cb_data->gconf_wso;
NetworkDevice * dev = cb_data->dev;
char * net_path = cb_data->net_path;
char * essid = cb_data->essid;
- if (result == GNOME_KEYRING_RESULT_OK)
- {
- gchar * escaped_network;
- GnomeKeyringFound * found;
- NMGConfWSO * gconf_wso;
+ if (result == GNOME_KEYRING_RESULT_OK) {
+ GnomeKeyringFound *found = (GnomeKeyringFound *) found_list->data;
+ nm_gconf_wso_set_key (gconf_wso, found->secret, strlen (found->secret));
- escaped_network = gconf_escape_key (essid, strlen (essid));
- gconf_wso = nm_gconf_wso_new_deserialize_gconf (applet->gconf_client, escaped_network);
- g_free (escaped_network);
+ if (nm_gconf_wso_get_we_cipher (gconf_wso) == NM_AUTH_TYPE_WPA_EAP &&
+ nm_gconf_wso_wpa_eap_have_passwd (NM_GCONF_WSO_WPA_EAP (gconf_wso))) {
- found = found_list->data;
- nm_gconf_wso_set_key (gconf_wso, found->secret, strlen (found->secret));
- nmi_dbus_return_user_key (applet->connection, message, gconf_wso);
- }
- else
- {
+ gnome_keyring_find_itemsv (GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ nmi_dbus_get_eap_key_callback,
+ cb_data,
+ NULL,
+ "eap-essid",
+ GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
+ essid,
+ NULL);
+ return; /* Don't free cb_data */
+ } else
+ nmi_dbus_return_user_key (applet->connection, message, gconf_wso);
+ } else {
WirelessNetwork *net;
nmi_passphrase_dialog_destroy (applet);
@@ -222,6 +260,7 @@ nmi_dbus_get_key_for_network (DBusConnec
cb_data->essid = g_strdup (essid);
cb_data->message = message;
dbus_message_ref (message);
+ cb_data->gconf_wso = nm_gconf_wso_new_deserialize_gconf (applet->gconf_client, escaped_network);
cb_data->dev = dev;
network_device_ref (dev);
cb_data->net_path = g_strdup (net_path);
@@ -234,16 +273,38 @@ nmi_dbus_get_key_for_network (DBusConnec
gtk_menu_shell_deactivate (GTK_MENU_SHELL (applet->dropdown_menu));
/* Get the essid key, if any, from the keyring */
- gnome_keyring_find_itemsv (GNOME_KEYRING_ITEM_GENERIC_SECRET,
- (GnomeKeyringOperationGetListCallback) nmi_dbus_get_network_key_callback,
- cb_data,
- NULL,
- "essid",
- GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
- essid,
- NULL);
+ if (!NM_IS_GCONF_WSO_WPA_EAP (cb_data->gconf_wso) ||
+ (NM_IS_GCONF_WSO_WPA_EAP (cb_data->gconf_wso) &&
+ nm_gconf_wso_wpa_eap_have_private_key_passwd (NM_GCONF_WSO_WPA_EAP (cb_data->gconf_wso)))) {
+
+ /* Not WPA-EAP or WPA-EAP and have private key password */
+ gnome_keyring_find_itemsv (GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ nmi_dbus_get_network_key_callback,
+ cb_data,
+ NULL,
+ "essid",
+ GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
+ essid,
+ NULL);
+ } else if (NM_IS_GCONF_WSO_WPA_EAP (cb_data->gconf_wso) &&
+ nm_gconf_wso_wpa_eap_have_passwd (NM_GCONF_WSO_WPA_EAP (cb_data->gconf_wso))) {
+
+ /* WPA-EAP, no private key password, user password */
+ gnome_keyring_find_itemsv (GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ nmi_dbus_get_eap_key_callback,
+ cb_data,
+ NULL,
+ "eap-essid",
+ GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
+ essid,
+ NULL);
+ } else {
+ free_network_key_cb_data (cb_data);
+ new_key = TRUE;
+ }
}
- else
+
+ if (new_key)
{
/* We only ask the user for a new key when we know about the network from NM,
* since throwing up a dialog with a random essid from somewhere is a security issue.
@@ -255,6 +316,8 @@ nmi_dbus_get_key_for_network (DBusConnec
}
}
+ g_free (escaped_network);
+
return NULL;
}
@@ -850,6 +913,62 @@ save_network_info_keyring_cb (GnomeKeyri
nm_warning ("Error saving secret for wireless network '%s' in keyring: %d", (char *) user_data, result);
}
+
+static void
+save_one_secret (const char *description, const char *essid, const char *name, const char *key)
+{
+ GnomeKeyringAttributeList *attributes;
+ GnomeKeyringAttribute attr;
+ GnomeKeyringResult ret;
+ guint32 item_id;
+
+ attributes = gnome_keyring_attribute_list_new ();
+ attr.name = g_strdup (name);
+ attr.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING;
+ attr.value.string = g_strdup (essid);
+ g_array_append_val (attributes, attr);
+
+ ret = gnome_keyring_item_create_sync (NULL,
+ GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ description,
+ attributes,
+ key,
+ TRUE,
+ &item_id);
+ if (ret != GNOME_KEYRING_RESULT_OK)
+ nm_warning ("Error saving secret for wireless network '%s' in keyring: %d", essid, ret);
+
+ gnome_keyring_attribute_list_free (attributes);
+}
+
+static void
+save_secrets (NMGConfWSO *gconf_wso, const char *essid)
+{
+ int we_cipher;
+ const char *key;
+ char *description;
+
+ we_cipher = nm_gconf_wso_get_we_cipher (gconf_wso);
+ if (we_cipher == IW_AUTH_CIPHER_NONE)
+ /* That was easy */
+ return;
+
+ key = nm_gconf_wso_get_key (gconf_wso);
+ if (key) {
+ description = g_strdup_printf (_("Passphrase for wireless network %s"), essid);
+ save_one_secret (description, essid, "essid", key);
+ g_free (description);
+ }
+
+ if (we_cipher == NM_AUTH_TYPE_WPA_EAP) {
+ key = nm_gconf_wso_wpa_eap_get_password (NM_GCONF_WSO_WPA_EAP (gconf_wso));
+ if (key) {
+ description = g_strdup_printf (_("EAP password for wireless network %s"), essid);
+ save_one_secret (description, essid, "eap-essid", key);
+ g_free (description);
+ }
+ }
+}
/*
* nmi_save_network_info
@@ -958,32 +1077,7 @@ nmi_save_network_info (NMApplet *applet,
}
/* Stuff the encryption key into the keyring */
- if (nm_gconf_wso_get_we_cipher (gconf_wso) != IW_AUTH_CIPHER_NONE)
- {
- GnomeKeyringAttributeList * attributes;
- GnomeKeyringAttribute attr;
- char * display_name;
-
- display_name = g_strdup_printf (_("Passphrase for wireless network %s"), essid);
-
- attributes = gnome_keyring_attribute_list_new ();
- attr.name = g_strdup ("essid");
- attr.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING;
- attr.value.string = g_strdup (essid);
- g_array_append_val (attributes, attr);
-
- gnome_keyring_item_create (NULL,
- GNOME_KEYRING_ITEM_GENERIC_SECRET,
- display_name,
- attributes,
- nm_gconf_wso_get_key (gconf_wso),
- TRUE,
- save_network_info_keyring_cb,
- g_strdup (essid),
- (GDestroyNotify) g_free);
- g_free (display_name);
- gnome_keyring_attribute_list_free (attributes);
- }
+ save_secrets (gconf_wso, essid);
out:
g_free (escaped_network);
Index: nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c
===================================================================
--- nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c.orig
+++ nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.c
@@ -49,6 +49,9 @@ struct _NMGConfWSOWPA_EAPPrivate
const char * private_key_file;
const char * client_cert_file;
const char * ca_cert_file;
+
+ gboolean have_passwd;
+ gboolean have_private_key_passwd;
};
@@ -78,14 +81,21 @@ nm_gconf_wso_wpa_eap_new_deserialize_dbu
/* Success, build up our security object */
security = g_object_new (NM_TYPE_GCONF_WSO_WPA_EAP, NULL);
nm_gconf_wso_set_we_cipher (NM_GCONF_WSO (security), we_cipher);
- if (private_key_passwd && strlen (private_key_passwd) > 0)
+ if (private_key_passwd && strlen (private_key_passwd) > 0) {
+ security->priv->have_private_key_passwd = TRUE;
nm_gconf_wso_set_key (NM_GCONF_WSO (security), private_key_passwd, strlen (private_key_passwd));
+ }
security->priv->wpa_version = wpa_version;
security->priv->key_type = key_type;
security->priv->eap_method = NM_EAP_TO_EAP_METHOD (eap_method);
security->priv->phase2_type = NM_EAP_TO_PHASE2_METHOD (eap_method);
security->priv->key_mgmt = IW_AUTH_KEY_MGMT_802_1X;
- security->priv->identity = g_strdup (identity);
+
+ if (passwd) {
+ security->priv->have_passwd = TRUE;
+ security->priv->passwd = g_strdup (passwd);
+ }
+
security->priv->passwd = g_strdup (passwd);
security->priv->anon_identity = g_strdup (anon_identity);
security->priv->private_key_file = g_strdup (private_key_file);
@@ -102,7 +112,6 @@ nm_gconf_wso_wpa_eap_new_deserialize_gco
{
NMGConfWSOWPA_EAP * security = NULL;
char * identity = NULL;
- char * passwd = NULL;
char * anon_identity = NULL;
char * private_key_file = NULL;
char * client_cert_file = NULL;
@@ -112,6 +121,8 @@ nm_gconf_wso_wpa_eap_new_deserialize_gco
int key_type = 0;
int phase2_type = 0;
int key_mgmt = 0;
+ gboolean have_passwd = FALSE;
+ gboolean have_private_key_passwd = FALSE;
g_return_val_if_fail (client != NULL, NULL);
g_return_val_if_fail (network != NULL, NULL);
@@ -155,12 +166,6 @@ nm_gconf_wso_wpa_eap_new_deserialize_gco
nm_gconf_get_string_helper (client,
GCONF_PATH_WIRELESS_NETWORKS,
- WPA_EAP_PREFIX"passwd",
- network,
- &passwd);
-
- nm_gconf_get_string_helper (client,
- GCONF_PATH_WIRELESS_NETWORKS,
WPA_EAP_PREFIX"anon_identity",
network,
&anon_identity);
@@ -183,6 +188,18 @@ nm_gconf_wso_wpa_eap_new_deserialize_gco
network,
&ca_cert_file);
+ nm_gconf_get_bool_helper (client,
+ GCONF_PATH_WIRELESS_NETWORKS,
+ WPA_EAP_PREFIX"passwd",
+ network,
+ &have_passwd);
+
+ nm_gconf_get_bool_helper (client,
+ GCONF_PATH_WIRELESS_NETWORKS,
+ WPA_EAP_PREFIX"private_key_passwd",
+ network,
+ &have_private_key_passwd);
+
/* Success, build up our security object */
security = g_object_new (NM_TYPE_GCONF_WSO_WPA_EAP, NULL);
nm_gconf_wso_set_we_cipher (NM_GCONF_WSO (security), we_cipher);
@@ -192,14 +209,14 @@ nm_gconf_wso_wpa_eap_new_deserialize_gco
security->priv->phase2_type = phase2_type;
security->priv->key_mgmt = IW_AUTH_KEY_MGMT_802_1X;
security->priv->identity = g_strdup (identity);
- security->priv->passwd = g_strdup (passwd);
security->priv->anon_identity = g_strdup (anon_identity);
security->priv->private_key_file = g_strdup (private_key_file);
security->priv->client_cert_file = g_strdup (client_cert_file);
security->priv->ca_cert_file = g_strdup (ca_cert_file);
+ security->priv->have_passwd = have_passwd;
+ security->priv->have_private_key_passwd = have_private_key_passwd;
g_free (identity);
- g_free (passwd);
g_free (anon_identity);
g_free (private_key_file);
g_free (client_cert_file);
@@ -262,13 +279,6 @@ real_serialize_gconf (NMGConfWSO *instan
g_free (key);
}
- if (self->priv->passwd && strlen (self->priv->passwd) > 0)
- {
- key = g_strdup_printf ("%s/%s/%spasswd", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX);
- gconf_client_set_string (client, key, self->priv->passwd, NULL);
- g_free (key);
- }
-
if (self->priv->anon_identity && strlen (self->priv->anon_identity) > 0)
{
key = g_strdup_printf ("%s/%s/%sanon_identity", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX);
@@ -297,6 +307,18 @@ real_serialize_gconf (NMGConfWSO *instan
g_free (key);
}
+ /* Only update these if we have any security information. NM happens to send blank
+ security every now and then */
+ if (self->priv->passwd || nm_gconf_wso_get_key (instance)) {
+ key = g_strdup_printf ("%s/%s/%spasswd", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX);
+ gconf_client_set_bool (client, key, self->priv->have_passwd, NULL);
+ g_free (key);
+
+ key = g_strdup_printf ("%s/%s/%sprivate_key_passwd", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX);
+ gconf_client_set_bool (client, key, self->priv->have_private_key_passwd, NULL);
+ g_free (key);
+ }
+
return TRUE;
}
@@ -423,3 +445,42 @@ nm_gconf_wpa_eap_populate_dialog (NMGCon
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), wso->priv->private_key_file);
}
}
+
+void
+nm_gconf_wso_wpa_eap_set_password (NMGConfWSOWPA_EAP *wso, const char *passwd, int passwd_len)
+{
+ g_return_if_fail (NM_IS_GCONF_WSO_WPA_EAP (wso));
+ g_return_if_fail (passwd != NULL);
+ g_return_if_fail (passwd_len > 0);
+
+ if (wso->priv->passwd)
+ g_free (wso->priv->passwd);
+
+ wso->priv->passwd = g_malloc0 (passwd_len + 1);
+ memcpy (wso->priv->passwd, passwd, passwd_len);
+ wso->priv->have_passwd = TRUE;
+}
+
+const char *
+nm_gconf_wso_wpa_eap_get_password (NMGConfWSOWPA_EAP *wso)
+{
+ g_return_val_if_fail (NM_IS_GCONF_WSO_WPA_EAP (wso), NULL);
+
+ return wso->priv->passwd;
+}
+
+gboolean
+nm_gconf_wso_wpa_eap_have_private_key_passwd (NMGConfWSOWPA_EAP *wso)
+{
+ g_return_val_if_fail (NM_IS_GCONF_WSO_WPA_EAP (wso), FALSE);
+
+ return wso->priv->have_private_key_passwd;
+}
+
+gboolean
+nm_gconf_wso_wpa_eap_have_passwd (NMGConfWSOWPA_EAP *wso)
+{
+ g_return_val_if_fail (NM_IS_GCONF_WSO_WPA_EAP (wso), FALSE);
+
+ return wso->priv->have_passwd;
+}
Index: nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h
===================================================================
--- nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h.orig
+++ nm-applet-0.6.5/src/nm-gconf-wso-wpa-eap.h
@@ -61,5 +61,9 @@ NMGConfWSOWPA_EAP * nm_gconf_wso_wpa_eap
/* Ugh. Please avert your eyes. */
void nm_gconf_wpa_eap_populate_dialog (NMGConfWSOWPA_EAP *wso, GladeXML *xml);
+void nm_gconf_wso_wpa_eap_set_password (NMGConfWSOWPA_EAP *wso, const char *passwd, int passwd_len);
+const char *nm_gconf_wso_wpa_eap_get_password (NMGConfWSOWPA_EAP *wso);
+gboolean nm_gconf_wso_wpa_eap_have_private_key_passwd (NMGConfWSOWPA_EAP *wso);
+gboolean nm_gconf_wso_wpa_eap_have_passwd (NMGConfWSOWPA_EAP *wso);
#endif /* NM_GCONF_WSO_WPA_EAP_H */
+74 -10
View File
@@ -1,6 +1,34 @@
--- src/nm-device-802-11-wireless.c.old 2006-11-10 12:28:06.000000000 +0200
+++ src/nm-device-802-11-wireless.c 2006-11-10 12:28:40.000000000 +0200
@@ -354,23 +354,15 @@
Index: NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
===================================================================
--- NetworkManager-0.6.5.orig/src/nm-device-802-11-wireless.c
+++ NetworkManager-0.6.5/src/nm-device-802-11-wireless.c
@@ -116,9 +116,10 @@ static gboolean process_scan_results (NM
guint32 res_buf_len);
static void schedule_scan (NMDevice80211Wireless *self);
-static int wireless_qual_to_percent (const struct iw_quality *qual,
- const struct iw_quality *max_qual,
- const struct iw_quality *avg_qual);
+static int wireless_qual_to_percent (NMDevice *dev,
+ const struct iw_quality *qual,
+ const struct iw_quality *max_qual,
+ const struct iw_quality *avg_qual);
static gboolean is_associated (NMDevice80211Wireless *self);
@@ -190,8 +191,9 @@ nm_device_802_11_wireless_update_signal_
#endif
if (iw_get_stats (nm_dev_sock_get_fd (sk), iface, &stats, &range, has_range) == 0)
{
- percent = wireless_qual_to_percent (&stats.qual, (const iwqual *)(&self->priv->max_qual),
- (const iwqual *)(&self->priv->avg_qual));
+ percent = wireless_qual_to_percent (NM_DEVICE (self), &stats.qual,
+ (const iwqual *)(&self->priv->max_qual),
+ (const iwqual *)(&self->priv->avg_qual));
}
nm_dev_sock_close (sk);
}
@@ -350,23 +352,15 @@ get_wireless_capabilities (NMDevice80211
if ((data_len >= minlen) && range->we_version_compiled >= 18)
{
@@ -33,7 +61,35 @@
}
return caps;
@@ -2695,13 +2687,11 @@
@@ -1234,7 +1228,8 @@ nm_device_802_11_wireless_get_signal_str
*
*/
static int
-wireless_qual_to_percent (const struct iw_quality *qual,
+wireless_qual_to_percent (NMDevice *dev,
+ const struct iw_quality *qual,
const struct iw_quality *max_qual,
const struct iw_quality *avg_qual)
{
@@ -1263,7 +1258,7 @@ max_qual->updated);
* are free to use whatever they want to calculate "Link Quality".
*/
if ((max_qual->qual != 0) && !(max_qual->updated & IW_QUAL_QUAL_INVALID) && !(qual->updated & IW_QUAL_QUAL_INVALID))
- percent = (int)(100 * ((double)qual->qual / (double)max_qual->qual));
+ percent = (int) (100 * ((double) qual->qual / (double) max_qual->qual));
/* If the driver doesn't specify a complete and valid quality, we have two options:
*
@@ -1329,7 +1324,7 @@ max_qual->updated);
}
/* If the quality percent was 0 or doesn't exist, then try to use signal levels instead */
- if ((percent < 1) && (level_percent >= 0))
+ if ((percent < 1 || !strcmp (nm_device_get_driver (dev), "ath_pci")) && (level_percent >= 0))
percent = level_percent;
#ifdef IW_QUAL_DEBUG
@@ -2636,13 +2631,11 @@ supplicant_status_cb (GIOChannel *source
}
@@ -48,7 +104,7 @@
return NM_SUPPLICANT_TIMEOUT;
}
@@ -2910,6 +2900,8 @@
@@ -2762,6 +2755,8 @@ supplicant_interface_init (NMDevice80211
struct wpa_ctrl * ctrl = NULL;
char * socket_path;
const char * iface = nm_device_get_iface (NM_DEVICE (self));
@@ -57,7 +113,7 @@
gboolean success = FALSE;
int tries = 0;
@@ -2926,9 +2918,21 @@
@@ -2778,9 +2773,19 @@ supplicant_interface_init (NMDevice80211
goto exit;
}
@@ -68,8 +124,6 @@
+ kernel_driver = nm_device_get_driver (NM_DEVICE (self));
+ if (!strcmp (kernel_driver, "ath_pci"))
+ wpa_driver = "madwifi";
+ else if (!strcmp (kernel_driver, "prism54"))
+ wpa_driver = "prism54";
+ else
+ wpa_driver = "wext";
+
@@ -80,7 +134,7 @@
goto exit;
wpa_ctrl_close (ctrl);
@@ -2964,7 +2968,8 @@
@@ -2816,7 +2821,8 @@ supplicant_send_network_config (NMDevice
struct wpa_ctrl * ctrl;
gboolean is_adhoc;
char * hex_essid = NULL;
@@ -90,7 +144,7 @@
guint32 caps;
gboolean supports_wpa;
@@ -2986,12 +2991,39 @@
@@ -2838,12 +2844,39 @@ supplicant_send_network_config (NMDevice
|| (caps & NM_802_11_CAP_PROTO_WPA2);
/* Use "AP_SCAN 2" if:
@@ -131,3 +185,13 @@
/* Tell wpa_supplicant that we'll do the scanning */
if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL, ap_scan))
@@ -3522,7 +3555,8 @@ process_scan_results (NMDevice80211Wirel
nm_ap_set_freq (ap, iw_freq2float(&(iwe->u.freq)));
break;
case IWEVQUAL:
- nm_ap_set_strength (ap, wireless_qual_to_percent (&(iwe->u.qual),
+ nm_ap_set_strength (ap, wireless_qual_to_percent (&dev->parent,
+ &(iwe->u.qual),
(const iwqual *)(&dev->priv->max_qual),
(const iwqual *)(&dev->priv->avg_qual)));
break;