From 2e2ca30312fb49d5ae98e71896a5bd483ac59b17 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 26 Nov 2011 06:50:27 +0000 Subject: re-use "eshell" when searching for a shell to avoid missing "local shell" decl pointed out by Brian Harring --- eclass/user.eclass | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/eclass/user.eclass b/eclass/user.eclass index d46d3b2ce54c..07ebc90c8a2d 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.12 2011/11/26 06:45:38 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.13 2011/11/26 06:50:27 vapier Exp $ # @ECLASS: user.eclass # @MAINTAINER: @@ -155,21 +155,19 @@ enewuser() { die "Pass '-1' as the shell parameter" fi else - for shell in /sbin/nologin /usr/sbin/nologin /bin/false /usr/bin/false /dev/null ; do - [[ -x ${ROOT}${shell} ]] && break + for eshell in /sbin/nologin /usr/sbin/nologin /bin/false /usr/bin/false /dev/null ; do + [[ -x ${ROOT}${eshell} ]] && break done - if [[ ${shell} == "/dev/null" ]] ; then + if [[ ${eshell} == "/dev/null" ]] ; then eerror "Unable to identify the shell to use, proceeding with userland default." case ${USERLAND} in - GNU) shell="/bin/false" ;; - BSD) shell="/sbin/nologin" ;; - Darwin) shell="/usr/sbin/nologin" ;; + GNU) eshell="/bin/false" ;; + BSD) eshell="/sbin/nologin" ;; + Darwin) eshell="/usr/sbin/nologin" ;; *) die "Unable to identify the default shell for userland ${USERLAND}" esac fi - - eshell=${shell} fi einfo " - Shell: ${eshell}" opts+=" -s ${eshell}" -- cgit v1.2.3-65-gdbad