#798254 [ifupdown] allow '.' and ':' char in configuration filenames

Package:
ifupdown
Source:
ifupdown
Description:
high level tools to configure network interfaces
Submitter:
"Andrey. Jr. Melnikov"
Date:
2015-09-07 12:00:06 UTC
Severity:
normal
#798254#5
Date:
2015-09-07 11:43:56 UTC
From:
To:
--- 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;



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