Unicode issues with ash

Seb sbb at tuxfamily.org
Mon Mar 28 21:20:53 UTC 2011


Le Mon, 28 Mar 2011 20:05:42 +0200
Denys Vlasenko <vda.linux at googlemail.com> a écrit:


> execve("/bin/ash", ["-su"], [/* 10 vars */]) = 0
> 
> AHA. I know why it works in this case. Config you sent me has only two
> applets enabled:
> CONFIG_PWDX=y
> CONFIG_ASH=y
> 
> If you disable pwdx, you end up with "single-applet busybox", and in this case
> it doesn't check program name. Therefore it works in this case.

That's the key! I've tryed a bbx with ash+ls applets and have got the
same error. Then I have thought the test I've previously made was
using an interpretor, so the argv[0] was certainly fed by sh. I've
therefore cooked a little "/tmp/argv" exec with my poor C skill:

  #include <stdio.h>
  #include <stdlib.h>

  int main (int argc, char *argv[]) {
      printf("%s\n", argv[0]);
      return EXIT_SUCCESS;
  }

Here are the results:

  # useradd unibug -s /tmp/argv -d /tmp  -p ""
  # su unibug 
  argv

  # su - unibug
  -su

Nothing to argue anymore, the "dumb bunny" theory is definitively the
good one... damn it!

> So, please try updating su. And updating strace too:
> strace which was adding unnecessary "..." after each string,
> like here:
> read(3, "/bin/bash\n/bin/dash\n/bin/ash\n"..., 4096) = 29
> is known to be buggy.
> 
> What are the versions of those tools on the affected machine?

strace 4.5.18 and shadow 4.1.4.3 (the very last).

@+
Seb.


More information about the busybox mailing list