diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-08 18:31:39 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-08 18:31:39 +0100 |
commit | d5933b112537f9cb9d6ebb0109a0a38cea71fa63 (patch) | |
tree | f5b89eb16c93c09d47704f9b1091683645127dbb /shell | |
parent | 10d5ece64ae6b2338a13a58340a03ff988d46a85 (diff) | |
download | busybox-w32-d5933b112537f9cb9d6ebb0109a0a38cea71fa63.tar.gz busybox-w32-d5933b112537f9cb9d6ebb0109a0a38cea71fa63.tar.bz2 busybox-w32-d5933b112537f9cb9d6ebb0109a0a38cea71fa63.zip |
hush: make umask builtin optional
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/hush.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c index 4604240d8..a713a9680 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -272,6 +272,13 @@ | |||
272 | //config: help | 272 | //config: help |
273 | //config: Enable unset builtin in hush. | 273 | //config: Enable unset builtin in hush. |
274 | //config: | 274 | //config: |
275 | //config:config HUSH_UMASK | ||
276 | //config: bool "umask builtin" | ||
277 | //config: default y | ||
278 | //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH | ||
279 | //config: help | ||
280 | //config: Enable umask builtin in hush. | ||
281 | //config: | ||
275 | //config:config MSH | 282 | //config:config MSH |
276 | //config: bool "msh (deprecated: aliased to hush)" | 283 | //config: bool "msh (deprecated: aliased to hush)" |
277 | //config: default n | 284 | //config: default n |
@@ -947,7 +954,9 @@ static int builtin_trap(char **argv) FAST_FUNC; | |||
947 | static int builtin_type(char **argv) FAST_FUNC; | 954 | static int builtin_type(char **argv) FAST_FUNC; |
948 | #endif | 955 | #endif |
949 | static int builtin_true(char **argv) FAST_FUNC; | 956 | static int builtin_true(char **argv) FAST_FUNC; |
957 | #if ENABLE_HUSH_UMASK | ||
950 | static int builtin_umask(char **argv) FAST_FUNC; | 958 | static int builtin_umask(char **argv) FAST_FUNC; |
959 | #endif | ||
951 | #if ENABLE_HUSH_UNSET | 960 | #if ENABLE_HUSH_UNSET |
952 | static int builtin_unset(char **argv) FAST_FUNC; | 961 | static int builtin_unset(char **argv) FAST_FUNC; |
953 | #endif | 962 | #endif |
@@ -1043,7 +1052,9 @@ static const struct built_in_command bltins1[] = { | |||
1043 | #if ENABLE_HUSH_ULIMIT | 1052 | #if ENABLE_HUSH_ULIMIT |
1044 | BLTIN("ulimit" , shell_builtin_ulimit, "Control resource limits"), | 1053 | BLTIN("ulimit" , shell_builtin_ulimit, "Control resource limits"), |
1045 | #endif | 1054 | #endif |
1055 | #if ENABLE_HUSH_UMASK | ||
1046 | BLTIN("umask" , builtin_umask , "Set file creation mask"), | 1056 | BLTIN("umask" , builtin_umask , "Set file creation mask"), |
1057 | #endif | ||
1047 | #if ENABLE_HUSH_UNSET | 1058 | #if ENABLE_HUSH_UNSET |
1048 | BLTIN("unset" , builtin_unset , "Unset variables"), | 1059 | BLTIN("unset" , builtin_unset , "Unset variables"), |
1049 | #endif | 1060 | #endif |
@@ -9610,6 +9621,7 @@ static int FAST_FUNC builtin_source(char **argv) | |||
9610 | return G.last_exitcode; | 9621 | return G.last_exitcode; |
9611 | } | 9622 | } |
9612 | 9623 | ||
9624 | #if ENABLE_HUSH_UMASK | ||
9613 | static int FAST_FUNC builtin_umask(char **argv) | 9625 | static int FAST_FUNC builtin_umask(char **argv) |
9614 | { | 9626 | { |
9615 | int rc; | 9627 | int rc; |
@@ -9646,6 +9658,7 @@ static int FAST_FUNC builtin_umask(char **argv) | |||
9646 | 9658 | ||
9647 | return !rc; /* rc != 0 - success */ | 9659 | return !rc; /* rc != 0 - success */ |
9648 | } | 9660 | } |
9661 | #endif | ||
9649 | 9662 | ||
9650 | #if ENABLE_HUSH_KILL | 9663 | #if ENABLE_HUSH_KILL |
9651 | static int FAST_FUNC builtin_kill(char **argv) | 9664 | static int FAST_FUNC builtin_kill(char **argv) |