On Tuesday 30 October 2007 17:15, Jan Engelhardt wrote:
There is no guarantee that "root" or UID 0 actually have the privilege to do this or that. Think Linux Security Modules (LSM)..
No, but that also wasn't the question here.
For the ultimate check, there is little you can do other than try to do
whatever privileged operation you are up to and check for failure. But doing
this "root" check first sounds very sensible to me to catch the most common
cause for problems and (equally important) give the user some useful error
message.
CU
--
Stefan Hundhammer