commit NetworkManager-novellvpn for openSUSE:Factory
Hello community, here is the log from the commit of package NetworkManager-novellvpn for openSUSE:Factory checked in at Wed Feb 4 00:08:11 CET 2009. -------- --- NetworkManager-novellvpn/NetworkManager-novellvpn.changes 2009-01-24 16:49:44.000000000 +0100 +++ NetworkManager-novellvpn/NetworkManager-novellvpn.changes 2009-02-03 09:11:28.561435000 +0100 @@ -1,0 +2,5 @@ +Tue Feb 3 09:15:44 CET 2009 - bili@suse.de + +- Add no-split-tunnel feature (bnc#456088). + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- NetworkManager-novellvpn-0.7.2.r1067.tar.bz2 New: ---- NetworkManager-novellvpn-0.7.2.r1121.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ NetworkManager-novellvpn.spec ++++++ --- /var/tmp/diff_new_pack.n15649/_old 2009-02-04 00:06:49.000000000 +0100 +++ /var/tmp/diff_new_pack.n15649/_new 2009-02-04 00:06:49.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package NetworkManager-novellvpn (Version 0.7.2.r1067) +# spec file for package NetworkManager-novellvpn (Version 0.7.2.r1121) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -21,8 +21,8 @@ Name: NetworkManager-novellvpn BuildRequires: NetworkManager-devel NetworkManager-gnome intltool libglade2-devel libgnomeui-devel libnl-devel perl-XML-Parser update-desktop-files Summary: VPN support for Turnpike -Version: 0.7.2.r1067 -Release: 7 +Version: 0.7.2.r1121 +Release: 1 License: GPL v2 or later Group: Productivity/Networking/System Url: http://www.gnome.org/projects/NetworkManager @@ -33,9 +33,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: NetworkManager >= 0.7.0.r4274 Requires: %{name}-frontend -Requires: novell-ipsec-tools >= 0.6.3 -Requires: novell-nortelplugins >= 0.1 -Requires: turnpike >= 0.1.0 +Requires: novell-ipsec-tools >= 0.7 +Requires: novell-nortelplugins >= 0.1.4 +Requires: turnpike >= 0.1.2 %description NetworkManager-novellvpn provides VPN support to NetworkManager for @@ -82,6 +82,7 @@ %patch0 -p1 %build +autoreconf -f -i CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ %configure --disable-static --with-pic \ --datadir=%{_datadir}/%{name} @@ -131,6 +132,8 @@ %{_datadir}/icons/hicolor/48x48/apps/gnome-mime-application-x-novellvpn-settings.png %changelog +* Tue Feb 03 2009 bili@suse.de +- Add no-split-tunnel feature (bnc#456088). * Sat Jan 24 2009 bili@suse.de - D-bus policy checking (bnc#468380). * Fri Jan 09 2009 mauro@suse.de ++++++ NetworkManager-novellvpn-0.7.2.r1067.tar.bz2 -> NetworkManager-novellvpn-0.7.2.r1121.tar.bz2 ++++++ ++++ 65014 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/auth-dialog/gnome-two-password-dialog.c new/NetworkManager-novellvpn-0.7.2/auth-dialog/gnome-two-password-dialog.c --- old/NetworkManager-novellvpn-0.7.2/auth-dialog/gnome-two-password-dialog.c 2008-09-24 16:25:42.000000000 +0200 +++ new/NetworkManager-novellvpn-0.7.2/auth-dialog/gnome-two-password-dialog.c 2009-01-08 10:38:31.000000000 +0100 @@ -164,8 +164,6 @@ dialog_show_callback (GtkWidget *widget, gpointer callback_data) { GnomeTwoPasswordDialog *password_dialog; - char *grppassword = NULL; - int return_value_of_std_check = 0; password_dialog = GNOME_TWO_PASSWORD_DIALOG (callback_data); if (GTK_WIDGET_VISIBLE (password_dialog->details->username_entry) && diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/auth-dialog/gnome-two-password-dialog.h new/NetworkManager-novellvpn-0.7.2/auth-dialog/gnome-two-password-dialog.h --- old/NetworkManager-novellvpn-0.7.2/auth-dialog/gnome-two-password-dialog.h 2008-09-23 18:01:10.000000000 +0200 +++ new/NetworkManager-novellvpn-0.7.2/auth-dialog/gnome-two-password-dialog.h 2009-01-08 10:42:24.000000000 +0100 @@ -92,10 +92,15 @@ void gnome_two_password_dialog_set_readonly_domain (GnomeTwoPasswordDialog *password_dialog, gboolean readonly); -void gnome_two_password_dialog_set_password_primary_label (GnomeTwoPasswordDialog *password_dialog, - const char *password_primary_description); -void gnome_two_password_dialog_set_password_secondary_label (GnomeTwoPasswordDialog *password_dialog, - const char *password_secondary_description); +void gnome_two_password_dialog_set_password_primary_label ( + GnomeTwoPasswordDialog *password_dialog, + const char *password_primary_description); +void gnome_two_password_dialog_set_password_secondary_label ( + GnomeTwoPasswordDialog *password_dialog, + const char *password_secondary_description); +void gnome_two_password_dialog_set_password_secondary_editable ( + GnomeTwoPasswordDialog *password_dialog, + gboolean editable); void gnome_two_password_dialog_set_show_remember (GnomeTwoPasswordDialog *password_dialog, gboolean show_remember); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/auth-dialog/main.c new/NetworkManager-novellvpn-0.7.2/auth-dialog/main.c --- old/NetworkManager-novellvpn-0.7.2/auth-dialog/main.c 2008-11-10 09:03:10.000000000 +0100 +++ new/NetworkManager-novellvpn-0.7.2/auth-dialog/main.c 2009-01-08 10:39:58.000000000 +0100 @@ -85,7 +85,6 @@ GtkWidget *dialog = NULL; gboolean is_session = FALSE; gboolean result = FALSE; - GnomeTwoPasswordDialogRemember remember = GNOME_TWO_PASSWORD_DIALOG_REMEMBER_NOTHING; gboolean need_secret = FALSE; g_return_val_if_fail (info != NULL, FALSE); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/auth-dialog/profile.h new/NetworkManager-novellvpn-0.7.2/auth-dialog/profile.h --- old/NetworkManager-novellvpn-0.7.2/auth-dialog/profile.h 2008-09-25 08:18:31.000000000 +0200 +++ new/NetworkManager-novellvpn-0.7.2/auth-dialog/profile.h 2009-01-08 10:43:35.000000000 +0100 @@ -35,6 +35,6 @@ #ifndef _PROFILE_H_ #define _PROFILE_H_ -char *check_for_group_password_in_profile(); +char *check_for_group_password_in_profile(char *vpn_uuid); #endif // _PROFILE_H_ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/ChangeLog new/NetworkManager-novellvpn-0.7.2/ChangeLog --- old/NetworkManager-novellvpn-0.7.2/ChangeLog 2008-11-10 09:46:41.000000000 +0100 +++ new/NetworkManager-novellvpn-0.7.2/ChangeLog 2009-01-22 06:32:28.000000000 +0100 @@ -1,3 +1,25 @@ +2009-01-22 Bin Li <bili@novell.com> + * src/nm-novellvpn-service.h: + * src/nm-novellvpn-service.c: + * properties/nm-novellvpn.c: + * properties/nm-novellvpn-dialog.glade: + Support the "Disable split tunnel" features. +2009-01-09 Bin Li <bili@novell.com> + * src/nm-novellvpn-service-novellvpn-helper.c: + Dismiss compile warning and delete unused functions. + * src/Makefile.am: + * src/nm-utils.c: + * src/nm-utils.h: + Delete the nm-utils related file, use NM's library. +2009-01-08 Bin Li <bili@novell.com> + * auth-dialog/gnome-two-password-dialog.c: + * auth-dialog/gnome-two-password-dialog.h: + * auth-dialog/main.c: + * properties/nm-novellvpn.c: + * src/nm-novellvpn-service.c: + Dismiss unused variable. + * auth-dialog/profile.h: + Change prototype declare. 2008-11-10 Bin Li <bili@novell.com> * src/nm-novellvpn-service.c: * auth-dialog/main.c: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/config.h.in new/NetworkManager-novellvpn-0.7.2/config.h.in --- old/NetworkManager-novellvpn-0.7.2/config.h.in 2008-09-26 05:13:21.000000000 +0200 +++ new/NetworkManager-novellvpn-0.7.2/config.h.in 2009-01-09 07:56:20.000000000 +0100 @@ -75,6 +75,10 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/po/Makefile.in.in new/NetworkManager-novellvpn-0.7.2/po/Makefile.in.in --- old/NetworkManager-novellvpn-0.7.2/po/Makefile.in.in 2008-09-26 05:13:17.000000000 +0200 +++ new/NetworkManager-novellvpn-0.7.2/po/Makefile.in.in 2009-01-09 07:56:11.000000000 +0100 @@ -54,16 +54,16 @@ ALL_LINGUAS = @ALL_LINGUAS@ -PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) +PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) -USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) +USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi) -USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) +USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) -POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) +POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) -DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES) -EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS +DISTFILES = Makefile.in.in POTFILES.in $(POFILES) +EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out @@ -101,7 +101,6 @@ install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all - $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/properties/nm-novellvpn.c new/NetworkManager-novellvpn-0.7.2/properties/nm-novellvpn.c --- old/NetworkManager-novellvpn-0.7.2/properties/nm-novellvpn.c 2008-10-30 10:49:44.000000000 +0100 +++ new/NetworkManager-novellvpn-0.7.2/properties/nm-novellvpn.c 2009-01-22 06:30:46.000000000 +0100 @@ -212,8 +212,6 @@ NovellvpnPluginUiWidgetPrivate *priv = NOVELLVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self); GtkWidget *widget = NULL; const char *str = NULL; - GtkTreeModel *model = NULL; - GtkTreeIter iter; const char *auth_type = NULL; nm_debug ("Enter check_validity..."); @@ -727,9 +725,24 @@ widget = glade_xml_get_widget (priv->xml, "show_passwords_checkbutton"); g_return_val_if_fail (widget != NULL, FALSE); g_signal_connect (G_OBJECT (widget), "toggled", - (GCallback) show_toggled_cb, + G_CALLBACK (show_toggled_cb), self); + widget = glade_xml_get_widget (priv->xml, "no_split_tunnel_checkbutton"); + g_return_val_if_fail (widget != NULL, FALSE); + if (s_vpn) { + // set nosplittunnel + value = nm_setting_vpn_get_data_item (s_vpn, NM_NOVELLVPN_KEY_NOSPLITTUNNEL); // "nosplittunnel" + if (value && strlen (value) && !strcmp (value, "yes")) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); + } else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE); + } + } + g_signal_connect (G_OBJECT (widget), "toggled", + G_CALLBACK (stuff_changed_cb), + self); + return TRUE; } @@ -844,13 +857,12 @@ NMSettingVPN *s_vpn = NULL; GtkWidget *widget = NULL; char *str = NULL; - GtkTreeModel *model = NULL; - GtkTreeIter iter; gboolean valid = FALSE; const char *auth_type = NULL; int dhgroup = DHGROUP_INVALID; int pfsgroup = PFSGROUP_INVALID; int gateway_type = NM_NOVELLVPN_GWTYPE_INVALID; + gboolean nosplittunnel = FALSE; nm_debug ("Enter update_connection..."); @@ -929,10 +941,23 @@ } } + widget = glade_xml_get_widget (priv->xml, "no_split_tunnel_checkbutton"); + if (widget != NULL) { + nosplittunnel = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + if (nosplittunnel) { + nm_setting_vpn_add_data_item (s_vpn, + NM_NOVELLVPN_KEY_NOSPLITTUNNEL, + "yes"); + } else { + nm_setting_vpn_add_data_item (s_vpn, + NM_NOVELLVPN_KEY_NOSPLITTUNNEL, + "no"); + } + } + nm_connection_add_setting (connection, NM_SETTING (s_vpn)); valid = TRUE; -done: return valid; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/properties/nm-novellvpn-dialog.glade new/NetworkManager-novellvpn-0.7.2/properties/nm-novellvpn-dialog.glade --- old/NetworkManager-novellvpn-0.7.2/properties/nm-novellvpn-dialog.glade 2008-09-25 07:48:44.000000000 +0200 +++ new/NetworkManager-novellvpn-0.7.2/properties/nm-novellvpn-dialog.glade 2009-01-19 09:37:34.000000000 +0100 @@ -1,7 +1,6 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> -<!--*- mode: xml -*--> +<?xml version="1.0"?> <glade-interface> + <requires-version lib="gtk+" version="2.12"/> <widget class="GtkWindow" id="novellvpn-widget"> <property name="title" translatable="yes">window1</property> <child> @@ -36,53 +35,53 @@ <property name="column_spacing">6</property> <property name="row_spacing">2</property> <child> - <widget class="GtkEntry" id="gateway_entry"> + <widget class="GtkComboBox" id="gateway_type_combo"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="items" translatable="yes">Nortel +Standard Gateway</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <widget class="GtkLabel" id="label23"> + <widget class="GtkLabel" id="label20"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">_Gateway:</property> + <property name="label" translatable="yes">Gate_way Type:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">gateway_entry</property> + <property name="mnemonic_widget">gateway_type_combo</property> </widget> <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label20"> + <widget class="GtkLabel" id="label23"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Gate_way Type:</property> + <property name="label" translatable="yes">_Gateway:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">gateway_type_combo</property> + <property name="mnemonic_widget">gateway_entry</property> </widget> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkComboBox" id="gateway_type_combo"> + <widget class="GtkEntry" id="gateway_entry"> <property name="visible">True</property> - <property name="items" translatable="yes">Nortel -Standard Gateway</property> + <property name="can_focus">True</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> </packing> </child> </widget> @@ -124,30 +123,14 @@ <property name="column_spacing">3</property> <property name="row_spacing">2</property> <child> - <widget class="GtkCheckButton" id="show_passwords_checkbutton"> + <widget class="GtkLabel" id="label26"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Show passwords</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Type:</property> <property name="use_underline">True</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - </packing> - </child> - <child> - <widget class="GtkComboBox" id="authtype_combo"> - <property name="visible">True</property> - <property name="items" translatable="yes">XAUTH -X.509 Certificate</property> + <property name="mnemonic_widget">authtype_combo</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> @@ -164,103 +147,103 @@ <property name="column_spacing">6</property> <property name="row_spacing">2</property> <child> - <widget class="GtkEntry" id="groupname_entry"> + <widget class="GtkEntry" id="grouppassword_entry"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="visibility">False</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> </packing> </child> <child> - <widget class="GtkEntry" id="username_entry"> + <widget class="GtkEntry" id="userpassword_entry"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="visibility">False</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> </packing> </child> <child> - <widget class="GtkLabel" id="label3"> + <widget class="GtkLabel" id="label4"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">_User Name:</property> + <property name="label" translatable="yes">G_roup Password:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">username_entry</property> + <property name="mnemonic_widget">grouppassword_entry</property> </widget> <packing> - <property name="y_options"></property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> </packing> </child> <child> - <widget class="GtkLabel" id="label2"> + <widget class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">_Group Name:</property> + <property name="label" translatable="yes">U_ser Password:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">groupname_entry</property> + <property name="mnemonic_widget">userpassword_entry</property> </widget> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> </packing> </child> <child> - <widget class="GtkLabel" id="label1"> + <widget class="GtkLabel" id="label2"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">U_ser Password:</property> + <property name="label" translatable="yes">_Group Name:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">userpassword_entry</property> + <property name="mnemonic_widget">groupname_entry</property> </widget> <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label4"> + <widget class="GtkLabel" id="label3"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">G_roup Password:</property> + <property name="label" translatable="yes">_User Name:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">grouppassword_entry</property> + <property name="mnemonic_widget">username_entry</property> </widget> <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkEntry" id="userpassword_entry"> + <widget class="GtkEntry" id="username_entry"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="visibility">False</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> </packing> </child> <child> - <widget class="GtkEntry" id="grouppassword_entry"> + <widget class="GtkEntry" id="groupname_entry"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="visibility">False</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> </packing> </child> </widget> @@ -271,8 +254,8 @@ <property name="label" translatable="yes">XAUTH</property> </widget> <packing> - <property name="type">tab</property> <property name="tab_fill">False</property> + <property name="type">tab</property> </packing> </child> <child> @@ -283,32 +266,12 @@ <property name="column_spacing">3</property> <property name="row_spacing">2</property> <child> - <widget class="GtkEntry" id="certpassword_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="visibility">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label9"> + <widget class="GtkLabel" id="label7"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">_Certificate password:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">certpassword_entry</property> + <property name="label" translatable="yes">Certificate file:</property> </widget> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> @@ -330,12 +293,32 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label7"> + <widget class="GtkLabel" id="label9"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Certificate file:</property> + <property name="label" translatable="yes">_Certificate password:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">certpassword_entry</property> </widget> <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="certpassword_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="visibility">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> @@ -351,9 +334,9 @@ <property name="label" translatable="yes">X.509</property> </widget> <packing> - <property name="type">tab</property> <property name="position">1</property> <property name="tab_fill">False</property> + <property name="type">tab</property> </packing> </child> </widget> @@ -364,17 +347,33 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label26"> + <widget class="GtkComboBox" id="authtype_combo"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">_Type:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">authtype_combo</property> + <property name="items" translatable="yes">XAUTH +X.509 Certificate</property> </widget> <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> + <child> + <widget class="GtkCheckButton" id="show_passwords_checkbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Show passwords</property> + <property name="use_underline">True</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + </packing> + </child> </widget> </child> </widget> @@ -414,36 +413,33 @@ <child> <widget class="GtkTable" id="table6"> <property name="visible">True</property> - <property name="n_rows">2</property> + <property name="n_rows">3</property> <property name="n_columns">2</property> <property name="column_spacing">6</property> <property name="row_spacing">2</property> <child> - <widget class="GtkComboBox" id="pfsgroup_combo"> + <widget class="GtkCheckButton" id="no_split_tunnel_checkbutton"> <property name="visible">True</property> - <property name="items" translatable="yes">Off -768 bits (PFS 1) -1024 bits (PFS 2)</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Disable split tunnel</property> + <property name="response_id">0</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">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> </packing> </child> <child> - <widget class="GtkComboBox" id="dhgroup_combo"> + <widget class="GtkLabel" id="label5"> <property name="visible">True</property> - <property name="items" translatable="yes">768 bits (DH1) -1024 bits (DH2)</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_DH Group:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">dhgroup_combo</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> @@ -462,14 +458,31 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label5"> + <widget class="GtkComboBox" id="dhgroup_combo"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">_DH Group:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">dhgroup_combo</property> + <property name="items" translatable="yes">768 bits (DH1) +1024 bits (DH2)</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkComboBox" id="pfsgroup_combo"> + <property name="visible">True</property> + <property name="items" translatable="yes">Off +768 bits (PFS 1) +1024 bits (PFS 2)</property> </widget> <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/src/Makefile.am new/NetworkManager-novellvpn-0.7.2/src/Makefile.am --- old/NetworkManager-novellvpn-0.7.2/src/Makefile.am 2008-07-31 09:40:09.000000000 +0200 +++ new/NetworkManager-novellvpn-0.7.2/src/Makefile.am 2009-01-09 07:54:37.000000000 +0100 @@ -21,9 +21,7 @@ nm_novellvpn_service_SOURCES = \ nm-novellvpn-service.c \ - nm-novellvpn-service.h \ - nm-utils.c \ - nm-utils.h + nm-novellvpn-service.h nm_novellvpn_service_LDADD = \ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service.c new/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service.c --- old/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service.c 2008-11-10 08:46:27.000000000 +0100 +++ new/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service.c 2009-01-22 06:29:01.000000000 +0100 @@ -109,6 +109,7 @@ { NM_NOVELLVPN_KEY_DHGROUP, G_TYPE_INT }, { NM_NOVELLVPN_KEY_PFSGROUP, G_TYPE_INT }, { NM_NOVELLVPN_KEY_NAME, G_TYPE_STRING }, + { NM_NOVELLVPN_KEY_NOSPLITTUNNEL, G_TYPE_BOOLEAN }, { NULL, G_TYPE_NONE } }; @@ -299,7 +300,6 @@ get_connection_type (NMSettingVPN *s_vpn) { const char* ctype = NULL; - const gchar *tmp = NULL; ctype = nm_setting_vpn_get_data_item (s_vpn, NM_NOVELLVPN_KEY_AUTHTYPE); if (NULL != ctype) { @@ -342,7 +342,6 @@ static void free_novellvpn_args (GPtrArray *args) { - g_ptr_array_foreach (args, (GFunc) g_free, NULL); g_ptr_array_free (args, TRUE); } @@ -444,13 +443,6 @@ } -static GPtrArray * -construct_novellvpn_args (NMNovellvpnPlugin *plugin, - NMSettingVPN *s_vpn, - const char *pppd, - GError **error) -{ -} /* * Function: nm_novellvpn_start_vpn_binary @@ -489,6 +481,7 @@ const char *dh_group = dh_group_arg [1]; const char *pfs_group = pfs_group_arg [0]; const char *tmp = NULL; + gboolean no_split_tunnel = FALSE; g_return_val_if_fail (plugin != NULL, -1); @@ -615,6 +608,18 @@ } } + tmp = nm_setting_vpn_get_data_item (s_vpn, NM_NOVELLVPN_KEY_NOSPLITTUNNEL); + if (!tmp || !strlen (tmp)) { + nm_vpn_set_missing_arg_error (error, NM_NOVELLVPN_KEY_NOSPLITTUNNEL); + } else { + nm_debug("%s = %s!", NM_NOVELLVPN_KEY_NOSPLITTUNNEL, tmp); + if (!strcmp (tmp, "yes")) { + no_split_tunnel = TRUE; + } else { + no_split_tunnel = FALSE; + } + } + if ( priv->connection_type != NM_NOVELLVPN_CONTYPE_INVALID ) { novellvpn_argv = g_ptr_array_new (); @@ -642,6 +647,9 @@ g_ptr_array_add (novellvpn_argv, (gpointer) "-s"); g_ptr_array_add (novellvpn_argv, (gpointer) pfs_group); + // disable the split tunnel + if (no_split_tunnel) + g_ptr_array_add (novellvpn_argv, (gpointer) "-t"); //g_ptr_array_add (novellvpn_argv, (gpointer) "-r"); /* FIXME: @@ -679,14 +687,14 @@ &stderr_fd, /* standard_error */ error)) { - g_ptr_array_free (novellvpn_argv, TRUE); + free_novellvpn_args (novellvpn_argv); nm_warning ("novellvpn failed to start failed! '%s'", (*error)->message); return FALSE; } - g_ptr_array_free (novellvpn_argv, TRUE); + free_novellvpn_args (novellvpn_argv); nm_info ("novellvpn started with pid %d", pid); @@ -885,6 +893,17 @@ } nm_debug ("property '%s' wrong value, %s", prop.name, strerror (errno)); break; + case G_TYPE_BOOLEAN: + if (!strcmp (val, "yes") || !strcmp (val, "no")) + return; /* valid */ + + g_set_error (info->error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS, + "invalid boolean property '%s' (not yes or no)", + key); + break; + default: g_set_error (info->error, NM_VPN_PLUGIN_ERROR, diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service.h new/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service.h --- old/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service.h 2008-09-24 10:12:37.000000000 +0200 +++ new/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service.h 2009-01-19 09:40:51.000000000 +0100 @@ -59,6 +59,7 @@ #define NM_NOVELLVPN_KEY_DHGROUP "dhgroup" #define NM_NOVELLVPN_KEY_PFSGROUP "pfsgroup" #define NM_NOVELLVPN_KEY_CERTIFICATE "certificate" +#define NM_NOVELLVPN_KEY_NOSPLITTUNNEL "nosplittunnel" #define NM_NOVELLVPN_KEY_HOW_MANY_PWD "how_many_passwords" #define NM_NOVELLVPN_KEY_USER_PWD "unenc-user-password" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service-novellvpn-helper.c new/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service-novellvpn-helper.c --- old/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service-novellvpn-helper.c 2008-11-07 15:29:39.000000000 +0100 +++ new/NetworkManager-novellvpn-0.7.2/src/nm-novellvpn-service-novellvpn-helper.c 2009-01-09 08:08:09.000000000 +0100 @@ -44,9 +44,9 @@ #include <dbus/dbus-glib-lowlevel.h> #include <dbus/dbus-glib.h> #include <NetworkManager.h> +#include <nm-utils.h> #include "nm-novellvpn-service.h" -#include "nm-utils.h" /* These are here because nm-dbus-glib-types.h isn't exported */ #define DBUS_TYPE_G_ARRAY_OF_UINT (dbus_g_type_get_collection ("GArray", G_TYPE_UINT)) @@ -83,178 +83,6 @@ exit (1); } -/* - * send_config_error - * - * Notify nm-novellvpn-service of a config error from 'novellvpn'. - * - */ -static void send_config_error (DBusConnection *con, const char *item) -{ - DBusMessage *message; - - g_return_if_fail (con != NULL); - g_return_if_fail (item != NULL); - - if (!(message = dbus_message_new_method_call (NM_DBUS_SERVICE_NOVELLVPN, NM_DBUS_PATH_NOVELLVPN, NM_DBUS_INTERFACE_NOVELLVPN, "signalConfigError"))) - { - nm_warning ("send_config_error(): Couldn't allocate the dbus message"); - return; - } - - dbus_message_append_args (message, DBUS_TYPE_STRING, &item, DBUS_TYPE_INVALID); - if (!dbus_connection_send (con, message, NULL)) - nm_warning ("send_config_error(): could not send dbus message"); - - dbus_message_unref (message); -} - - -/* - * gpa_to_uint32arr - * - * Convert GPtrArray of uint32 to a uint32* array - * - */ -static void -gpa_to_uint32arr (const GPtrArray *gpa, - guint32 **uia, - guint32 *uia_len) -{ - - guint32 num_valid = 0, i = 0; - struct in_addr temp_addr; - - *uia = NULL; - - if ( gpa->len > 0 ) { - /* Pass over the array first to determine how many valid entries there are */ - num_valid = 0; - for (i = 0; i < gpa->len; ++i) { - if (inet_aton ((char *)gpa->pdata[i], &temp_addr)) { - num_valid++; - } - } - - /* Do the actual string->int conversion and assign to the array. */ - if (num_valid > 0) { - *uia = g_new0 (guint32, num_valid); - for (i = 0; i < gpa->len; ++i) { - if (inet_aton ((char *)gpa->pdata[i], &temp_addr)) { - (*uia)[i] = temp_addr.s_addr; - } - } - } - - *uia_len = num_valid; - } - if (*uia == NULL) { - *uia = g_malloc0 (sizeof (guint32)); - *uia_len = 1; - } -} - -static gboolean -ipstr_to_uint32 (const char *ip_str, guint32 *ip) -{ - struct in_addr temp_addr; - - /* Convert IPv4 address arguments from strings into numbers */ - if (!inet_aton (ip_str, &temp_addr)) - return FALSE; - *ip = temp_addr.s_addr; - return TRUE; -} - - -/* - * send_config_info - * - * Send IP config info to nm-novellvpn-service - * - */ -static gboolean -send_config_info (DBusConnection *con, - const char *str_vpn_gateway, - const char *str_tundev, - const char *str_ip4_address, - const char *str_ip4_ptpaddr, - const char *str_ip4_netmask, - const GPtrArray *gpa_ip4_dns, - const GPtrArray *gpa_ip4_nbns, - const char *domain_names - ) -{ - DBusMessage * message; - guint32 uint_vpn_gateway = 0; - guint32 uint_ip4_address = 0; - guint32 uint_ip4_ptpaddr = 0; - guint32 uint_ip4_netmask = 0xFFFFFFFF; /* Default mask of 255.255.255.255 */ - guint32 * uint_ip4_dns = NULL; - guint32 uint_ip4_dns_len = 0; - guint32 * uint_ip4_nbns = NULL; - guint32 uint_ip4_nbns_len = 0; - guint32 mtu = 0; - gboolean success = FALSE; - - g_return_val_if_fail (con != NULL, FALSE); - - mtu = get_mtu(str_vpn_gateway); - - if (!(message = dbus_message_new_method_call (NM_DBUS_SERVICE_NOVELLVPN, NM_DBUS_PATH_NOVELLVPN, NM_DBUS_INTERFACE_NOVELLVPN, "signalIP4Config"))) - { - nm_warning ("send_config_error(): Couldn't allocate the dbus message"); - return FALSE; - } - - if (! ipstr_to_uint32 (str_vpn_gateway, &uint_vpn_gateway) ) { - nm_warning ("nm-novellvpn-service-novellvpn-helper didn't receive a valid VPN Gateway from novellvpn."); - send_config_error (con, "VPN Gateway"); - goto out; - } - - if (! ipstr_to_uint32 (str_ip4_address, &uint_ip4_address) ) { - nm_warning ("nm-novellvpn-service-novellvpn-helper didn't receive a valid Internal IP4 Address from novellvpn."); - send_config_error (con, "IP4 Address"); - goto out; - } - - if (! ipstr_to_uint32 (str_ip4_ptpaddr, &uint_ip4_ptpaddr) ) { - nm_warning ("nm-novellvpn-service-novellvpn-helper didn't receive a valid PtP IP4 Address from novellvpn."); - send_config_error (con, "IP4 PtP Address"); - goto out; - } - - if (strlen (str_ip4_netmask) > 0) { - ipstr_to_uint32 (str_ip4_netmask, &uint_ip4_netmask); - } - - gpa_to_uint32arr (gpa_ip4_dns, &uint_ip4_dns, &uint_ip4_dns_len); - gpa_to_uint32arr (gpa_ip4_nbns, &uint_ip4_nbns, &uint_ip4_nbns_len); - - dbus_message_append_args (message, DBUS_TYPE_UINT32, &uint_vpn_gateway, - DBUS_TYPE_STRING, &str_tundev, - DBUS_TYPE_UINT32, &uint_ip4_address, - DBUS_TYPE_UINT32, &uint_ip4_ptpaddr, - DBUS_TYPE_UINT32, &uint_ip4_netmask, - DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &uint_ip4_dns, uint_ip4_dns_len, - DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &uint_ip4_nbns, uint_ip4_nbns_len, - DBUS_TYPE_UINT32, &mtu, - DBUS_TYPE_STRING, &domain_names, - DBUS_TYPE_INVALID); - if (dbus_connection_send (con, message, NULL)) - success = TRUE; - else - nm_warning ("send_config_error(): could not send dbus message"); - - dbus_message_unref (message); - - g_free (uint_ip4_dns); - g_free (uint_ip4_nbns); - - out: - return success; -} static GValue * addr_to_gvalue (const char *str) @@ -337,14 +165,11 @@ /* * See the Novellvpn man page for available environment variables. - * - * */ - /** Prints all environment variables to /tmp/environ */ - +#if 0 static void print_env(char **env) { @@ -355,6 +180,7 @@ } fclose(f); } +#endif static void send_ip4_config (DBusGConnection *connection, GHashTable *config) @@ -496,9 +322,9 @@ } val = str_to_gvalue (getenv ("VIRTUALDEV"), FALSE); - if (val) + if (val) { g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV, val); - else + } else helper_failed (connection, "Tunnel Device"); val = addr_to_gvalue (getenv("VPNGATEWAY")); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/src/nm-utils.c new/NetworkManager-novellvpn-0.7.2/src/nm-utils.c --- old/NetworkManager-novellvpn-0.7.2/src/nm-utils.c 2008-04-16 07:57:08.000000000 +0200 +++ new/NetworkManager-novellvpn-0.7.2/src/nm-utils.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,132 +0,0 @@ -/* NetworkManager -- Network link manager - * - * Ray Strode <rstrode@redhat.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * (C) Copyright 2005 Red Hat, Inc. - */ - -#include <string.h> -#include <stdlib.h> -#include <errno.h> - -#include <glib.h> -#include "nm-utils.h" - -gchar *nm_dbus_escape_object_path (const gchar *utf8_string) -{ - const gchar *p; - gchar *object_path; - GString *string; - - g_return_val_if_fail (utf8_string != NULL, NULL); - g_return_val_if_fail (g_utf8_validate (utf8_string, -1, NULL), NULL); - - string = g_string_sized_new ((strlen (utf8_string) + 1) * 6); - - for (p = utf8_string; *p != '\0'; p = g_utf8_next_char (p)) - { - gunichar character; - - character = g_utf8_get_char (p); - - if (((character >= ((gunichar) 'a')) && - (character <= ((gunichar) 'z'))) || - ((character >= ((gunichar) 'A')) && - (character <= ((gunichar) 'Z'))) || - ((character >= ((gunichar) '0')) && - (character <= ((gunichar) '9'))) || - (character == ((gunichar) '/'))) - { - g_string_append_c (string, (gchar) character); - continue; - } - - g_string_append_printf (string, "_%x_", character); - } - - object_path = string->str; - - g_string_free (string, FALSE); - - return object_path; -} - -gchar *nm_dbus_unescape_object_path (const gchar *object_path) -{ - const gchar *p; - gchar *utf8_string; - GString *string; - - g_return_val_if_fail (object_path != NULL, NULL); - - string = g_string_sized_new (strlen (object_path) + 1); - - for (p = object_path; *p != '\0'; p++) - { - const gchar *q; - gchar *hex_digits, *end, utf8_character[6] = { '\0' }; - gint utf8_character_size; - gunichar character; - gulong hex_value; - - if (*p != '_') - { - g_string_append_c (string, *p); - continue; - } - - q = strchr (p + 1, '_'); - - if ((q == NULL) || (q == p + 1)) - { - g_string_free (string, TRUE); - return NULL; - } - - hex_digits = g_strndup (p + 1, (q - 1) - p); - - hex_value = strtoul (hex_digits, &end, 16); - - character = (gunichar) hex_value; - - if (((hex_value == G_MAXLONG) && (errno == ERANGE)) || - (hex_value > G_MAXUINT32) || - (*end != '\0') || - (!g_unichar_validate (character))) - { - g_free (hex_digits); - g_string_free (string, TRUE); - return NULL; - } - - utf8_character_size = - g_unichar_to_utf8 (character, utf8_character); - - g_assert (utf8_character_size > 0); - - g_string_append_len (string, utf8_character, - utf8_character_size); - - p = q; - } - - utf8_string = string->str; - - g_string_free (string, FALSE); - - return utf8_string; -} diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/NetworkManager-novellvpn-0.7.2/src/nm-utils.h new/NetworkManager-novellvpn-0.7.2/src/nm-utils.h --- old/NetworkManager-novellvpn-0.7.2/src/nm-utils.h 2008-04-16 07:57:08.000000000 +0200 +++ new/NetworkManager-novellvpn-0.7.2/src/nm-utils.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,132 +0,0 @@ -/* NetworkManager -- Network link manager - * - * Ray Strode <rstrode@redhat.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * (C) Copyright 2005 Red Hat, Inc. - */ - -#ifndef NM_UTILS_H -#define NM_UTILS_H - -#include <glib.h> -#include <execinfo.h> -#include <glib/gmacros.h> - -#define nm_print_backtrace() \ -G_STMT_START \ -{ \ - void *_call_stack[512]; \ - int _call_stack_size; \ - char **_symbols; \ - _call_stack_size = backtrace (_call_stack, \ - G_N_ELEMENTS (_call_stack)); \ - _symbols = backtrace_symbols (_call_stack, _call_stack_size); \ - if (_symbols != NULL) \ - { \ - int _i; \ - _i = 0; \ - g_critical ("traceback:\n"); \ - while (_i < _call_stack_size) \ - { \ - g_critical ("\t%s\n", _symbols[_i]); \ - _i++; \ - } \ - free (_symbols); \ - } \ -} \ -G_STMT_END - -#define nm_get_timestamp(timestamp) \ -G_STMT_START \ -{ \ - GTimeVal _tv; \ - g_get_current_time (&_tv); \ - *timestamp = (_tv.tv_sec * (1.0 * G_USEC_PER_SEC) + \ - _tv.tv_usec) / G_USEC_PER_SEC; \ -} \ -G_STMT_END - -#define nm_info(fmt, args...) \ -G_STMT_START \ -{ \ - g_message ("<information>\t" fmt "\n", ##args); \ -} G_STMT_END - -#define nm_info_str(fmt_str, args...) \ -G_STMT_START \ -{ \ - g_message ("<information>\t%s\n", fmt_str, ##args); \ -} G_STMT_END - -#define nm_debug(fmt, args...) \ -G_STMT_START \ -{ \ - gdouble _timestamp; \ - nm_get_timestamp (&_timestamp); \ - g_debug ("<debug info>\t[%f] %s (): " fmt "\n", _timestamp, \ - __FUNCTION__, ##args); \ -} G_STMT_END - -#define nm_debug_str(fmt_str, args...) \ -G_STMT_START \ -{ \ - gdouble _timestamp; \ - nm_get_timestamp (&_timestamp); \ - g_debug ("<debug info>\t[%f] %s (): %s\n", _timestamp, \ - __FUNCTION__, fmt_str, ##args); \ -} G_STMT_END - -#define nm_warning(fmt, args...) \ -G_STMT_START \ -{ \ - g_warning ("<WARNING>\t %s (): " fmt "\n", \ - __FUNCTION__, ##args); \ -} G_STMT_END - -#define nm_warning_str(fmt_str, args...) \ -G_STMT_START \ -{ \ - g_warning ("<WARNING>\t %s (): %s\n", \ - __FUNCTION__, fmt_str, ##args); \ -} G_STMT_END - -#define nm_error(fmt, args...) \ -G_STMT_START \ -{ \ - gdouble _timestamp; \ - nm_get_timestamp (&_timestamp); \ - g_critical ("<ERROR>\t[%f] %s (): " fmt "\n", _timestamp, \ - __FUNCTION__, ##args); \ - nm_print_backtrace (); \ - G_BREAKPOINT (); \ -} G_STMT_END - -#define nm_error_str(fmt_str, args...) \ -G_STMT_START \ -{ \ - gdouble _timestamp; \ - nm_get_timestamp (&_timestamp); \ - g_critical ("<ERROR>\t[%f] %s (): %s\n", _timestamp, \ - __FUNCTION__, fmt_str, ##args); \ - nm_print_backtrace (); \ - G_BREAKPOINT (); \ -} G_STMT_END - -gchar *nm_dbus_escape_object_path (const gchar *utf8_string); -gchar *nm_dbus_unescape_object_path (const gchar *object_path); - -#endif /* NM_UTILS_H */ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de