* [PATCH] xfsprogs: use uid/gid instead of actual name to fix install issue
@ 2011-12-23 6:52 b19537
2011-12-23 10:01 ` Dave Chinner
0 siblings, 1 reply; 5+ messages in thread
From: b19537 @ 2011-12-23 6:52 UTC (permalink / raw)
To: xfs; +Cc: Zhenhua Luo
From: Zhenhua Luo <b19537@freescale.com>
> 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@freescale.com>
---
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`
--
1.7.0.4
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] xfsprogs: use uid/gid instead of actual name to fix install issue
2011-12-23 6:52 [PATCH] xfsprogs: use uid/gid instead of actual name to fix install issue b19537
@ 2011-12-23 10:01 ` Dave Chinner
2011-12-23 14:20 ` Luo Zhenhua-B19537
0 siblings, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2011-12-23 10:01 UTC (permalink / raw)
To: b19537; +Cc: xfs
On Fri, Dec 23, 2011 at 02:52:53PM +0800, b19537@freescale.com wrote:
> From: Zhenhua Luo <b19537@freescale.com>
>
> > 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@freescale.com>
> ---
> 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@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] xfsprogs: use uid/gid instead of actual name to fix install issue
2011-12-23 10:01 ` Dave Chinner
@ 2011-12-23 14:20 ` Luo Zhenhua-B19537
2011-12-23 21:08 ` Dave Chinner
0 siblings, 1 reply; 5+ messages in thread
From: Luo Zhenhua-B19537 @ 2011-12-23 14:20 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs@oss.sgi.com
If the specified user/group is invalid, I think this should be an usage error instead of script error.
Current the problem I met is that, even if I specified a valid user/group of my host, "chown user:group file" failed, after switching to corresponding uid/gid, the script can be executed successfully during the install process.
Best Regards,
Zhenhua
> -----Original Message-----
> From: Dave Chinner [mailto:david@fromorbit.com]
> Sent: Friday, December 23, 2011 6:02 PM
> To: Luo Zhenhua-B19537
> Cc: xfs@oss.sgi.com
> Subject: Re: [PATCH] xfsprogs: use uid/gid instead of actual name to fix install
> issue
>
> On Fri, Dec 23, 2011 at 02:52:53PM +0800, b19537@freescale.com wrote:
> > From: Zhenhua Luo <b19537@freescale.com>
> >
> > > 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@freescale.com>
> > ---
> > 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@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] xfsprogs: use uid/gid instead of actual name to fix install issue
2011-12-23 14:20 ` Luo Zhenhua-B19537
@ 2011-12-23 21:08 ` Dave Chinner
2011-12-26 3:39 ` Luo Zhenhua-B19537
0 siblings, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2011-12-23 21:08 UTC (permalink / raw)
To: Luo Zhenhua-B19537; +Cc: xfs@oss.sgi.com
On Fri, Dec 23, 2011 at 02:20:24PM +0000, Luo Zhenhua-B19537 wrote:
> If the specified user/group is invalid, I think this should be an
> usage error instead of script error.
Hold on - how are you getting an invalid uid/gid? Those values are
set by the configure script to the uid/gid of the builder process,
and so should -never- be invalid.
Are you building on one machine, rsyncing to another machine with
different user/groups and then running make install? If so, you are
using make install incorrectly. make install is designed to install
the binaries on the host that they were built, not some other random
machine. If you are going to install binaries on a different machine
to where they were built, you are supposed to build a tarball, a
.deb or .rpm package and install that. Those targets are macine
independent and won't have install problems.
> Current the problem I met is that, even if I specified a valid
> user/group of my host, "chown user:group file" failed, after
> switching to corresponding uid/gid, the script can be executed
> successfully during the install process.
I had to manually change the include/builddefs file to have an
invalid PKG_USER/PKG_GROUP variables to get chown to fail because
all my build/test machines have consistent uid/gid entries, so even
build/rsync/install works without fail....
And if you look at what your change actually does, the script still
executes and installs -some- stuff, it just doesn't run the chown
because _chown() is now not passed the correct number of parameters.
IOWs, the script now fails with a partial install with no indication
of what was installed or not.
If you are going to check whether uid/gid exist, you need to exit
immediately if they don't exist, not allow the script to continue.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] xfsprogs: use uid/gid instead of actual name to fix install issue
2011-12-23 21:08 ` Dave Chinner
@ 2011-12-26 3:39 ` Luo Zhenhua-B19537
0 siblings, 0 replies; 5+ messages in thread
From: Luo Zhenhua-B19537 @ 2011-12-26 3:39 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs@oss.sgi.com
> -----Original Message-----
> From: Dave Chinner [mailto:david@fromorbit.com]
> Sent: Saturday, December 24, 2011 5:08 AM
> > If the specified user/group is invalid, I think this should be an
> > usage error instead of script error.
>
> Hold on - how are you getting an invalid uid/gid? Those values are set by the
> configure script to the uid/gid of the builder process, and so should -never- be
> invalid.
[Luo Zhenhua-B19537] The username/group are set by configure script and valid value are used during my install process.
> Are you building on one machine, rsyncing to another machine with different
> user/groups and then running make install? If so, you are using make install
> incorrectly. make install is designed to install the binaries on the host that
> they were built, not some other random machine. If you are going to install
> binaries on a different machine to where they were built, you are supposed to
> build a tarball, a .deb or .rpm package and install that. Those targets are
> macine independent and won't have install problems.
[Luo Zhenhua-B19537] I built it only on a host, no other machine is involved. What surprised me is I can run the chmod command successfully, but the same command failed in the install script. After using uid/gid, it can run correctly both in manual way and in the script. The purpose of my patch is to resolve this issue.
> > Current the problem I met is that, even if I specified a valid
> > user/group of my host, "chown user:group file" failed, after switching
> > to corresponding uid/gid, the script can be executed successfully
> > during the install process.
>
> I had to manually change the include/builddefs file to have an invalid
> PKG_USER/PKG_GROUP variables to get chown to fail because all my build/test
> machines have consistent uid/gid entries, so even build/rsync/install works
> without fail....
>
> And if you look at what your change actually does, the script still executes and
> installs -some- stuff, it just doesn't run the chown because _chown() is now not
> passed the correct number of parameters.
> IOWs, the script now fails with a partial install with no indication of what was
> installed or not.
>
> If you are going to check whether uid/gid exist, you need to exit immediately if
> they don't exist, not allow the script to continue.
[Luo Zhenhua-B19537] Makes sense.
Best Regards,
Zhenhua
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-12-26 3:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-23 6:52 [PATCH] xfsprogs: use uid/gid instead of actual name to fix install issue b19537
2011-12-23 10:01 ` Dave Chinner
2011-12-23 14:20 ` Luo Zhenhua-B19537
2011-12-23 21:08 ` Dave Chinner
2011-12-26 3:39 ` Luo Zhenhua-B19537
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox