Hi,
this trivial patch moves passwd, shadow group and gshadow path definitions to
libbb.h
and defines them only if the used libc doesn't define them.
Compile tested with glibc and with CONFIG_USE_BB_PWD_GRP=y/n.
Works fine for me. Please apply if you like it.
Ciao,
Tito
--- libpwdgrp/pwd_grp.c.orig 2011-01-11 15:25:39.000000000 +0100
+++ libpwdgrp/pwd_grp.c 2011-01-13 22:36:44.000000000 +0100
@@ -20,16 +20,6 @@
#include "libbb.h"
#include <assert.h>
-#ifndef _PATH_SHADOW
-#define _PATH_SHADOW "/etc/shadow"
-#endif
-#ifndef _PATH_PASSWD
-#define _PATH_PASSWD "/etc/passwd"
-#endif
-#ifndef _PATH_GROUP
-#define _PATH_GROUP "/etc/group"
-#endif
-
/**********************************************************************/
/* Sizes for statically allocated buffers. */
--- include/libbb.h.orig 2011-01-11 15:25:42.000000000 +0100
+++ include/libbb.h 2011-01-13 22:36:42.000000000 +0100
@@ -1604,10 +1604,22 @@
* get the list of currently mounted filesystems */
#define bb_path_mtab_file
IF_FEATURE_MTAB_SUPPORT("/etc/mtab")IF_NOT_FEATURE_MTAB_SUPPORT("/proc/mounts")
-#define bb_path_passwd_file "/etc/passwd"
-#define bb_path_shadow_file "/etc/shadow"
-#define bb_path_gshadow_file "/etc/gshadow"
-#define bb_path_group_file "/etc/group"
+#ifndef _PATH_SHADOW
+#define _PATH_SHADOW "/etc/shadow"
+#endif
+#ifndef _PATH_PASSWD
+#define _PATH_PASSWD "/etc/passwd"
+#endif
+#ifndef _PATH_GROUP
+#define _PATH_GROUP "/etc/group"
+#endif
+#ifndef _PATH_GSHADOW
+#define _PATH_GSHADOW "/etc/gshadow"
+#endif
+#define bb_path_passwd_file _PATH_PASSWD
+#define bb_path_shadow_file _PATH_SHADOW
+#define bb_path_gshadow_file _PATH_GSHADOW
+#define bb_path_group_file _PATH_GROUP
#define bb_path_motd_file "/etc/motd"
Move passwd, shadow group and gshadow path definitions to libbb.h.
Signed-off-by: <[email protected]>
--- libpwdgrp/pwd_grp.c.orig 2011-01-11 15:25:39.000000000 +0100
+++ libpwdgrp/pwd_grp.c 2011-01-13 22:36:44.000000000 +0100
@@ -20,16 +20,6 @@
#include "libbb.h"
#include <assert.h>
-#ifndef _PATH_SHADOW
-#define _PATH_SHADOW "/etc/shadow"
-#endif
-#ifndef _PATH_PASSWD
-#define _PATH_PASSWD "/etc/passwd"
-#endif
-#ifndef _PATH_GROUP
-#define _PATH_GROUP "/etc/group"
-#endif
-
/**********************************************************************/
/* Sizes for statically allocated buffers. */
--- include/libbb.h.orig 2011-01-11 15:25:42.000000000 +0100
+++ include/libbb.h 2011-01-13 22:36:42.000000000 +0100
@@ -1604,10 +1604,22 @@
* get the list of currently mounted filesystems */
#define bb_path_mtab_file IF_FEATURE_MTAB_SUPPORT("/etc/mtab")IF_NOT_FEATURE_MTAB_SUPPORT("/proc/mounts")
-#define bb_path_passwd_file "/etc/passwd"
-#define bb_path_shadow_file "/etc/shadow"
-#define bb_path_gshadow_file "/etc/gshadow"
-#define bb_path_group_file "/etc/group"
+#ifndef _PATH_SHADOW
+#define _PATH_SHADOW "/etc/shadow"
+#endif
+#ifndef _PATH_PASSWD
+#define _PATH_PASSWD "/etc/passwd"
+#endif
+#ifndef _PATH_GROUP
+#define _PATH_GROUP "/etc/group"
+#endif
+#ifndef _PATH_GSHADOW
+#define _PATH_GSHADOW "/etc/gshadow"
+#endif
+#define bb_path_passwd_file _PATH_PASSWD
+#define bb_path_shadow_file _PATH_SHADOW
+#define bb_path_gshadow_file _PATH_GSHADOW
+#define bb_path_group_file _PATH_GROUP
#define bb_path_motd_file "/etc/motd"
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox