You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently found a bug in the is_nm_handling() function in the grep statement.
is_nm_handling ()
{
LANG=C nmcli -t --fields device,state dev status 2>/dev/null | grep -q "^\(${1}:connected\)\|\(${1}:connecting.*\)$"
}
From the above, you will notice that the "^" anchor is applied to the "connected" case and does not apply to the "connecting" case in the grep due to the way the brackets () are placed. This can cause the grep statement to incorrectly return a match.
For ex: When trying to check for eth0 using is_nm_handling(), "bondeth0:connecting" would also match the grep and return incorrectly.
Hey,
I recently found a bug in the is_nm_handling() function in the grep statement.
From the above, you will notice that the "^" anchor is applied to the "connected" case and does not apply to the "connecting" case in the grep due to the way the brackets () are placed. This can cause the grep statement to incorrectly return a match.
For ex: When trying to check for eth0 using is_nm_handling(), "bondeth0:connecting" would also match the grep and return incorrectly.
Here is my proposed fix for this issue.
Thanks
The text was updated successfully, but these errors were encountered: