Le Sun, 27 Mar 2011 19:03:16 +0100
Denys Vlasenko <[email protected]> a écrit:

> > > Apparently, your /bin/su is a symlink to busybox which doesn't have
> > > su applet enabled.
> > 
> > Impossible, as I install busybox directly as /bin/ash (no symlink),
> 
> Your /bin/su, NOT your /bin/ash, is bad.
> What "ls -l `which su`" says?
 
  $ ls -l `which su`
   -rws--x--x 1 root root 56229 2010-02-28 21:16 /bin/su

> > the su is the one of my Slackware (shadow-4.1.4.2). Are you sure here
> > the user uses the ./ash exec as login shell? Below is the test I do:
> > 
> >  # useradd unibug -s /bin/ash -d /tmp  -p ""
> >  # su - unibug
> >   su: applet not found
> 
> Look closely above WHAT EXACTLY fails. It's su command. I bet even
> "su --help" will fail.

  $ su --help
   Usage: su [options] [LOGIN]

   Options:
     -c, --command COMMAND         pass COMMAND to the invoked shell
     -h, --help                    display this help message and exit
     -, -l, --login                make the shell a login shell
     -m, -p,
     --preserve-environment        do not reset environment variables,
                                   and keep the same shell
     -s, --shell SHELL             use SHELL instead of the default in
                                   passwd

I don't use the bbx "make install"; I take the busybox exe and copy
it as "/bin/ash", so I'm sure "su" can't be anything else than the
Slackware "su". Moreover, I can switch all the users that don't use
/bin/ash. Here I think su fails for an unknown reason and
report the stderr of the ran exe -- here /bin/ash -- so we get a
typical bbx "applet not found" error. Sure, it's a very weird bug, but
I'm not nuts: it comes from ash, so much it disapears when I drop
pwdx and pstree from the config and re-appears when I reintroduce
one of them.

I've just redone the test with the very last git release and get the
same :

  
http://git.busybox.net/busybox/snapshot/busybox-a9e5c43b8b9b5d18b6aae08452fe2a3a46a248b4.tar.bz2

I think something *in ash* makes ash to believe it was called as "su",
instead of "/bin/ash". My su works fine with all other commands, so I
really think it does not come from it -- I would have met many
other problems if it was the case:

  # echo -e '#!/bin/sh\necho $0' >/tmp/ok
  # userdel unibug
  # useradd unibug -s /tmp/ok -d /tmp  -p ""
  # su - unibug
   /tmp/ok

Above, su calls well what it is supposed to call.


@+
Seb.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to