svn commit: branches/busybox_1_3_stable: include libpwdgrp loginutils

vda at busybox.net vda at busybox.net
Sat Jan 20 20:20:34 UTC 2007


Author: vda
Date: 2007-01-20 12:20:32 -0800 (Sat, 20 Jan 2007)
New Revision: 17407

Log:
releasing busybox 1.3.2


Modified:
   branches/busybox_1_3_stable/Makefile
   branches/busybox_1_3_stable/include/libbb.h
   branches/busybox_1_3_stable/libpwdgrp/pwd_grp.c
   branches/busybox_1_3_stable/loginutils/passwd.c
   branches/busybox_1_3_stable/loginutils/sulogin.c


Changeset:
Modified: branches/busybox_1_3_stable/Makefile
===================================================================
--- branches/busybox_1_3_stable/Makefile	2007-01-20 20:14:31 UTC (rev 17406)
+++ branches/busybox_1_3_stable/Makefile	2007-01-20 20:20:32 UTC (rev 17407)
@@ -1,8 +1,8 @@
 VERSION = 1
 PATCHLEVEL = 3
-SUBLEVEL = 1
+SUBLEVEL = 2
 EXTRAVERSION =
-NAME = Christmas Tree
+NAME = Unnamed
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"

Modified: branches/busybox_1_3_stable/include/libbb.h
===================================================================
--- branches/busybox_1_3_stable/include/libbb.h	2007-01-20 20:14:31 UTC (rev 17406)
+++ branches/busybox_1_3_stable/include/libbb.h	2007-01-20 20:20:32 UTC (rev 17407)
@@ -46,11 +46,13 @@
 #ifdef CONFIG_LOCALE_SUPPORT
 #include <locale.h>
 #else
-#define setlocale(x,y)
+#define setlocale(x,y) ((void)0)
 #endif
 
 #include "pwd_.h"
 #include "grp_.h"
+/* ifdef it out, because it may include <shadow.h> */
+/* and we may not even _have_ <shadow.h>! */
 #if ENABLE_FEATURE_SHADOWPASSWDS
 #include "shadow_.h"
 #endif
@@ -59,7 +61,7 @@
 #include <limits.h>
 #include <sys/param.h>
 #ifndef PATH_MAX
-#define  PATH_MAX         256
+#define PATH_MAX 256
 #endif
 
 /* Tested to work correctly (IIRC :]) */

Modified: branches/busybox_1_3_stable/libpwdgrp/pwd_grp.c
===================================================================
--- branches/busybox_1_3_stable/libpwdgrp/pwd_grp.c	2007-01-20 20:14:31 UTC (rev 17406)
+++ branches/busybox_1_3_stable/libpwdgrp/pwd_grp.c	2007-01-20 20:20:32 UTC (rev 17407)
@@ -52,7 +52,9 @@
 
 extern int __parsepwent(void *pw, char *line);
 extern int __parsegrent(void *gr, char *line);
+#if ENABLE_USE_BB_SHADOW
 extern int __parsespent(void *sp, char *line);
+#endif
 
 extern int __pgsreader(int (*__parserfunc)(void *d, char *line), void *data,
 		char *__restrict line_buff, size_t buflen, FILE *f);
@@ -103,6 +105,7 @@
 	return rv;
 }
 
+#if ENABLE_USE_BB_SHADOW
 int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
 				char *__restrict buffer, size_t buflen,
 				struct spwd **__restrict result)
@@ -117,6 +120,7 @@
 
 	return rv;
 }
+#endif
 
 /**********************************************************************/
 /* For the various fget??ent funcs, return NULL on failure and a
@@ -144,6 +148,7 @@
 	return result;
 }
 
+#if ENABLE_USE_BB_SHADOW
 extern int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
 				char *__restrict buffer, size_t buflen,
 				struct spwd **__restrict result);
@@ -184,6 +189,7 @@
  DONE:
 	return rv;
 }
+#endif
 
 /**********************************************************************/
 
@@ -207,6 +213,7 @@
 #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP
 #include "pwd_grp_internal.c"
 
+#if ENABLE_USE_BB_SHADOW
 #define GETXXKEY_R_FUNC			getspnam_R
 #define GETXXKEY_R_PARSER		__parsespent
 #define GETXXKEY_R_ENTTYPE		struct spwd
@@ -214,6 +221,7 @@
 #define DO_GETXXKEY_R_KEYTYPE	const char *__restrict
 #define DO_GETXXKEY_R_PATHNAME  _PATH_SHADOW
 #include "pwd_grp_internal.c"
+#endif
 
 #define GETXXKEY_R_FUNC			getpwuid_R
 #define GETXXKEY_R_PARSER		__parsepwent
