darwin: improve the error message on kernel driver detach failure
authorNathan Hjelm <hjelmn@google.com>
Sun, 8 Aug 2021 15:16:38 +0000 (09:16 -0600)
committerNathan Hjelm <hjelmn@google.com>
Sun, 8 Aug 2021 15:19:21 +0000 (09:19 -0600)
commit993b28c400b97e65fc1c457f112e2a9c2fd1d912
tree554d2772aeae2682a2db9825e9fbbc0ff0ca5763
parent3ed54c52b1ece08eae21774fbac50a5cc16bae93
darwin: improve the error message on kernel driver detach failure

Detaching a kernel driver in macOS requires that either the binary has the
com.apple.vm.device-access entitlement or is run with effective UID 0 (root). This
commit adds an effective UID check before attempting to capture a device and prints
a warning that neither is the user root nor does the binary have the correct
entitlement.

Signed-off-by: Nathan Hjelm <hjelmn@google.com>
libusb/os/darwin_usb.c
libusb/version_nano.h