Quoting Rainer Groesslinger <[EMAIL PROTECTED]>:Hm, just read the comments on bug 8634 and eutils.eclass. I must be missing something but I can't see the problem ;). Some ebuilds need to be able to add users, hence they may specify at least a name and maybe a uid and other things like the shell... The system has to ensure, that names and uid's are unique (enewuser() does this for the name but not for the uid. adding this it quite trivial.)
I know this issue has been brought up in the past (as I wrote), I just wanted to know if people are actively working on this or if it will take another few months since the "meta bug" for this isn't very active.
I tried to revive it a few times at some point, but folks are busy. Maybe a GLEP would get things started moving in the right direction?
Why not use glibc's NSS via getent() to get all currently used names/uid's? That would solve all LDAP, NIS, WINBIND related problems:
enewuser(){
local euser="$1"; shift
if [ -z "{euser}" ];then
eerror "No username specified !"
die "Cannot call eneuser without a username."
fi
local euid="$1"; shift
local realuser="$(getent passwd | grep ^${euser} | awk -F":" \ '{print $1}')"
if [ "${euser}" == "${realuser}" ];then
return 0
if [ ! -z ${euid} ] && [ ${euid} != "-1" ];then
if [ "${euid}" -gt 0 ];then
for e in $(getent passwd);do
local curr_uid = "$(echo ${e}| awk -F":" '{print $3}')"
if [ "${curr_uid}" == "${euid}" ];then
eerror "uid ${euid} already in use."
die "UID in use."
fi
done
else
eerror "Userid given but is not greater than 0 !"
die "${euid} is not a valid UID"
fi
else
euid = "next available"
fi
einfo " - Userid: ${euid}
... ...
(All errors are mine ;). Comments?
-- [EMAIL PROTECTED] mailing list
