View previous topic :: View next topic |
Author |
Message |
copapa n00b
Joined: 14 Nov 2014 Posts: 7
|
Posted: Fri Jul 31, 2015 9:39 am Post subject: Cannot run `ip` command without `sudo` as root |
|
|
Hi.
I am having a problem with the ip command. I can run it normally as a simple user but cannot run it (i.e. no output appears, not even usage, but return code is 0) as root except if I use sudo (return code is 0 despite lack of output).
Selinux permissive or enforcing mode does not change this behavior.
Here is dump of a session : http://pastebin.com/index/VfVkFC7t .
Any clue ? |
|
Back to top |
|
|
copapa n00b
Joined: 14 Nov 2014 Posts: 7
|
Posted: Fri Jul 31, 2015 9:45 am Post subject: |
|
|
Ok just after posting I had the idea to check if `ip` and `sudo ip` ran the same binary. And there I find
Code: | hostname ~ # which ip
/sbin/ip
hostname ~ # sudo which ip
/bin/ip
hostname ~ # ls -l /bin/ip
-rwxr-xr-x. 1 root root 318432 Jan 14 2015 /bin/ip
hostname ~ # ls -l /sbin/ip
-rwxr-xr-x. 1 root root 0 Apr 1 11:35 /sbin/ip |
Ok something is really weird. I have a 0 byte `/sbin/ip`. And I wondered why my script didn't work
Anyone has an idea of the origin of this file ? |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3664
|
Posted: Fri Jul 31, 2015 12:03 pm Post subject: |
|
|
copapa wrote: | Anyone has an idea of the origin of this file ? |
$ equery b /sbin/ip |
|
Back to top |
|
|
copapa n00b
Joined: 14 Nov 2014 Posts: 7
|
Posted: Fri Jul 31, 2015 12:51 pm Post subject: |
|
|
Found the culprit !
My colleague created this file long time ago to silence an error message from FirewallBuilder (this program uses /sbin/ip as the default path for the ip command) but the ip command was just used to do some non-essentials checks in the script.
Sorry for the noise. |
|
Back to top |
|
|
|