6 ms·
> The first couple of lines in the trace seem to be pretty clearly related to setting up the sudo part of the command. This is not correct. "sudo dtruss" makes
by Hello71 8y ago
> The first couple of lines in the trace seem to be pretty clearly related to setting up the sudo part of the command.
This is not correct. "sudo dtruss" makes sudo run dtruss, so it is not possible for dtruss to track what sudo is doing. You can see what "sudo" does (which is much more complicated) by running "sudo dtruss sudo". You need sudo twice because sudo is a setuid program, and obviously it would be insecure to allow anybody to trace a setuid program (for example, it has to read the shadow file, so if you could trace it then you could dump all the hashes and crack them on your own time).
On a separate note, it's probably a bad idea to go reading Linux man pages and expect those to give you accurate information about Mac system calls.
- jwilk 8y agoI don't think OP wanted to trace sudo. But then I'm not sure what sudo was for... Does dtruss require root privileges?
- cowsandmilk 8y agoif you run without sudo, you get "dtrace: failed to initialize dtrace: DTrace requires additional privileges"
- temprature 8y agoIndeed, surely Mac OS includes its own man pages? man 2 mprotect, man 2 unlink
- saagarjha 8y agoIt does, but they generally match those in Linux pretty closely due to POSIX.