From 7b8372b81926ef6aa8d91945a95261bbb93d0b9e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 7 Aug 2017 00:28:15 +0200 Subject: add/remove-shell,add/deluser,add/delgroup: make them NOEXEC Signed-off-by: Denys Vlasenko --- loginutils/add-remove-shell.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'loginutils/add-remove-shell.c') diff --git a/loginutils/add-remove-shell.c b/loginutils/add-remove-shell.c index 750b44bd6..6d03de254 100644 --- a/loginutils/add-remove-shell.c +++ b/loginutils/add-remove-shell.c @@ -19,9 +19,9 @@ //config: help //config: Remove shells from /etc/shells. -// APPLET_ODDNAME:name main location suid_type help -//applet:IF_ADD_SHELL( APPLET_ODDNAME(add-shell , add_remove_shell, BB_DIR_USR_SBIN, BB_SUID_DROP, add_shell )) -//applet:IF_REMOVE_SHELL(APPLET_ODDNAME(remove-shell, add_remove_shell, BB_DIR_USR_SBIN, BB_SUID_DROP, remove_shell)) +// APPLET_NOEXEC:name main location suid_type help +//applet:IF_ADD_SHELL( APPLET_NOEXEC(add-shell , add_remove_shell, BB_DIR_USR_SBIN, BB_SUID_DROP, add_shell )) +//applet:IF_REMOVE_SHELL(APPLET_NOEXEC(remove-shell, add_remove_shell, BB_DIR_USR_SBIN, BB_SUID_DROP, remove_shell)) //kbuild:lib-$(CONFIG_ADD_SHELL) += add-remove-shell.o //kbuild:lib-$(CONFIG_REMOVE_SHELL) += add-remove-shell.o @@ -64,6 +64,7 @@ int add_remove_shell_main(int argc UNUSED_PARAM, char **argv) if (orig_fp) xfstat(fileno(orig_fp), &sb, orig_fn); + new_fn = xasprintf("%s.tmp", orig_fn); /* * O_TRUNC or O_EXCL? At the first glance, O_EXCL looks better, -- cgit v1.2.3