diff options
author | Mike Frysinger <vapier@gentoo.org> | 2004-02-27 20:37:03 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2004-02-27 20:37:03 +0000 |
commit | 0882ebb88f74d7cbae922a99c80a38ea15587e61 (patch) | |
tree | fe1b03cac0552a34318e5ee766f4cd1f4d80bfbe /eclass/eutils.eclass | |
parent | So long perl 5.6.1. We knew thee well. (diff) | |
download | historical-0882ebb88f74d7cbae922a99c80a38ea15587e61.tar.gz historical-0882ebb88f74d7cbae922a99c80a38ea15587e61.tar.bz2 historical-0882ebb88f74d7cbae922a99c80a38ea15587e61.zip |
handle cases where requested uid is already taken #41657
Diffstat (limited to 'eclass/eutils.eclass')
-rw-r--r-- | eclass/eutils.eclass | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index c49014940c15..50ed27adb78a 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.81 2004/02/24 03:53:26 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.82 2004/02/27 20:37:03 vapier Exp $ # # Author: Martin Schlemmer <azarah@gentoo.org> # @@ -519,7 +519,14 @@ enewuser() { then if [ "${euid}" -gt 0 ] then - opts="${opts} -u ${euid}" + chown ${euid} ${tmpfile} >& /dev/null + realuser="`ls -l ${tmpfile} | awk '{print $3}'`" + if [ "${realuser//[0-9]}" != "" ] + then + euid="uid is taken; using next available" + else + opts="${opts} -u ${euid}" + fi else eerror "Userid given but is not greater than 0 !" die "${euid} is not a valid UID" |