summaryrefslogtreecommitdiff
path: root/release/src/router/busybox/libbb/restricted_shell.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 13:58:15 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 13:58:15 +0100
commit4aca87515a5083ae0e31ce3177189fd43b6d05ac (patch)
tree7b1d9a31393ca090757dc6f0d3859b4fcd93f271 /release/src/router/busybox/libbb/restricted_shell.c
parent008d0be72b2f160382c6e880765e96b64a050c65 (diff)
downloadtomato-4aca87515a5083ae0e31ce3177189fd43b6d05ac.tar.gz
tomato-4aca87515a5083ae0e31ce3177189fd43b6d05ac.tar.bz2
patch to Vanilla Tomato 1.28
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;
}
-