Package: ifupdown Version: 0.7.54 Severity: normal Tags: patch --- Please enter the report below this line. ---
Small patch to allow configuration files contains '.' and ':' in these names. This make more user readably names for eg. vlans configuration - interface name eth0.100 and config name eth0.100 (instead of eth0-100 or eth0_100). diff -ur ifupdown-0.7.54.orig/config.c ifupdown-0.7.54/config.c --- ifupdown-0.7.54.orig/config.c 2015-06-07 00:50:23.000000000 +0300 +++ ifupdown-0.7.54/config.c 2015-09-07 14:28:57.713833485 +0300 @@ -277,8 +277,11 @@ if (d == NULL || d->d_name[0] == 0) return 0; + if (d->d_name[0] == '.') + return 0; + for (const char *p = d->d_name; *p; p++) - if (!(((*p >= 'a') && (*p <= 'z')) || ((*p >= 'A') && (*p <= 'Z')) || ((*p >= '0') && (*p <= '9')) || (*p == '_') || (*p == '-'))) + if (!(((*p >= 'a') && (*p <= 'z')) || ((*p >= 'A') && (*p <= 'Z')) || ((*p >= '0') && (*p <= '9')) || (*p == '_') || (*p == '-') || (*p == ':') || (*p == '.'))) return 0; return 1; --- System information. --- Architecture: amd64 Kernel: Linux 4.2.0-999-generic Debian Release: stretch/sid 500 unstable mirror.yandex.ru 400 experimental ftp.fi.debian.org --- Package information. --- Depends (Version) | Installed ================================-+-================= iproute2 | 4.1.1-1 OR iproute (>= 20071016-1) | 1:4.1.1-1 libc6 (>= 2.14) | lsb-base (>= 4.1+Debian3) | initscripts (>= 2.88dsf-25) | adduser | Recommends (Version) | Installed ==============================-+-=========== isc-dhcp-client | 4.3.3-3 OR dhcp-client | Suggests (Version) | Installed ========================-+-=========== ppp | 2.4.6-3.1 rdnssd | net-tools | 1.60-27
diff -ur ifupdown-0.7.54.orig/config.c ifupdown-0.7.54/config.c --- ifupdown-0.7.54.orig/config.c 2015-06-07 00:50:23.000000000 +0300 +++ ifupdown-0.7.54/config.c 2015-09-07 14:28:57.713833485 +0300 @@ -277,8 +277,11 @@ if (d == NULL || d->d_name[0] == 0) return 0; + if (d->d_name[0] == '.') + return 0; + for (const char *p = d->d_name; *p; p++) - if (!(((*p >= 'a') && (*p <= 'z')) || ((*p >= 'A') && (*p <= 'Z')) || ((*p >= '0') && (*p <= '9')) || (*p == '_') || (*p == '-'))) + if (!(((*p >= 'a') && (*p <= 'z')) || ((*p >= 'A') && (*p <= 'Z')) || ((*p >= '0') && (*p <= '9')) || (*p == '_') || (*p == '-') || (*p == ':') || (*p == '.'))) return 0; return 1;