X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libbb%2Frestricted_shell.c;h=2a5073f030c3a4fad3f3ab90e350d5c4807176fe;hb=6da69cddc022773a062a039e354d1ad0ed3e32c8;hp=74a64140fab3c707a21b9a0227fdd276e604f599;hpb=27f64e1f4eb4354844f6553e37501deffde8373e;p=oweals%2Fbusybox.git diff --git a/libbb/restricted_shell.c b/libbb/restricted_shell.c index 74a64140f..2a5073f03 100644 --- a/libbb/restricted_shell.c +++ b/libbb/restricted_shell.c @@ -28,30 +28,19 @@ * SUCH DAMAGE. */ -#include -#include -#include -#include -#include -#include -#include #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; } -