1 --- busybox-1.3.1/include/libbb.h Wed Dec 27 05:56:18 2006
2 +++ busybox-1.3.1.shadow/include/libbb.h Sat Dec 30 15:24:07 2006
4 #ifdef CONFIG_LOCALE_SUPPORT
7 -#define setlocale(x,y)
8 +#define setlocale(x,y) ((void)0)
13 +/* ifdef it out, because it may include <shadow.h> */
14 +/* and we may not even _have_ <shadow.h>! */
15 #if ENABLE_FEATURE_SHADOWPASSWDS
20 #include <sys/param.h>
26 /* Tested to work correctly (IIRC :]) */
27 --- busybox-1.3.1/libpwdgrp/pwd_grp.c Wed Dec 27 05:56:32 2006
28 +++ busybox-1.3.1.shadow/libpwdgrp/pwd_grp.c Sat Dec 30 15:24:07 2006
31 extern int __parsepwent(void *pw, char *line);
32 extern int __parsegrent(void *gr, char *line);
33 +#if ENABLE_USE_BB_SHADOW
34 extern int __parsespent(void *sp, char *line);
37 extern int __pgsreader(int (*__parserfunc)(void *d, char *line), void *data,
38 char *__restrict line_buff, size_t buflen, FILE *f);
43 +#if ENABLE_USE_BB_SHADOW
44 int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
45 char *__restrict buffer, size_t buflen,
46 struct spwd **__restrict result)
53 /**********************************************************************/
54 /* For the various fget??ent funcs, return NULL on failure and a
59 +#if ENABLE_USE_BB_SHADOW
60 extern int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
61 char *__restrict buffer, size_t buflen,
62 struct spwd **__restrict result);
69 /**********************************************************************/
72 #define DO_GETXXKEY_R_PATHNAME _PATH_GROUP
73 #include "pwd_grp_internal.c"
75 +#if ENABLE_USE_BB_SHADOW
76 #define GETXXKEY_R_FUNC getspnam_R
77 #define GETXXKEY_R_PARSER __parsespent
78 #define GETXXKEY_R_ENTTYPE struct spwd
80 #define DO_GETXXKEY_R_KEYTYPE const char *__restrict
81 #define DO_GETXXKEY_R_PATHNAME _PATH_SHADOW
82 #include "pwd_grp_internal.c"
85 #define GETXXKEY_R_FUNC getpwuid_R
86 #define GETXXKEY_R_PARSER __parsepwent
91 +#if 0 //ENABLE_USE_BB_SHADOW
92 /* This function is non-standard and is currently not built. It seems
93 * to have been created as a reentrant version of the non-standard
94 * functions getspuid. Why getspuid was added, I do not know. */
96 getspuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result);
101 struct passwd *getpwnam(const char *name)
107 +#if ENABLE_USE_BB_SHADOW
108 struct spwd *getspnam(const char *name)
110 static char buffer[PWD_BUFFER_SIZE];
112 getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
117 int getpw(uid_t uid, char *buf)
123 +#if ENABLE_USE_BB_SHADOW
124 static FILE *spf /*= NULL*/;
133 struct passwd *getpwent(void)
139 +#if ENABLE_USE_BB_SHADOW
140 struct spwd *getspent(void)
142 static char line_buff[PWD_BUFFER_SIZE];
144 sgetspent_r(string, &spwd, line_buff, sizeof(line_buff), &result);
149 int initgroups(const char *user, gid_t gid)
155 +#if ENABLE_USE_BB_SHADOW
156 static const unsigned char _sp_off[] = {
157 offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */
158 offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
165 /**********************************************************************/
166 /* Internal uClibc functions. */
169 /**********************************************************************/
171 +#if ENABLE_USE_BB_SHADOW
172 static const unsigned char sp_off[] = {
173 offsetof(struct spwd, sp_namp), /* 0 */
174 offsetof(struct spwd, sp_pwdp), /* 1 */
181 /**********************************************************************/
183 --- busybox-1.3.1/loginutils/passwd.c Wed Dec 27 05:56:20 2006
184 +++ busybox-1.3.1.shadow/loginutils/passwd.c Sat Dec 30 15:24:07 2006
188 filename = bb_path_passwd_file;
189 - if (ENABLE_FEATURE_SHADOWPASSWDS) {
190 +#if ENABLE_FEATURE_SHADOWPASSWDS
192 struct spwd *sp = getspnam(name);
196 pw->pw_passwd = sp->sp_pwdp;
201 /* Decide what the new password will be */
203 --- busybox-1.3.1/loginutils/sulogin.c Wed Dec 27 05:56:20 2006
204 +++ busybox-1.3.1.shadow/loginutils/sulogin.c Sat Dec 30 15:24:07 2006
207 const char * const *p;
212 logmode = LOGMODE_BOTH;
217 - if (ENABLE_FEATURE_SHADOWPASSWDS) {
218 - spwd = getspnam(pwd->pw_name);
219 +#if ENABLE_FEATURE_SHADOWPASSWDS
221 + struct spwd *spwd = getspnam(pwd->pw_name);
225 pwd->pw_passwd = spwd->sp_pwdp;
230 /* cp points to a static buffer that is zeroed every time */