Matthias Hanft <m...@hanft.de> writes:
Yes, everything is run as root. Indeed I had /sbin/iptables in
my PHP
script.
Getting this error, I tried "which iptables" in a root bash
which
showed
/usr/bin/iptables. So I changed this (and even to
"/usr/bin/iptables-legacy",
but with no effect, presumably because of...
n ~ # ls -l /sbin/iptables
lrwxrwxrwx 1 root root 20 Apr 18 2024 /sbin/iptables ->
xtables-legacy-multi
n ~ # ls -l /usr/bin/iptables
lrwxrwxrwx 1 root root 20 Apr 18 2024 /usr/bin/iptables ->
xtables-legacy-multi
n ~ # ls -l /usr/bin/iptables-legacy
lrwxrwxrwx 1 root root 20 Dec 21 09:30 /usr/bin/iptables-legacy
->
xtables-legacy-multi
So everything seems to call "xtables-legacy-multi" anyway.
Running `xtables-legacy-multi` without any arguments produces
output stating that it requires a subcommand,
e.g. `xtables-legacy-multi iptables-legacy`. Running _that_
results in:
```
iptables v1.8.11 (legacy): no command specified
Try `iptables -h' or 'iptables --help' for more information.
```
So what happens if you instead do:
```
exec("/usr/bin/xtables-legacy-multi iptables-legacy -L COUNT -n -v
-x -w", $iptables);
```
?
Alexis.