summaryrefslogtreecommitdiff
path: root/release/src/router/busybox/libbb/restricted_shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'release/src/router/busybox/libbb/restricted_shell.c')
-rw-r--r--release/src/router/busybox/libbb/restricted_shell.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/release/src/router/busybox/libbb/restricted_shell.c b/release/src/router/busybox/libbb/restricted_shell.c
index 74a64140..2a5073f0 100644
--- a/release/src/router/busybox/libbb/restricted_shell.c
+++ b/release/src/router/busybox/libbb/restricted_shell.c
@@ -28,30 +28,19 @@
* SUCH DAMAGE.
*/
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <syslog.h>
-#include <ctype.h>
#include "libbb.h"
-
-
/* Return 1 if SHELL is a restricted shell (one not returned by
getusershell), else 0, meaning it is a standard shell. */
-
-int restricted_shell ( const char *shell )
+int FAST_FUNC restricted_shell(const char *shell)
{
char *line;
- setusershell ( );
- while (( line = getusershell ( ))) {
- if (( *line != '#' ) && ( strcmp ( line, shell ) == 0 ))
- break;
+ setusershell();
+ while ((line = getusershell())) {
+ if (*line != '#' && strcmp(line, shell) == 0)
+ return 0;
}
- endusershell ( );
- return line ? 0 : 1;
+ endusershell();
+ return 1;
}
-