Tito farmatito at
Mon May 9 19:58:58 UTC 2011

On Monday 09 May 2011 19:01:01 Sergey Naumov wrote:
> Hello, guys.
> May be you know how to forge /etc/passwd file for embedded system? I
> can't execute target passwd (also adduser etc.) on the host machine
> and host's version can only write into /etc/passwd. Is there more
> reliable and elegant way than to make a backup of current files, forge
> new ones and then restore originals (so how to force passwd and
> company to use another file to deal with)?
> Thanks in advance,
> Sergey Naumov.
> _______________________________________________
> busybox mailing list
> busybox at

/* Just in case libc doesn't define some of these... */
#ifndef _PATH_PASSWD
#define _PATH_PASSWD  "/etc/passwd"
#ifndef _PATH_GROUP
#define _PATH_GROUP   "/etc/group"
#ifndef _PATH_SHADOW
#define _PATH_SHADOW  "/etc/shadow"
#define _PATH_GSHADOW "/etc/gshadow"

maybe you can change this paths in libbb.h.
I did it to test bb loginutils in /$HOME/etc/passwd and so on.
If i recall it correctly it was needed to enable CONFIG_USE_BB_PWD_GRP for this to work.
Just my 0,2 cents.


More information about the busybox mailing list