Permission denied error
Miroslav Lachman
000.fbsd at quip.cz
Wed Mar 10 15:22:29 UTC 2010
serena zanetta wrote:
> Hi,
>
> I’ve got a problem with the packet injection. I’ve tried to send a packet by
> the means of the nemesis suite. Everything works fine since I type the
> command
>
> “nemesis udp …”
>
> on the command line.
>
> If I tried to call the same command via the PHP exec()
>
> exec("nemesis udp $message_to_send",$response);
>
> the nemesis packet injection failed: “/dev/bpf0: Permission denied” !
>
> sprintf(device, "/dev/bpf%d", i);
>
> fd = open(device, O_RDWR);
>
> Gives fd = -1.
Is your PHP script called as user root or www (via Apache)?
bpf device is usable only by root (be default) unless you change the
permissions:
# ls -al /dev/bpf0
crw------- 1 root wheel 0, 170 Aug 25 2009 /dev/bpf0
Miroslav Lachman
More information about the freebsd-net
mailing list