Forum > macOS / Mac OS X
FileExists Returns False Under sudo
msintle:
When you run your app as root/wheel on macOS, and create a file under that kind of ownership, fpAccess returns -1 on the file, even when it exists.
This results in the problem that FileExists returns false on files created/owned by root/wheel, even when the app is running under sudo.
I've implemented a workaround in my code using TFileStream which doesn't have this problem, but then I lose the capability to NOT follow links in my custom FileExists replacement.
The issue does NOT happen on Linux - any thoughts on how to address it?
jwdietrich:
Can you post a simple code example, so that we can reproduce the issue?
TRon:
Background info. Wheel group is special. What is strange is that you mention being able to circumvent by using a stream.
jwdietrich:
The wheel group has been replaced by the admin group in macOS 10.3 and newer versions.
Thaddy:
In newer versions the wheel group is not used at all, it does nothing, but may still exist because of upgrades. That may also be the case. Change it to the admin group. (Sorry, posts crossed).
Note I believe I have seen a tool that migrates the wheels group to admin. Never used it, though.
Navigation
[0] Message Index
[#] Next page