Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 198331 Details for
Bug 244274
NetworkManager creates empty resolv.conf with networkmanager-openvpn
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch for nm-openvpn
patch.txt (text/plain), 25.19 KB, created by
Christoph Höger
on 2007-09-18 12:52:59 UTC
(
hide
)
Description:
patch for nm-openvpn
Filename:
MIME Type:
Creator:
Christoph Höger
Created:
2007-09-18 12:52:59 UTC
Size:
25.19 KB
patch
obsolete
>diff -ru NetworkManager-openvpn-0.3.2/src/Makefile.am NetworkManager-openvpn-0.3.2experimental/src/Makefile.am >--- NetworkManager-openvpn-0.3.2/src/Makefile.am 2005-11-14 17:04:36.000000000 +0100 >+++ NetworkManager-openvpn-0.3.2experimental/src/Makefile.am 2007-09-18 11:16:01.000000000 +0200 >@@ -30,7 +30,8 @@ > > > nm_openvpn_service_openvpn_helper_SOURCES = \ >- nm-openvpn-service-openvpn-helper.c >+ nm-openvpn-service-openvpn-helper.c \ >+ nm-utils.c > > nm_openvpn_service_openvpn_helper_LDADD = \ > $(DBUS_LIBS) \ >diff -ru NetworkManager-openvpn-0.3.2/src/Makefile.in NetworkManager-openvpn-0.3.2experimental/src/Makefile.in >--- NetworkManager-openvpn-0.3.2/src/Makefile.in 2006-08-09 19:45:46.000000000 +0200 >+++ NetworkManager-openvpn-0.3.2experimental/src/Makefile.in 2007-09-18 11:26:02.000000000 +0200 >@@ -84,6 +84,7 @@ > GMSGFMT = @GMSGFMT@ > GNOMEKEYRING_CFLAGS = @GNOMEKEYRING_CFLAGS@ > GNOMEKEYRING_LIBS = @GNOMEKEYRING_LIBS@ >+GREP = @GREP@ > GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ > GTHREAD_LIBS = @GTHREAD_LIBS@ > GTK_CFLAGS = @GTK_CFLAGS@ >@@ -161,13 +162,9 @@ > USE_NLS = @USE_NLS@ > VERSION = @VERSION@ > XGETTEXT = @XGETTEXT@ >-ac_ct_AR = @ac_ct_AR@ > ac_ct_CC = @ac_ct_CC@ > ac_ct_CXX = @ac_ct_CXX@ > ac_ct_F77 = @ac_ct_F77@ >-ac_ct_RANLIB = @ac_ct_RANLIB@ >-ac_ct_STRIP = @ac_ct_STRIP@ >-ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ > am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ > am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ > am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ >@@ -182,22 +179,29 @@ > build_os = @build_os@ > build_vendor = @build_vendor@ > datadir = @datadir@ >+datarootdir = @datarootdir@ >+docdir = @docdir@ >+dvidir = @dvidir@ > exec_prefix = @exec_prefix@ > host = @host@ > host_alias = @host_alias@ > host_cpu = @host_cpu@ > host_os = @host_os@ > host_vendor = @host_vendor@ >+htmldir = @htmldir@ > includedir = @includedir@ > infodir = @infodir@ > install_sh = @install_sh@ > libdir = @libdir@ > libexecdir = @libexecdir@ >+localedir = @localedir@ > localstatedir = @localstatedir@ > mandir = @mandir@ > oldincludedir = @oldincludedir@ >+pdfdir = @pdfdir@ > prefix = @prefix@ > program_transform_name = @program_transform_name@ >+psdir = @psdir@ > sbindir = @sbindir@ > sharedstatedir = @sharedstatedir@ > sysconfdir = @sysconfdir@ >@@ -235,7 +239,8 @@ > > > nm_openvpn_service_openvpn_helper_SOURCES = \ >- nm-openvpn-service-openvpn-helper.c >+ nm-openvpn-service-openvpn-helper.c \ >+ nm-utils.c > > > nm_openvpn_service_openvpn_helper_LDADD = \ >@@ -259,7 +264,7 @@ > nm_openvpn_service_DEPENDENCIES = > nm_openvpn_service_LDFLAGS = > am_nm_openvpn_service_openvpn_helper_OBJECTS = \ >- nm-openvpn-service-openvpn-helper.$(OBJEXT) >+ nm-openvpn-service-openvpn-helper.$(OBJEXT) nm-utils.$(OBJEXT) > nm_openvpn_service_openvpn_helper_OBJECTS = \ > $(am_nm_openvpn_service_openvpn_helper_OBJECTS) > nm_openvpn_service_openvpn_helper_DEPENDENCIES = >diff -ru NetworkManager-openvpn-0.3.2/src/nm-openvpn-service.c NetworkManager-openvpn-0.3.2experimental/src/nm-openvpn-service.c >--- NetworkManager-openvpn-0.3.2/src/nm-openvpn-service.c 2006-05-11 19:18:11.000000000 +0200 >+++ NetworkManager-openvpn-0.3.2experimental/src/nm-openvpn-service.c 2007-09-18 13:55:50.000000000 +0200 >@@ -76,11 +76,13 @@ > guint connect_timer; > guint connect_count; > NmOpenVPN_IOData *io_data; >+ gboolean use_pushed_dns_data; >+ gboolean use_own_dns; >+ gchar* own_dns; > } NmOpenVPNData; > > static gboolean nm_openvpn_dbus_handle_stop_vpn (NmOpenVPNData *data); > >- > /* > * nm_dbus_create_error_message > * >@@ -615,6 +617,8 @@ > nm_info ("Could not find openvpn binary."); > return -1; > } >+ else >+ nm_info("Found openvpn binary."); > > // First check in which mode we are operating. Since NM does not > // guarantee any particular order we search this parameter >@@ -664,7 +668,17 @@ > } else if ( (strcmp( data_items[i], "ta-dir") == 0) ) { > ta_dir = data_items[++i]; > } >+ //do we want to use the pushed dns infos or do we have or own? >+ //this particular options won't be used here, but if we already run through the array... >+ else if ( (strcmp( data_items[i], "pushed-dns") == 0) ) >+ data->use_pushed_dns_data = (strcmp(data_items[++i], "yes") == 0); >+ else if ( (strcmp( data_items[i], "use-own-dns") == 0) ) >+ data->use_own_dns = (strcmp(data_items[++i], "yes") == 0); >+ else if ( (strcmp( data_items[i], "own-dns") == 0) ) >+ data->own_dns = g_strdup(data_items[++i]); >+ > } >+ > g_ptr_array_add (openvpn_argv, (gpointer) "--nobind"); > > // Device, either tun or tap >@@ -927,6 +941,9 @@ > { "cipher", OPT_TYPE_ASCII }, > { "ta", OPT_TYPE_ASCII }, > { "ta-dir", OPT_TYPE_ASCII }, >+ { "pushed-dns", OPT_TYPE_ASCII}, >+ { "use-own-dns", OPT_TYPE_ASCII}, >+ { "own-dns", OPT_TYPE_ADDRESS}, > { NULL, OPT_TYPE_UNKNOWN } }; > > unsigned int i; >@@ -1256,7 +1273,8 @@ > guint32 ip4_nbns_len; > guint32 mss; > gboolean success = FALSE; >- char * empty = ""; >+ char * empty = ""; >+ GPtrArray *gpa_ip4_dns = NULL; > > g_return_if_fail (data != NULL); > g_return_if_fail (con != NULL); >@@ -1290,7 +1308,20 @@ > /* OpenVPN does not care about the MSS */ > mss = 0; > >- dbus_message_append_args (signal, >+ /* >+ * we have 4 options wich we have to handle >+ * 1. don't use pushed dns, but use own dns -> send new dns list to NM >+ */ >+ >+ if ( (!data->use_pushed_dns_data) && (data->use_own_dns)) >+ { >+ gpa_ip4_dns = g_ptr_array_new(); >+ g_ptr_array_add(gpa_ip4_dns, data->own_dns); >+ //transcode our String array to an UINT array >+ gpa_to_uint32arr(gpa_ip4_dns, &ip4_dns, &ip4_dns_len); >+ >+ >+ dbus_message_append_args (signal, > DBUS_TYPE_UINT32, &ip4_vpn_gateway, > DBUS_TYPE_STRING, &tundev, > DBUS_TYPE_UINT32, &ip4_address, >@@ -1302,8 +1333,91 @@ > DBUS_TYPE_STRING, &empty, > DBUS_TYPE_STRING, &empty, > DBUS_TYPE_INVALID); >+ >+ g_ptr_array_free( gpa_ip4_dns, TRUE ); >+ g_free( ip4_dns ); >+ } >+ >+ /* >+ * 2. don't use pushed dns and own dns -> just send empty list >+ */ >+ else if ( (!data->use_pushed_dns_data) && (!data->use_own_dns)) >+ { >+ dbus_message_append_args (signal, >+ DBUS_TYPE_UINT32, &ip4_vpn_gateway, >+ DBUS_TYPE_STRING, &tundev, >+ DBUS_TYPE_UINT32, &ip4_address, >+ DBUS_TYPE_UINT32, &ip4_ptpaddr, >+ DBUS_TYPE_UINT32, &ip4_netmask, >+ DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &ip4_dns, 0, >+ DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &ip4_nbns, ip4_nbns_len, >+ DBUS_TYPE_UINT32, &mss, >+ DBUS_TYPE_STRING, &empty, >+ DBUS_TYPE_STRING, &empty, >+ DBUS_TYPE_INVALID); >+ } >+ /* >+ * 3. use pushed dns and own dns -> tricky, fallback semantics >+ */ >+ else if ( (data->use_pushed_dns_data) && (data->use_own_dns)) >+ { >+ if (ip4_dns[0] != 0) >+ { >+ dbus_message_append_args (signal, >+ DBUS_TYPE_UINT32, &ip4_vpn_gateway, >+ DBUS_TYPE_STRING, &tundev, >+ DBUS_TYPE_UINT32, &ip4_address, >+ DBUS_TYPE_UINT32, &ip4_ptpaddr, >+ DBUS_TYPE_UINT32, &ip4_netmask, >+ DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &ip4_dns, ip4_dns_len, >+ DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &ip4_nbns, ip4_nbns_len, >+ DBUS_TYPE_UINT32, &mss, >+ DBUS_TYPE_STRING, &empty, >+ DBUS_TYPE_STRING, &empty, >+ DBUS_TYPE_INVALID); >+ } >+ else >+ { >+ gpa_ip4_dns = g_ptr_array_new(); >+ g_ptr_array_add(gpa_ip4_dns, data->own_dns); >+ //transcode our String array to an UINT array >+ gpa_to_uint32arr(gpa_ip4_dns, &ip4_dns, &ip4_dns_len); >+ >+ dbus_message_append_args (signal, >+ DBUS_TYPE_UINT32, &ip4_vpn_gateway, >+ DBUS_TYPE_STRING, &tundev, >+ DBUS_TYPE_UINT32, &ip4_address, >+ DBUS_TYPE_UINT32, &ip4_ptpaddr, >+ DBUS_TYPE_UINT32, &ip4_netmask, >+ DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &ip4_dns, ip4_dns_len, >+ DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &ip4_nbns, ip4_nbns_len, >+ DBUS_TYPE_UINT32, &mss, >+ DBUS_TYPE_STRING, &empty, >+ DBUS_TYPE_STRING, &empty, >+ DBUS_TYPE_INVALID); >+ >+ g_ptr_array_free( gpa_ip4_dns, TRUE ); >+ g_free( ip4_dns ); >+ } >+ } >+ /* >+ * 4. use pushed dns and not own dns -> old behavior >+ */ >+ else >+ dbus_message_append_args (signal, >+ DBUS_TYPE_UINT32, &ip4_vpn_gateway, >+ DBUS_TYPE_STRING, &tundev, >+ DBUS_TYPE_UINT32, &ip4_address, >+ DBUS_TYPE_UINT32, &ip4_ptpaddr, >+ DBUS_TYPE_UINT32, &ip4_netmask, >+ DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &ip4_dns, ip4_dns_len, >+ DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &ip4_nbns, ip4_nbns_len, >+ DBUS_TYPE_UINT32, &mss, >+ DBUS_TYPE_STRING, &empty, >+ DBUS_TYPE_STRING, &empty, >+ DBUS_TYPE_INVALID); > >- if (!dbus_connection_send (data->con, signal, NULL)) >+ if (!dbus_connection_send (data->con, signal, NULL)) > { > nm_warning ("Could not raise the "NM_DBUS_VPN_SIGNAL_IP4_CONFIG" signal!"); > goto out; >diff -ru NetworkManager-openvpn-0.3.2/src/nm-openvpn-service-openvpn-helper.c NetworkManager-openvpn-0.3.2experimental/src/nm-openvpn-service-openvpn-helper.c >--- NetworkManager-openvpn-0.3.2/src/nm-openvpn-service-openvpn-helper.c 2006-03-30 19:20:57.000000000 +0200 >+++ NetworkManager-openvpn-0.3.2experimental/src/nm-openvpn-service-openvpn-helper.c 2007-09-18 13:56:03.000000000 +0200 >@@ -68,51 +68,6 @@ > 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) > { >diff -ru NetworkManager-openvpn-0.3.2/src/nm-utils.c NetworkManager-openvpn-0.3.2experimental/src/nm-utils.c >--- NetworkManager-openvpn-0.3.2/src/nm-utils.c 2006-05-11 19:18:11.000000000 +0200 >+++ NetworkManager-openvpn-0.3.2experimental/src/nm-utils.c 2007-09-18 13:51:24.000000000 +0200 >@@ -25,8 +25,53 @@ > > #include <glib.h> > >+#include <sys/socket.h> >+#include <netinet/in.h> >+#include <arpa/inet.h> >+ > #include "nm-utils.h" > >+ /* >+ * gpa_to_uint32arr >+ * >+ * Convert GPtrArray of uint32 to a uint32* array >+ * >+ */ >+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; >+ } >+} >+ > gchar *nm_dbus_escape_object_path (const gchar *utf8_string) > { > const gchar *p; >diff -ru NetworkManager-openvpn-0.3.2/src/nm-utils.h NetworkManager-openvpn-0.3.2experimental/src/nm-utils.h >--- NetworkManager-openvpn-0.3.2/src/nm-utils.h 2006-05-11 19:18:11.000000000 +0200 >+++ NetworkManager-openvpn-0.3.2experimental/src/nm-utils.h 2007-09-18 11:13:58.000000000 +0200 >@@ -128,6 +128,8 @@ > gchar *nm_dbus_escape_object_path (const gchar *utf8_string); > gchar *nm_dbus_unescape_object_path (const gchar *object_path); > >+void gpa_to_uint32arr (const GPtrArray *gpa, guint32 **uia, guint32 *uia_len); >+ > static inline const char *nm_find_openvpn (void) > { > static const char *openvpn_binary_paths[] = >diff -ru NetworkManager-openvpn-0.3.2/properties/Makefile.in NetworkManager-openvpn-0.3.2experimental/properties/Makefile.in >--- NetworkManager-openvpn-0.3.2/properties/Makefile.in 2006-08-09 19:45:45.000000000 +0200 >+++ NetworkManager-openvpn-0.3.2experimental/properties/Makefile.in 2007-09-18 11:26:02.000000000 +0200 >@@ -84,6 +84,7 @@ > GMSGFMT = @GMSGFMT@ > GNOMEKEYRING_CFLAGS = @GNOMEKEYRING_CFLAGS@ > GNOMEKEYRING_LIBS = @GNOMEKEYRING_LIBS@ >+GREP = @GREP@ > GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ > GTHREAD_LIBS = @GTHREAD_LIBS@ > GTK_CFLAGS = @GTK_CFLAGS@ >@@ -161,13 +162,9 @@ > USE_NLS = @USE_NLS@ > VERSION = @VERSION@ > XGETTEXT = @XGETTEXT@ >-ac_ct_AR = @ac_ct_AR@ > ac_ct_CC = @ac_ct_CC@ > ac_ct_CXX = @ac_ct_CXX@ > ac_ct_F77 = @ac_ct_F77@ >-ac_ct_RANLIB = @ac_ct_RANLIB@ >-ac_ct_STRIP = @ac_ct_STRIP@ >-ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ > am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ > am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ > am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ >@@ -182,22 +179,29 @@ > build_os = @build_os@ > build_vendor = @build_vendor@ > datadir = @datadir@ >+datarootdir = @datarootdir@ >+docdir = @docdir@ >+dvidir = @dvidir@ > exec_prefix = @exec_prefix@ > host = @host@ > host_alias = @host_alias@ > host_cpu = @host_cpu@ > host_os = @host_os@ > host_vendor = @host_vendor@ >+htmldir = @htmldir@ > includedir = @includedir@ > infodir = @infodir@ > install_sh = @install_sh@ > libdir = @libdir@ > libexecdir = @libexecdir@ >+localedir = @localedir@ > localstatedir = @localstatedir@ > mandir = @mandir@ > oldincludedir = @oldincludedir@ >+pdfdir = @pdfdir@ > prefix = @prefix@ > program_transform_name = @program_transform_name@ >+psdir = @psdir@ > sbindir = @sbindir@ > sharedstatedir = @sharedstatedir@ > sysconfdir = @sysconfdir@ >diff -ru NetworkManager-openvpn-0.3.2/properties/nm-openvpn.c NetworkManager-openvpn-0.3.2experimental/properties/nm-openvpn.c >--- NetworkManager-openvpn-0.3.2/properties/nm-openvpn.c 2006-05-11 19:18:09.000000000 +0200 >+++ NetworkManager-openvpn-0.3.2experimental/properties/nm-openvpn.c 2007-09-18 13:33:58.000000000 +0200 >@@ -28,6 +28,7 @@ > #include <glib/gi18n-lib.h> > #include <string.h> > #include <glade/glade.h> >+#include <syslog.h> > > #define NM_VPN_API_SUBJECT_TO_CHANGE > >@@ -56,6 +57,11 @@ > GtkEntry *w_cert; > GtkEntry *w_key; > GtkCheckButton *w_use_routes; >+ //experimental >+ GtkCheckButton *w_use_dns_from_server; >+ GtkCheckButton *w_use_own_dns; >+ GtkEntry *w_own_dns; >+ //</experimental> > GtkEntry *w_routes; > GtkCheckButton *w_use_lzo; > GtkCheckButton *w_use_tap; >@@ -101,6 +107,12 @@ > gtk_entry_set_text (impl->w_username, ""); > gtk_entry_set_text (impl->w_password_ca, ""); > gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_routes), FALSE); >+ //experimental >+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_dns_from_server), TRUE); >+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_own_dns), FALSE); >+ gtk_entry_set_text (impl->w_own_dns, ""); >+ //</experimental> >+ > gtk_entry_set_text (impl->w_routes, ""); > gtk_widget_set_sensitive (GTK_WIDGET (impl->w_routes), FALSE); > gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_lzo), FALSE); >@@ -197,7 +209,14 @@ > (strcmp (value, "yes") == 0) ) { > gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_lzo), TRUE); > should_expand = TRUE; >- } else if ( strcmp (key, "connection-type") == 0) { >+ } >+ else if ( (strcmp (key, "pushed-dns") == 0) ) >+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_dns_from_server), (strcmp (value, "yes") == 0)); >+ else if ( (strcmp (key, "use-own-dns") == 0) ) >+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_own_dns), (strcmp (value, "yes") == 0)); >+ else if (strcmp (key, "own-dns") == 0) >+ gtk_entry_set_text (impl->w_own_dns, value); >+ else if ( strcmp (key, "connection-type") == 0) { > gint type_cbox_sel = 0; > > if ( strcmp (value, "x509") == 0 ) { >@@ -209,7 +228,7 @@ > } else if ( strcmp (value, "x509userpass") == 0 ) { > type_cbox_sel = NM_OPENVPN_CONTYPE_X509USERPASS; > } >- >+ > gtk_combo_box_set_active (GTK_COMBO_BOX (impl->w_connection_type), type_cbox_sel); > connection_type_changed (GTK_COMBO_BOX (impl->w_connection_type), impl); > } else if ( strcmp (key, "local-ip") == 0 ) { >@@ -291,6 +310,9 @@ > gboolean use_tcp; > gboolean use_cipher; > gboolean use_ta; >+ gboolean use_non_local_dns; >+ gboolean use_own_dns; >+ const gchar *dns_address; > > connectionname = gtk_entry_get_text (impl->w_connection_name); > remote = gtk_entry_get_text (impl->w_remote); >@@ -306,6 +328,8 @@ > username = gtk_entry_get_text (impl->w_username); > use_cipher = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (impl->w_use_cipher)); > use_ta = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (impl->w_use_ta)); >+ use_non_local_dns = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (impl->w_use_dns_from_server)); >+ use_own_dns = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (impl->w_use_own_dns)); > > data = NULL; > data = g_slist_append (data, g_strdup ("connection-type")); >@@ -345,6 +369,17 @@ > data = g_slist_append (data, g_strdup (remote_ip)); > data = g_slist_append (data, g_strdup ("username")); > data = g_slist_append (data, g_strdup (username)); >+ >+ //use pushed dns settings? >+ data = g_slist_append (data, g_strdup ("pushed-dns")); >+ data = g_slist_append (data, use_non_local_dns ? g_strdup ("yes") : g_strdup("no")); >+ //use own dns settings? >+ data = g_slist_append (data, g_strdup ("use-own-dns")); >+ data = g_slist_append (data, use_own_dns ? g_strdup ("yes") : g_strdup("no")); >+ dns_address = gtk_entry_get_text(impl->w_own_dns); >+ data = g_slist_append (data, g_strdup ("own-dns")); >+ data = g_slist_append (data, g_strdup(dns_address)); >+ > if (use_cipher) { > const gchar *cipher = gtk_combo_box_get_active_text(impl->w_cipher); > if (cipher != NULL) { >@@ -499,7 +534,7 @@ > (strstr (remote, "\t") != NULL) ) { > > is_valid = FALSE; >- >+ > } else if ( connection_type == NM_OPENVPN_CONTYPE_SHAREDKEY ) { > const char *shared_key; > const char *local_ip; >@@ -537,7 +572,7 @@ > > } else if ( connection_type == NM_OPENVPN_CONTYPE_X509USERPASS ) { > >- const char *username; >+ const char *username; > const char *ca; > const char *cert; > const char *key; >@@ -590,7 +625,6 @@ > if (is_valid) { > GSList *i; > GSList *routes; >- > routes = get_routes (impl); > > for (i = routes; is_valid && (i != NULL); i = g_slist_next (i)) { >@@ -602,7 +636,7 @@ > g_slist_free (routes); > } > } >- >+ > return is_valid; > } > >@@ -612,12 +646,13 @@ > { > NetworkManagerVpnUIImpl *impl = (NetworkManagerVpnUIImpl *) user_data; > >+ if (GTK_CHECK_BUTTON(togglebutton) == impl->w_use_own_dns) >+ gtk_widget_set_sensitive (GTK_WIDGET (impl->w_own_dns), >+ gtk_toggle_button_get_active (togglebutton)); >+ > if (GTK_CHECK_BUTTON(togglebutton) == impl->w_use_routes) > gtk_widget_set_sensitive (GTK_WIDGET (impl->w_routes), > gtk_toggle_button_get_active (togglebutton)); >- else if (GTK_CHECK_BUTTON(togglebutton) == impl->w_use_cipher) >- gtk_widget_set_sensitive (GTK_WIDGET (impl->w_cipher), >- gtk_toggle_button_get_active (togglebutton)); > else if (GTK_CHECK_BUTTON(togglebutton) == impl->w_use_ta) { > gtk_widget_set_sensitive (GTK_WIDGET (impl->w_ta), > gtk_toggle_button_get_active (togglebutton)); >@@ -1471,11 +1506,22 @@ > impl->w_ta_dir_zero = GTK_RADIO_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-ta-dir-zero" ) ); > impl->w_ta_dir_one = GTK_RADIO_BUTTON( glade_xml_get_widget( impl->xml, "openvpn-ta-dir-one" ) ); > >+ impl->w_use_own_dns = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-own-dns")); >+ impl->w_use_dns_from_server = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "openvpn-use-dns")); >+ impl->w_own_dns = GTK_ENTRY( glade_xml_get_widget( impl->xml, "openvpn-own-dns-server" ) ); >+ > impl->callback = NULL; > >+ gtk_signal_connect (GTK_OBJECT (impl->w_use_dns_from_server), >+ "toggled", GTK_SIGNAL_FUNC (use_editable_toggled), impl); >+ gtk_signal_connect (GTK_OBJECT (impl->w_use_own_dns), >+ "toggled", GTK_SIGNAL_FUNC (use_editable_toggled), impl); >+ gtk_signal_connect (GTK_OBJECT (impl->w_own_dns), >+ "toggled", GTK_SIGNAL_FUNC (editable_changed), impl); >+ > > gtk_signal_connect (GTK_OBJECT (impl->w_use_routes), >- "toggled", GTK_SIGNAL_FUNC (use_editable_toggled), impl); >+ "toggled", GTK_SIGNAL_FUNC (use_editable_toggled), impl); > gtk_signal_connect (GTK_OBJECT (impl->w_use_cipher), > "toggled", GTK_SIGNAL_FUNC (use_editable_toggled), impl); > gtk_signal_connect (GTK_OBJECT (impl->w_use_ta), >diff -ru NetworkManager-openvpn-0.3.2/properties/nm-openvpn-dialog.glade NetworkManager-openvpn-0.3.2experimental/properties/nm-openvpn-dialog.glade >--- NetworkManager-openvpn-0.3.2/properties/nm-openvpn-dialog.glade 2006-05-29 04:59:09.000000000 +0200 >+++ NetworkManager-openvpn-0.3.2experimental/properties/nm-openvpn-dialog.glade 2007-09-18 11:41:21.000000000 +0200 >@@ -1370,11 +1370,95 @@ > <property name="left_padding">12</property> > <property name="right_padding">0</property> > >- <child> >+ <child> > <widget class="GtkVBox" id="vbox6"> > <property name="visible">True</property> > <property name="homogeneous">False</property> > <property name="spacing">6</property> >+ <child> >+ <widget class="GtkCheckButton" id="openvpn-use-dns"> >+ <property name="visible">True</property> >+ <property name="can_focus">True</property> >+ <property name="label" translatable="yes">Use DNS information from remote server</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="padding">0</property> >+ <property name="expand">False</property> >+ <property name="fill">False</property> >+ </packing> >+ </child> >+ >+ <child> >+ <widget class="GtkAlignment" id="alignment11"> >+ <property name="visible">True</property> >+ <property name="xalign">0.5</property> >+ <property name="yalign">0.5</property> >+ <property name="xscale">1</property> >+ <property name="yscale">1</property> >+ <property name="top_padding">0</property> >+ <property name="bottom_padding">0</property> >+ <property name="left_padding">12</property> >+ <property name="right_padding">0</property> >+ >+ <child> >+ <widget class="GtkVBox" id="vbox8"> >+ <property name="visible">True</property> >+ <property name="homogeneous">False</property> >+ <property name="spacing">6</property> >+ >+ <child> >+ <widget class="GtkCheckButton" id="openvpn-use-own-dns"> >+ <property name="visible">True</property> >+ <property name="can_focus">True</property> >+ <property name="label" translatable="yes">Use this DNS Server:</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="padding">0</property> >+ <property name="expand">False</property> >+ <property name="fill">False</property> >+ </packing> >+ </child> >+ >+ <child> >+ <widget class="GtkEntry" id="openvpn-own-dns-server"> >+ <property name="visible">True</property> >+ <property name="can_focus">True</property> >+ <property name="editable">True</property> >+ <property name="visibility">True</property> >+ <property name="max_length">0</property> >+ <property name="text" translatable="yes"></property> >+ <property name="has_frame">True</property> >+ <property name="invisible_char">*</property> >+ <property name="activates_default">False</property> >+ </widget> >+ <packing> >+ <property name="padding">0</property> >+ <property name="expand">True</property> >+ <property name="fill">True</property> >+ </packing> >+ </child> >+ </widget> >+ >+ </child> >+ </widget> >+ <packing> >+ <property name="padding">0</property> >+ <property name="expand">False</property> >+ <property name="fill">True</property> >+ </packing> >+ </child> > > <child> > <widget class="GtkCheckButton" id="openvpn-use-routes"> >@@ -1394,7 +1478,6 @@ > <property name="fill">False</property> > </packing> > </child> >- > <child> > <widget class="GtkAlignment" id="alignment10"> > <property name="visible">True</property>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244274
:
198331
|
200951
|
201971