hello Tito,
Thanks for your reply.My /etc/passwd and /etc/shadow do exist,some
other problem?
eric
Post by lee erichello all
I used busybox to build my linux.After i installed busybox,some=20
command did not work.For example,wher i used 'passwd',it said 'unknown uid 0'.
What is the problem?How can i solve it?
thanks
Maybe /etc/passwd or /etc/shadow are missing?
Ciao,
Tito
Hi,
the only place where this error message can be generated is:
passwd.c line 172: myname = (char *) bb_xstrdup(bb_getpwuid(NULL, getuid(), -1));
by looking at it:
getuid: as per man page : These functions are always successful.
so it is bb_getpwuid which is failing:
/* Hacked by Tito Ragusa (c) 2004 <farmatito at tiscali.it> to make it more
* flexible :
*
* if bufsize is > 0 char *name can not be set to NULL.
* On success username is written on the static allocated
* buffer name (and a pointer to it is returned).
* On failure uid as string is written to the static
* allocated buffer name and NULL is returned.
* if bufsize is = 0 char *name can be set to NULL.
* On success username is returned.
* On failure NULL is returned.
* if bufsize is < 0 char *name can be set to NULL
* On success username is returned.
* On failure an error message is printed and
* the program exits.
*/
So or something is wrong with your /etc/passwd or /etc/shadow (formatting ?)
or you are missing some libraries.
You can try:
strace -o out.txt ./busybox passwd some_user
and inspect the out.txt file to see what is happening.
Remeber that depending on your .config busybox needs:
open("/etc/nsswitch.conf", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libcrypt.so.1", O_RDONLY) = 3
and some lib_nss*.so libs
open("/lib/tls/i686/cmov/libnss_compat.so.2", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libnsl.so.1", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libnss_nis.so.2", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libnss_files.so.2", O_RDONLY) = 3 <---- at least this one if I remember correctly
So please check you have all the needed libraries.
Ciao,
Tito