0004742: /usr/sbin/network fails to properly enumerate mon.wlanX
Migrated from: https://tracker.clearos.com/view.php?id=4742
When a device exists like 'mon.wlan0' the /usr/sbin/network program throws and exception:
PHP warning: ifconfig_flags: No such device - /usr/clearos/apps/network/libraries/Iface_Manager.php (469)
It cause here seems to be in triggered by /usr/clearos/apps/network/libraries/Iface_Manager.php which enumerates the devices by ignoring or splitting the portion after a period '.wlan0' part and will fail to enumerate a simple 'mon'. This may be the result of trimming that is done for VLAN interfaces but the case match is too aggressive and will match letter/number combinations instead of numbers only.
Consequently, if a user is using mon.wlanX for any purpose, apps which enumerate interfaces using this method (like LDAP) will fail to start due to the exception that is thrown.
Steps to Reproduce:
Create an interface like mon.wlan0 then run
/usr/sbin/network --get-lan-ips | grep -v debug
DLOPER: Another thing to add as an effective workaround and may be useful for the init script is to change the following in /etc/init.d/slapd:
for LANIP in /usr/sbin/network --get-lan-ips | grep -v debug
; do
to:
for LANIP in /usr/sbin/network --get-lan-ips | grep -v debug | grep -v warn
; do
PBALDWIN: The root cause is from the issue described in 0003171. The developer explicitly suppresses warnings in the ifconfig_flags() call (and other calls), but that suppression is ignored. The fix was a small but significant change that was pushed out in ClearOS 7 Beta 3. We can definitely backport post ClearOS 7.
PBALDWIN: Still waiting on access to a test device. On hold.