diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-07 00:28:15 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-07 00:28:15 +0200 |
commit | 7b8372b81926ef6aa8d91945a95261bbb93d0b9e (patch) | |
tree | 9a125f00f6dc2c324e24c7f1bb2952ae78a1165a /loginutils/add-remove-shell.c | |
parent | bfc66d49806a4305014b12bbe078484b2da6f93f (diff) | |
download | busybox-w32-7b8372b81926ef6aa8d91945a95261bbb93d0b9e.tar.gz busybox-w32-7b8372b81926ef6aa8d91945a95261bbb93d0b9e.tar.bz2 busybox-w32-7b8372b81926ef6aa8d91945a95261bbb93d0b9e.zip |
add/remove-shell,add/deluser,add/delgroup: make them NOEXEC
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils/add-remove-shell.c')
-rw-r--r-- | loginutils/add-remove-shell.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 @@ | |||
19 | //config: help | 19 | //config: help |
20 | //config: Remove shells from /etc/shells. | 20 | //config: Remove shells from /etc/shells. |
21 | 21 | ||
22 | // APPLET_ODDNAME:name main location suid_type help | 22 | // APPLET_NOEXEC:name main location suid_type help |
23 | //applet:IF_ADD_SHELL( APPLET_ODDNAME(add-shell , add_remove_shell, BB_DIR_USR_SBIN, BB_SUID_DROP, add_shell )) | 23 | //applet:IF_ADD_SHELL( APPLET_NOEXEC(add-shell , add_remove_shell, BB_DIR_USR_SBIN, BB_SUID_DROP, add_shell )) |
24 | //applet:IF_REMOVE_SHELL(APPLET_ODDNAME(remove-shell, add_remove_shell, BB_DIR_USR_SBIN, BB_SUID_DROP, remove_shell)) | 24 | //applet:IF_REMOVE_SHELL(APPLET_NOEXEC(remove-shell, add_remove_shell, BB_DIR_USR_SBIN, BB_SUID_DROP, remove_shell)) |
25 | 25 | ||
26 | //kbuild:lib-$(CONFIG_ADD_SHELL) += add-remove-shell.o | 26 | //kbuild:lib-$(CONFIG_ADD_SHELL) += add-remove-shell.o |
27 | //kbuild:lib-$(CONFIG_REMOVE_SHELL) += add-remove-shell.o | 27 | //kbuild:lib-$(CONFIG_REMOVE_SHELL) += add-remove-shell.o |
@@ -64,6 +64,7 @@ int add_remove_shell_main(int argc UNUSED_PARAM, char **argv) | |||
64 | if (orig_fp) | 64 | if (orig_fp) |
65 | xfstat(fileno(orig_fp), &sb, orig_fn); | 65 | xfstat(fileno(orig_fp), &sb, orig_fn); |
66 | 66 | ||
67 | |||
67 | new_fn = xasprintf("%s.tmp", orig_fn); | 68 | new_fn = xasprintf("%s.tmp", orig_fn); |
68 | /* | 69 | /* |
69 | * O_TRUNC or O_EXCL? At the first glance, O_EXCL looks better, | 70 | * O_TRUNC or O_EXCL? At the first glance, O_EXCL looks better, |