Commit 0bc617a4 authored by Branko Mikić's avatar Branko Mikić
Browse files

~ Quick fix of 'unary operator' bug which lead to functioning check for being...

~ Quick fix of 'unary operator' bug which lead to functioning check for being user root which lead to ipturntables script denying execution in up and down event or by ifup and ifdown which logically executed by 'netdev' user. So to fix this the check for super priviledges was relaxed to being user root or being a member of the 'netdev' group.
parent ad86332b
......@@ -410,7 +410,9 @@ formatSubnetAsHexID() {
(( ${#@} == 0 )) && printAbout
[ $USER != "root" ] && error 46 "Superuser priviledges needed. This script makes heavy use of 'iptables' command which only allowed to be used by root."
$(groups $USER | grep netdev) >/dev/null
[ "$USER" != "root" ] && (( $? == 1 )) && error 46 "Superuser priviledges needed. This script makes heavy use of 'iptables' command which is only allowed to be used by root or a user being a member of 'netdev' group."
# we are not root! and we aren't a user of 'netdev' group either?
[ "$1" == "-6" ] && arg=6
[ "$1" == "-4" ] && arg=4
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment