From 15b213ef5a0834eb06a0183ab839ac883d829d5a Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 19 Dec 2006 00:20:20 +0000 Subject: su: make /etc/shells check configurable ash: missing ';' --- libbb/restricted_shell.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'libbb') diff --git a/libbb/restricted_shell.c b/libbb/restricted_shell.c index 74a64140f..dc4cfb458 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 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; } - -- cgit v1.2.3