[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [BusyBox] patch to replace /etc/shadow
From:       Nick Fedchik <nick () fedchik ! org ! ua>
Date:       2003-06-26 8:42:16
[Download RAW message or body]

> The patch makes able to change standard place of shadow db
> (/etc/shadow) to another directory. It's depend on busybox shadow
> file usage only.
Slightly modified patch instead of the previous patch.
Thanks for Vladimir Oleynik.

-- 
Best regards, Nick Fedchik
FNM3-RIPE(-UANIC) http://www.fedchik.org.ua

["bb-shadow-replace.patch" (text/x-diff)]

diff -urN busybox/include/shadow_.h busybox-patched/include/shadow_.h
--- busybox/include/shadow_.h	2002-06-23 07:24:20 +0300
+++ busybox-patched/include/shadow_.h	2003-06-26 10:23:20 +0300
@@ -35,6 +35,12 @@
 #include <shadow.h>
 #else
 
+#ifdef CONFIG_USE_BB_SHADOW_PREFIX
+#define SHADOW_FILE        CONFIG_USE_BB_SHADOW_PREFIX"/shadow"
+#else
+#define SHADOW_FILE        "/etc/shadow"
+#endif
+
 /*
  * This information is not derived from AT&T licensed sources.  Posted
  * to the USENET 11/88, and updated 11/90 with information from SVR4.
diff -urN busybox/libbb/messages.c busybox-patched/libbb/messages.c
--- busybox/libbb/messages.c	2003-03-19 11:12:07 +0200
+++ busybox-patched/libbb/messages.c	2003-06-26 11:23:26 +0300
@@ -62,8 +62,12 @@
 #endif
 
 #ifdef L_shadow_file
-#define SHADOW_FILE        "/etc/shadow"
+#ifdef CONFIG_USE_BB_SHADOW_PREFIX
+#define SHADOW_FILE        CONFIG_USE_BB_SHADOW_PREFIX"/shadow"
 const char * const bb_path_shadow_file = SHADOW_FILE;
+#else
+#define SHADOW_FILE        "/etc/shadow"
+#endif
 #endif
 
 #ifdef L_group_file
diff -urN busybox/libpwdgrp/shadow.c busybox-patched/libpwdgrp/shadow.c
--- busybox/libpwdgrp/shadow.c	2003-03-19 11:12:14 +0200
+++ busybox-patched/libpwdgrp/shadow.c	2003-06-26 10:58:27 +0300
@@ -54,8 +54,7 @@
 	if (shadow) {
 		rewind(shadow);
 	} else {
-		if ((shadow = fopen("/etc/shadow", "r")) == NULL)
-			bb_perror_msg_and_die("/etc/shadow");
+               shadow = bb_xfopen(SHADOW_FILE, "r");
 	}
 }
 
diff -urN busybox/loginutils/Config.in busybox-patched/loginutils/Config.in
--- busybox/loginutils/Config.in	2003-01-21 02:12:11 +0200
+++ busybox-patched/loginutils/Config.in	2003-06-26 10:23:20 +0300
@@ -95,5 +95,12 @@
 	help
 	  Please submit a patch to add help text for this item.
 
+config CONFIG_USE_BB_SHADOW_PREFIX
+	string "   Use busybox shadow password prefix"
+	default "/etc"
+	depends on CONFIG_USE_BB_SHADOW
+	help
+	  Define Your directory to install BusyBox shadow plaintext db.
+
 endmenu
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic