Brandon S. Allbery KF8NH wrote:
Still misunderstanding, I think. Yes, it will fail anyway, but in the general case you're checking to see if as a privileged process it is safe to operate on a given file.

I'd actually been thinking that one would use the check in the opposite direction:

if need_priv() {
  sudo { ... }; # might ask user for passwd
}
else {
  ...
}

But then I'm not an expert in this area: I just want an API that makes it easy to hack simple scripts that do what I need. It was C<chmod> that I really wanted to improve the API for; I touched C<chown> only because it was adjacent in the POD, and it seems reasonable for the two functions/methods to have similar look&feel.

Reply via email to