Bug 1027945
Summary: | /lib/udev/rename_device unable to handle HWADDR with comments | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Jan Ščotka <jscotka> |
Component: | initscripts | Assignee: | initscripts Maintenance Team <initscripts-maint-list> |
Status: | CLOSED ERRATA | QA Contact: | Jan Ščotka <jscotka> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 7.0 | CC: | lnykryn, lpol, vpavlin |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | initscripts-9.49.18-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-03-05 10:52:12 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 909279 |
Description
Jan Ščotka
2013-11-07 13:31:44 UTC
Hi, another thing is similar, but result is much more worse. Same problem with comment in DEVICE string [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens4 DEVICE=ahoj #commet here ONBOOT=yes BOOTPROTO=dhcp HWADDR=52:54:00:12:34:56 TYPE=Ethernet result: 3: ahoj_#commet_he: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff inet 10.0.2.15/24 scope global dynamic ahoj_#commet_he valid_lft 86378sec preferred_lft 86378sec inet6 fe80::5054:ff:fe12:3456/64 scope link valid_lft forever preferred_lft forever Thanks®ards Honza I think that something like this should be sufficient: diff --git a/src/rename_device.c b/src/rename_device.c index 8e28154..bb5e6b8 100644 --- a/src/rename_device.c +++ b/src/rename_device.c @@ -120,6 +120,14 @@ int isCfg(const struct dirent *dent) { } static inline char *dequote(char *start, char *end) { + char *c; + //remove comments and trailing whitespace + c = strchr(start, '#'); + if (c!=NULL) + *c='\0'; + + g_strchomp(start); + if (end==NULL) { end=start; while(*end) end++; This issue is not a blocker so reassigning to 7.1 initscripts-9.49.23-1.el7 I've tried: 1. comment in HWADDR line 2. comment in DEVICE line 3. DEVICE name with hash char like "ahoj#comment" Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0471.html |