chmod_bpf 757 B

12345678910111213141516171819
  1. #! /bin/sh
  2. #
  3. # Unfortunately, macOS's devfs is based on the old FreeBSD
  4. # one, not the current one, so there's no way to configure it
  5. # to create BPF devices with particular owners or groups.
  6. # This startup item will make it owned by the admin group,
  7. # with permissions rw-rw----, so that anybody in the admin
  8. # group can use programs that capture or send raw packets.
  9. #
  10. # Change this as appropriate for your site, e.g. to make
  11. # it owned by a particular user without changing the permissions,
  12. # so only that user and the super-user can capture or send raw
  13. # packets, or give it the permissions rw-r-----, so that
  14. # only the super-user can send raw packets but anybody in the
  15. # admin group can capture packets.
  16. #
  17. chgrp admin /dev/bpf*
  18. chmod g+rw /dev/bpf*