On 26/07/24 15:20, Peter via Postfix-devel wrote:
... The only issue with this is that you could potentially have a user named "0", but that would also be an issue with the id command above.

Linux systems do not allow usernames that start with a digit (unless you force the issue), but POSIX does. I don't know how many other UNIX systems allow it.  Personally my feeling is that if someone is so brain dead as to actually name an unprivileged user "0" they will get what they deserve and so I would personally be fine with just using find ... -user 0 above.

We could actually check for this issue.  We could do something like this:

if grep -q ^0: /etc/passwd; then
printf '%s\n' 'You have a user that is named "0". We'\''re not even going to try to work with that!' >&2
    exit 1
fi

...

find ... -user 0 ...


Peter
_______________________________________________
Postfix-devel mailing list -- postfix-devel@postfix.org
To unsubscribe send an email to postfix-devel-le...@postfix.org

Reply via email to