@@ -253,6 +261,7 @@
 	return result;
 }
 
+#if 0 //ENABLE_USE_BB_SHADOW
 /* This function is non-standard and is currently not built.  It seems
  * to have been created as a reentrant version of the non-standard
  * functions getspuid.  Why getspuid was added, I do not know. */
@@ -286,6 +295,7 @@
 	getspuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result);
 	return result;
 }
+#endif
 
 struct passwd *getpwnam(const char *name)
 {
@@ -307,6 +317,7 @@
 	return result;
 }
 
+#if ENABLE_USE_BB_SHADOW
 struct spwd *getspnam(const char *name)
 {
 	static char buffer[PWD_BUFFER_SIZE];
@@ -316,6 +327,7 @@
 	getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
 	return result;
 }
+#endif
 
 int getpw(uid_t uid, char *buf)
 {
@@ -444,6 +456,7 @@
 	return rv;
 }
 
+#if ENABLE_USE_BB_SHADOW
 static FILE *spf /*= NULL*/;
 void setspent(void)
 {
@@ -488,6 +501,7 @@
 	UNLOCK;
 	return rv;
 }
+#endif
 
 struct passwd *getpwent(void)
 {
@@ -509,6 +523,7 @@
 	return result;
 }
 
+#if ENABLE_USE_BB_SHADOW
 struct spwd *getspent(void)
 {
 	static char line_buff[PWD_BUFFER_SIZE];
@@ -528,6 +543,7 @@
 	sgetspent_r(string, &spwd, line_buff, sizeof(line_buff), &result);
 	return result;
 }
+#endif
 
 int initgroups(const char *user, gid_t gid)
 {
@@ -643,6 +659,7 @@
 	return rv;
 }
 
+#if ENABLE_USE_BB_SHADOW
 static const unsigned char _sp_off[] = {
 	offsetof(struct spwd, sp_lstchg),	/* 2 - not a char ptr */
 	offsetof(struct spwd, sp_min),		/* 3 - not a char ptr */
@@ -688,6 +705,7 @@
 DO_UNLOCK:
 	return rv;
 }
+#endif
 
 /**********************************************************************/
 /* Internal uClibc functions.					 */
@@ -846,6 +864,7 @@
 
 /**********************************************************************/
 
+#if ENABLE_USE_BB_SHADOW
 static const unsigned char sp_off[] = {
 	offsetof(struct spwd, sp_namp),		/* 0 */
 	offsetof(struct spwd, sp_pwdp),		/* 1 */
@@ -900,6 +919,7 @@
 
 	return EINVAL;
 }
+#endif
 
 /**********************************************************************/
 

Modified: branches/busybox_1_3_stable/loginutils/passwd.c
===================================================================
--- branches/busybox_1_3_stable/loginutils/passwd.c	2007-01-20 20:14:31 UTC (rev 17406)
+++ branches/busybox_1_3_stable/loginutils/passwd.c	2007-01-20 20:20:32 UTC (rev 17407)
@@ -275,7 +275,8 @@
 	}
 
 	filename = bb_path_passwd_file;
-	if (ENABLE_FEATURE_SHADOWPASSWDS) {
+#if ENABLE_FEATURE_SHADOWPASSWDS
+	{
 		struct spwd *sp = getspnam(name);
 		if (!sp) {
 			/* LOGMODE_BOTH */
@@ -287,6 +288,7 @@
 			pw->pw_passwd = sp->sp_pwdp;
 		}
 	}
+#endif
 
 	/* Decide what the new password will be */
 	newp = NULL;

Modified: branches/busybox_1_3_stable/loginutils/sulogin.c
===================================================================
--- branches/busybox_1_3_stable/loginutils/sulogin.c	2007-01-20 20:14:31 UTC (rev 17406)
+++ branches/busybox_1_3_stable/loginutils/sulogin.c	2007-01-20 20:20:32 UTC (rev 17407)
@@ -41,7 +41,6 @@
 	char *timeout_arg;
 	const char * const *p;
 	struct passwd *pwd;
-	struct spwd *spwd;
 	const char *shell;
 
 	logmode = LOGMODE_BOTH;
@@ -75,13 +74,15 @@
 		goto auth_error;
 	}
 
-	if (ENABLE_FEATURE_SHADOWPASSWDS) {
-		spwd = getspnam(pwd->pw_name);
+#if ENABLE_FEATURE_SHADOWPASSWDS
+	{
+		struct spwd *spwd = getspnam(pwd->pw_name);
 		if (!spwd) {
 			goto auth_error;
 		}
 		pwd->pw_passwd = spwd->sp_pwdp;
 	}
+#endif
 
 	while (1) {
 		/* cp points to a static buffer that is zeroed every time */




More information about the busybox-cvs mailing list