Bug 967722

Summary: ncftool list/virsh iface-list met error when filename have a comma(,) or the exclamation mark(!) suffix in /etc/sysconfig/network-scripts/
Product: Red Hat Enterprise Linux 7 Reporter: Hu Jianwei <jiahu>
Component: netcfAssignee: Laine Stump <laine>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: dyuan, jsuchane, mzhan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 967720 Environment:
Last Closed: 2015-03-31 15:25:55 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: 967720, 1165965    
Bug Blocks:    

Description Hu Jianwei 2013-05-28 07:00:51 UTC
Version:
netcf-0.1.9-3.el6.x86_64
libvirt-0.10.2-18.el6_4.5.x86_64
And, please note that the comma(,) in filename can not reproduce on rhel6, only the exclamation mark(!) reproduced in bug.

+++ This bug was initially created as a clone of Bug #967720 +++

Description of problem:
virsh iface-list met error when filename have a comma(,) or the exclamation mark(!) suffix in /etc/sysconfig/network-scripts path

Version-Release number of selected component (if applicable):
libvirt-1.0.5-2.el7.x86_64
qemu-kvm-1.4.0-4.el7.x86_64
kernel-3.9.0-0.55.el7.x86_64
netcf-0.2.3-4.bz961184.el7.x86_64

How reproducible:
100%

Steps:
1. List all ifcfg-* scripts in /etc/sysconfig/network-scripts.

[root@SRIOV2 network-scripts]# ls | grep ifcfg-
ifcfg-eth1
ifcfg-eth1.bak
ifcfg-eth2
ifcfg-eth3
ifcfg-eth3.bak
ifcfg-eth4
ifcfg-eth5
ifcfg-lo
[root@SRIOV2 network-scripts]# virsh iface-list --all
Name                 State      MAC Address
--------------------------------------------
eth1                 active     b4:b5:2f:af:a1:01
eth3                 active     00:1b:21:55:b3:b9
lo                   active     00:00:00:00:00:00

2. Add file with , and !, like below:
ifcfg-eth1,
ifcfg-eth1!

3. Run virsh iface-list agagin.
[root@SRIOV2 network-scripts]# ls | grep ifcfg-
ifcfg-eth1
ifcfg-eth1,   <======== new file
ifcfg-eth1.bak
ifcfg-eth2
ifcfg-eth3
ifcfg-eth3.bak
ifcfg-eth4
ifcfg-eth5
ifcfg-lo
[root@SRIOV2 network-scripts]# virsh iface-list --all
error: Failed to list interfaces
error: internal error failed to get number of host interfaces: unspecified error - errors in loading some config files

[root@SRIOV2 network-scripts]# touch ifcfg-eth1!
[root@SRIOV2 network-scripts]# ls | grep ifcfg-
ifcfg-eth1
ifcfg-eth1!   <========new file
ifcfg-eth1.bak
ifcfg-eth2
ifcfg-eth3
ifcfg-eth3.bak
ifcfg-eth4
ifcfg-eth5
ifcfg-lo
[root@SRIOV2 network-scripts]# virsh iface-list --all
error: Failed to list interfaces
error: internal error failed to get number of host interfaces: unspecified error - errors in loading some config files

Using ncftool command line:
[root@hujianweitest network-scripts]#  --all
error: unspecified error
error: errors in loading some config files


Actual results:
The command met above error.

Expected results:
The iface-list should filter the invalid netwok-scripts for it or can deal with this abnormal status. For these chars are good for iface-list, such as @ * $ % ^ ~ ; : ? 

Netcf should check those two chars.

Comment 8 Laine Stump 2015-03-31 15:25:55 UTC
Confirmed that this is fixed by the fix for CVE-2014-8119.

*** This bug has been marked as a duplicate of bug 1165965 ***