farmatito at tiscali.it
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 busybox.net
/* Just in case libc doesn't define some of these... */
#define _PATH_PASSWD "/etc/passwd"
#define _PATH_GROUP "/etc/group"
#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