[Pkg-utopia-commits] r1100 - in
packages/unstable/networkmanager/debian: . patches
Michael Biebl
biebl at costa.debian.org
Tue Oct 24 18:24:48 UTC 2006
Author: biebl
Date: 2006-10-24 18:24:47 +0000 (Tue, 24 Oct 2006)
New Revision: 1100
Modified:
packages/unstable/networkmanager/debian/changelog
packages/unstable/networkmanager/debian/patches/05-debian_backend.patch
Log:
* Fix the parser for /etc/network/interfaces. The code is still shit, but at
least now it accepts tabs or spaces (or combinations of both) as token
separator.
* On dns changes, do not restart nscd, only invalidate the hosts cache.
Modified: packages/unstable/networkmanager/debian/changelog
===================================================================
--- packages/unstable/networkmanager/debian/changelog 2006-10-24 13:09:47 UTC (rev 1099)
+++ packages/unstable/networkmanager/debian/changelog 2006-10-24 18:24:47 UTC (rev 1100)
@@ -4,9 +4,12 @@
* debian/network-manager.postinst
- Create group netdev if not yet existent. Add a Depends on adduser.
* Add instructions to README.Debian how to restart NetworkManager after
- modifying /etc/network/interfaces. (Closes: 384892)
+ modifying /etc/network/interfaces. (Closes: 384892)
+ * debian/patches/05-debian_backend.patch
+ - Fix the parser for /etc/network/interfaces. (Closes: #383765)
+ - Do not restart nscd on dns changes, only invalidate the hosts cache.
- -- Michael Biebl <biebl at debian.org> Tue, 24 Oct 2006 14:58:19 +0200
+ -- Michael Biebl <biebl at debian.org> Tue, 24 Oct 2006 20:18:18 +0200
network-manager (0.6.4-3) unstable; urgency=low
Modified: packages/unstable/networkmanager/debian/patches/05-debian_backend.patch
===================================================================
--- packages/unstable/networkmanager/debian/patches/05-debian_backend.patch 2006-10-24 13:09:47 UTC (rev 1099)
+++ packages/unstable/networkmanager/debian/patches/05-debian_backend.patch 2006-10-24 18:24:47 UTC (rev 1100)
@@ -1,5 +1,5 @@
diff --git a/src/backends/NetworkManagerDebian.c b/src/backends/NetworkManagerDebian.c
-index 740572a..3a2fdd6 100644
+index 740572a..93c2914 100644
--- a/src/backends/NetworkManagerDebian.c
+++ b/src/backends/NetworkManagerDebian.c
@@ -37,6 +37,7 @@ #include "interface_parser.h"
@@ -10,6 +10,25 @@
/*
* nm_system_init
+@@ -238,14 +239,14 @@ void nm_system_kill_all_dhcp_daemons (vo
+ /*
+ * nm_system_update_dns
+ *
+- * Make glibc/nscd aware of any changes to the resolv.conf file by
+- * restarting nscd.
++ * Invalidate the nscd host cache, if it exists, since
++ * we changed resolv.conf.
+ *
+ */
+ void nm_system_update_dns (void)
+ {
+- nm_spawn_process ("/usr/sbin/invoke-rc.d nscd restart");
+-
++ nm_info ("Clearing nscd hosts cache.");
++ nm_spawn_process ("/usr/sbin/nscd -i hosts");
+ }
+
+
@@ -514,13 +515,60 @@ gboolean nm_system_device_get_use_dhcp (
/*
* nm_system_device_get_disabled
@@ -175,10 +194,78 @@
diff --git a/src/backends/interface_parser.c b/src/backends/interface_parser.c
-index 53d6487..aa81134 100644
+index 53d6487..2fa559f 100644
--- a/src/backends/interface_parser.c
+++ b/src/backends/interface_parser.c
-@@ -198,6 +198,18 @@ if_block *ifparser_getif(const char* ifa
+@@ -71,7 +71,8 @@ void add_data(const char *key,const char
+ //printf("added data '%s' with key '%s'\n",data,key);
+ }
+
+-#define SPACE_OR_TAB(string,ret) {ret = strchr(string,' ');ret=(ret == NULL?strchr(string,'\t'):ret);}
++// define what we consider a whitespace
++#define WS " \t"
+
+ void ifparser_init(void)
+ {
+@@ -105,36 +106,52 @@ void ifparser_init(void)
+ if (line[0]=='#' || line[0]=='\0')
+ continue;
+
+- SPACE_OR_TAB(line,space)
++ space = line;
++ while (!strchr(WS, space[0])) space++;
++
+ if (space == NULL)
+ {
+- nm_warning ("Error: Can't parse interface line '%s'\n",line);
++ nm_warning ("Error: Can't parse line '%s'\n",line);
+ continue;
+ }
++
++ // terminate line string and skip further whitespaces
+ space[0] = '\0';
+-
++ while (isspace(space[1])) space++;
++
+ // There are four different stanzas:
+ // iface, mapping, auto and allow-*. Create a block for each of them.
+ if (strcmp(line,"iface")==0)
+ {
+- char *space2 = strchr(space+1,' ');
++ char *space2 = space+1;
++ while (!strchr(WS, space2[0])) space2++;
++
+ if (space2 == NULL)
+ {
+ nm_warning ("Error: Can't parse iface line '%s'\n",space+1);
+ continue;
+ }
++
++ // terminate space string and skip further whitespaces
+ space2[0]='\0';
++ while (isspace(space2[1])) space2++;
++
+ add_block(line,space+1);
+
+ if (space2[1]!='\0')
+ {
+- space = strchr(space2+1,' ');
++ space = space2+1;
++ while (!strchr(WS, space[0])) space++;
++
+ if (space == NULL)
+ {
+ nm_warning ("Error: Can't parse data '%s'\n",space2+1);
+ continue;
+ }
++ // terminate space2 string and skip further whitespaces
+ space[0] = '\0';
++ while (isspace(space[1])) space++;
++
+ add_data(space2+1,space+1);
+ }
+ }
+@@ -198,6 +215,18 @@ if_block *ifparser_getif(const char* ifa
return NULL;
}
More information about the Pkg-utopia-commits
mailing list