diff options
author | guy <guy> | 2004-10-18 09:51:02 +0000 |
---|---|---|
committer | guy <guy> | 2004-10-18 09:51:02 +0000 |
commit | 4b1ac36c836ee326f778742bc28dd3b374702281 (patch) | |
tree | 6fe9e5a997062d91165fb5e28a2bad4e4e5d8d76 /ChmodBPF/ChmodBPF | |
parent | 59f566ecfb799e4ca8107be1b8742850ce7748ff (diff) | |
download | libpcap-4b1ac36c836ee326f778742bc28dd3b374702281.tar.gz |
Add an OS X startup item to set the permissions and/or ownership of the
BPF devices, and add a README.macosx file to explain how to install and
use that startup item.
Diffstat (limited to 'ChmodBPF/ChmodBPF')
-rwxr-xr-x | ChmodBPF/ChmodBPF | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ChmodBPF/ChmodBPF b/ChmodBPF/ChmodBPF new file mode 100755 index 00000000..ee371218 --- /dev/null +++ b/ChmodBPF/ChmodBPF @@ -0,0 +1,33 @@ +#! /bin/sh + +. /etc/rc.common + +StartService () +{ + # + # Unfortunately, Mac OS X's devfs is based on the old FreeBSD + # one, not the current one, so there's no way to configure it + # to create BPF devices with particular owners or groups. + # This startup item will make it owned by the admin group, + # with permissions rw-rw----, so that anybody in the admin + # group can use programs that capture or send raw packets. + # + # Change this as appropriate for your site, e.g. to make + # it owned by a particular user without changing the permissions, + # so only that user and the super-user can capture or send raw + # packets, or give it the permissions rw-r-----, so that + # only the super-user can send raw packets but anybody in the + # admin group can capture packets. + # + chgrp admin /dev/bpf* + chmod g+rw /dev/bpf* +} + +StopService () +{ + return 0; +} + +RestartService () { StartService; } + +RunService "$1" |