xfs
[Top] [All Lists]

Re: [PATCH] xfsprogs: use uid/gid instead of actual name to fix install

To: b19537@xxxxxxxxxxxxx
Subject: Re: [PATCH] xfsprogs: use uid/gid instead of actual name to fix install issue
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 23 Dec 2011 21:01:35 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1324623173-32707-1-git-send-email-b19537@xxxxxxxxxxxxx>
References: <1324623173-32707-1-git-send-email-b19537@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Dec 23, 2011 at 02:52:53PM +0800, b19537@xxxxxxxxxxxxx wrote:
> From: Zhenhua Luo <b19537@xxxxxxxxxxxxx>
> 
>     > when running install-sh during the install process, following
>       error might appear:
>       > ../../install-sh -o bj -g bj -m 644 -T so_dot_version libhandle.lai 
> /lib; ../../install-sh -o bj -g bj -T so_dot_current libhandle.lai /lib
>       > chown: invalid user: `bj:bj'
>       > chown: invalid user: `bj:bj'
>       > Installing libdisk-install
>       > make[1]: Nothing to be done for `install'.
>       > Installing copy-install
>       > ../install-sh -o bj -g bj -m 755 -d /usr/sbin
>       > chown: invalid user: `bj:bj'
>       > make[1]: *** [install] Error 1
>       > make: *** [copy-install] Error 2
> 
> Signed-off-by: Zhenhua Luo <b19537@xxxxxxxxxxxxx>
> ---
>  include/install-sh |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/install-sh b/include/install-sh
> index 18c051f..9d8ff06 100755
> --- a/include/install-sh
> +++ b/include/install-sh
> @@ -105,10 +105,10 @@ do
>     c)
>       ;;
>     g)
> -     GROUP=$OPTARG
> +     GROUP=`id -g $OPTARG`
>       ;;
>     o)
> -     OWNER=$OPTARG
> +     OWNER=`id -u $OPTARG`
>       ;;
>     m)
>       DIRMODE=`expr $OPTARG`

How does this fix the the problem that the user/group "bj" does
not exist?

$ id -g bj
id: bj: No such user
$ id -g bj 2> /dev/null
$

All this patch does is result in a OWNER/GROUP variable that is
empty when an invalid user/group is specified. Hence it will make
the install complete with a different user to the one specified in
the install command line. It should error out (like it does now) if
a user/group does not exist, not install as some other (unknown)
user.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>