Comment 11 for bug 629234

Revision history for this message
Imre Gergely (cemc) wrote :

This was fixed in Natty but a little bit differently, see bug #656415 . Should the fix be taken from there and SRU'd back to Maverick and Lucid or is the above patch sufficient (or maybe even better) ?

In Natty there is this for checking if the user/group exists:

if ! getent passwd | grep -q "^${_USERNAME}:"
if ! getent group | grep -q "^${_USERNAME}:"

And in this bugreport the fix being suggested in comment #6 is using getent to find the entry, without using grep. If nothing else, it feels cleaner:

if ! getent passwd ${_USERNAME} >/dev/null 2>&1
if ! getent group ${_USERNAME} >/dev/null 2>&1