[PATCH] dont compile pwd_to_spwd when shadow passwds is off
Amir Shalem
amir at boom.org.il
Fri Sep 16 20:05:09 UTC 2005
On Fri, Sep 16, 2005 at 10:55:23AM -0500, Rob Landley wrote:
>Ok, the correct thing to do is definitely a makefile tweak, adding something
>to libbb/Makefile.in that looks a bit like the conditionals in
>archival/libunarchive/Makefile.in
>
>> the problem is that because pwd2spwd.c uses busybox/include/shadow_.h
>> and CONFIG_FEATURE_SHADOWPASSWDS, CONFIG_USE_BB_SHADOW are disabled
>
>Okay, so modify libbb/Makefile.in to only add pwd2spwd.o to libraries-y if
>CONFIG_FEATURE_SHADOWPASSWDS && !CONFIG_USE_BB_SHADOW. Right.
>Ummm...
>
>Not a clue.
>
>I expect to learn a lot by reading the final patch that actually does this,
>but right now I have no idea how to get the makefile to do that. Somebody
>else on the list should be able to, though.
>
>Rob
pwd2spwd is enabled only when CONFIG_FEATURE_SHADOWPASSWDS
you can either choose the patch attached below,
or use the orignal patch i have sent.
pwd2spwd is not a <shadow.h> function
and should be enabled even if !CONFIG_USE_BB_SHADOW.
--
Amir.
-------------- next part --------------
diff -Nur busybox.orig/include/libbb.h busybox/include/libbb.h
--- busybox.orig/include/libbb.h Thu Sep 15 10:20:35 2005
+++ busybox/include/libbb.h Thu Sep 15 10:58:43 2005
@@ -431,7 +431,9 @@
extern void setup_environment ( const char *shell, int loginshell, int changeenv, const struct passwd *pw );
extern int correct_password ( const struct passwd *pw );
extern char *pw_encrypt(const char *clear, const char *salt);
+#ifdef CONFIG_FEATURE_SHADOWPASSWDS
extern struct spwd *pwd_to_spwd(const struct passwd *pw);
+#endif
extern int obscure(const char *old, const char *newval, const struct passwd *pwdp);
extern int bb_xopen(const char *pathname, int flags);
diff -Nur busybox.orig/libbb/Makefile.in busybox/libbb/Makefile.in
--- busybox.orig/libbb/Makefile.in Thu Sep 15 10:20:30 2005
+++ busybox/libbb/Makefile.in Fri Sep 16 20:39:19 2005
@@ -22,7 +22,7 @@
endif
srcdir=$(top_srcdir)/libbb
-LIBBB_SRC:= \
+LIBBB_SRC-y:= \
bb_asprintf.c ask_confirmation.c change_identity.c chomp.c \
compare_string_array.c concat_path_file.c copy_file.c copyfd.c \
correct_password.c create_icmp_socket.c create_icmp6_socket.c \
@@ -36,7 +36,7 @@
my_getgrgid.c my_getgrnam.c my_getpwnam.c my_getug.c\
my_getpwuid.c obscure.c parse_mode.c parse_number.c perror_msg.c \
perror_msg_and_die.c print_file.c get_console.c \
- process_escape_sequence.c procps.c pwd2spwd.c pw_encrypt.c qmodule.c \
+ process_escape_sequence.c procps.c pw_encrypt.c qmodule.c \
read_package_field.c recursive_action.c remove_file.c \
restricted_shell.c run_parts.c run_shell.c safe_read.c safe_write.c \
safe_strncpy.c setup_environment.c simplify_path.c \
@@ -49,7 +49,9 @@
warn_ignoring_args.c concat_subpath_file.c vfork_daemon_rexec.c \
bb_echo.c
-LIBBB_OBJS=$(patsubst %.c,$(LIBBB_DIR)%.o, $(LIBBB_SRC))
+LIBB_SRC-$(CONFIG_FEATURE_SHADOWPASSWDS)+= pwd2spwd.c
+
+LIBBB_OBJS=$(patsubst %.c,$(LIBBB_DIR)%.o, $(LIBBB_SRC-y))
LIBBB_MSRC0:=$(srcdir)/messages.c
LIBBB_MOBJ0:=full_version.o \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20050916/0e67b0c5/attachment-0002.pgp
More information about the busybox
mailing list