diff options
| author | Michael Biebl <biebl@debian.org> | 2006-10-24 18:24:47 +0000 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2006-10-24 18:24:47 +0000 |
| commit | 8c51ad8783cedd385dcaea3d308e6e08389c9875 (patch) | |
| tree | c7d0a0bd6b1b6b5573bd62e2831fa87ae1dab7ae /debian | |
| parent | 62d4af9627d2368c88e2a8abca710f2923e824ed (diff) | |
* 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. git-svn-id: svn+ssh://svn.debian.org/svn/pkg-utopia/packages/unstable/networkmanager@1100 ceb527fc-18e6-0310-9fe2-813c157c29e7
Diffstat (limited to 'debian')
| -rw-r--r-- | debian/changelog | 7 | ||||
| -rw-r--r-- | debian/patches/05-debian_backend.patch | 93 |
2 files changed, 95 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index eac0afbb..692c8c44 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,9 +4,12 @@ network-manager (0.6.4-4) unstable; urgency=low * 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@debian.org> Tue, 24 Oct 2006 14:58:19 +0200 + -- Michael Biebl <biebl@debian.org> Tue, 24 Oct 2006 20:18:18 +0200 network-manager (0.6.4-3) unstable; urgency=low diff --git a/debian/patches/05-debian_backend.patch b/debian/patches/05-debian_backend.patch index c8006623..8a54e68e 100644 --- a/debian/patches/05-debian_backend.patch +++ b/debian/patches/05-debian_backend.patch @@ -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 @@ index 740572a..3a2fdd6 100644 /* * 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 @@ index 740572a..3a2fdd6 100644 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; } |