passwd

Tito 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
> http://lists.busybox.net/mailman/listinfo/busybox
> 

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

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.

Ciao,
Tito


More information about the busybox mailing list