summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2004-02-27 20:37:03 +0000
committerMike Frysinger <vapier@gentoo.org>2004-02-27 20:37:03 +0000
commit7c779cdcd9f1a45b70bc1aa44237e1b2475f3a9b (patch)
treef3e4685ca16bab0ca6768ed001560be34629a9fd /eclass/eutils.eclass
parentSo long perl 5.6.1. We knew thee well. (Manifest recommit) (diff)
downloadgentoo-2-7c779cdcd9f1a45b70bc1aa44237e1b2475f3a9b.tar.gz
gentoo-2-7c779cdcd9f1a45b70bc1aa44237e1b2475f3a9b.tar.bz2
gentoo-2-7c779cdcd9f1a45b70bc1aa44237e1b2475f3a9b.zip
handle cases where requested uid is already taken #41657
Diffstat (limited to 'eclass/eutils.eclass')
-rw-r--r--eclass/eutils.eclass11
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"