aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-01-09 20:35:40 +0000
committerBill Nottingham <notting@redhat.com>2008-01-09 20:35:40 +0000
commit77f4e608b7439c405d640783704cecd288b01d01 (patch)
tree34a42abfd8b71b51898b6a22399440202b75f8c3 /src
parentfecb5c45c6ce55a5db6fe1cd9fcc936c48ea61ec (diff)
downloadinitscripts-77f4e608b7439c405d640783704cecd288b01d01.tar
initscripts-77f4e608b7439c405d640783704cecd288b01d01.tar.gz
initscripts-77f4e608b7439c405d640783704cecd288b01d01.tar.bz2
initscripts-77f4e608b7439c405d640783704cecd288b01d01.tar.xz
initscripts-77f4e608b7439c405d640783704cecd288b01d01.zip
Ignore any quotes around SUBCHANNELS and HWADDR, for admins that have accidentally added them (#351291)
Diffstat (limited to 'src')
-rw-r--r--src/rename_device.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/rename_device.c b/src/rename_device.c
index 0ec08b46..36d8d32e 100644
--- a/src/rename_device.c
+++ b/src/rename_device.c
@@ -170,6 +170,19 @@ int isCfg(const struct dirent *dent) {
return 1;
}
+static inline char *dequote(char *start, char *end) {
+ if (end==NULL) {
+ end=start;
+ while(*end) end++;
+ }
+ if (end > start) end--;
+ if ((*start == '\'' || *start == '\"') && ( *start == *end ) ) {
+ *end='\0';
+ if (start<end) start++;
+ }
+ return start;
+}
+
struct netdev *get_configs() {
int ncfgs = 0;
struct netdev *ret, *tmpdev;
@@ -206,11 +219,11 @@ struct netdev *get_configs() {
}
#if defined(__s390__) || defined(__s390x__)
if (g_str_has_prefix(lines[i],"SUBCHANNELS=")) {
- hwaddr = lines[i] + 12;
+ hwaddr = dequote(lines[i] + 12, NULL);
}
#else
if (g_str_has_prefix(lines[i],"HWADDR=")) {
- hwaddr = lines[i] + 7;
+ hwaddr = dequote(lines[i] + 7, NULL);
}
#endif
}