Re:Unraveling rm: what happens when you run it?
by temprature on Tuesday April 24, 2018 @12:42PM
(#16914207)
Indeed, surely Mac OS includes its own man pages? man 2 mprotect, man 2 unlink
Re:Unraveling rm: what happens when you run it?
by saagarjha on Tuesday April 24, 2018 @04:39PM
(#16916345)
It does, but they generally match those in Linux pretty closely due to POSIX.
Re:Unraveling rm: what happens when you run it?
by cat199 on Tuesday April 24, 2018 @07:09PM
(#16917462)
on the higher level yes, but anything dealing with lower level things like kernel interfaces, devices, etc no
(similar situation for other unices and posix-likes)
Re:Unraveling rm: what happens when you run it?
by saagarjha on Wednesday April 25, 2018 @01:09AM
(#16918759)
Yes, but mprotect and unlink are both high level API calls.
Re:Unraveling rm: what happens when you run it?
by jwilk on Tuesday April 24, 2018 @12:36PM
(#16914143)
I don't think OP wanted to trace sudo.
But then I'm not sure what sudo was for... Does dtruss require root privileges?
Re:Unraveling rm: what happens when you run it?
by cowsandmilk on Tuesday April 24, 2018 @01:05PM
(#16914442)
if you run without sudo, you get "dtrace: failed to initialize dtrace: DTrace requires additional privileges"
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.