aboutsummaryrefslogtreecommitdiff
path: root/libbb/restricted_shell.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-12-19 00:20:20 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-12-19 00:20:20 +0000
commit15b213ef5a0834eb06a0183ab839ac883d829d5a (patch)
tree46b4cf5e6ce90c66b6794bf23b69705fbcb8d1e6 /libbb/restricted_shell.c
parent908d6b7054fbe793636d75d50d4af73ad9627c3b (diff)
downloadbusybox-w32-15b213ef5a0834eb06a0183ab839ac883d829d5a.tar.gz
busybox-w32-15b213ef5a0834eb06a0183ab839ac883d829d5a.tar.bz2
busybox-w32-15b213ef5a0834eb06a0183ab839ac883d829d5a.zip
su: make /etc/shells check configurable
ash: missing ';'
Diffstat (limited to 'libbb/restricted_shell.c')
-rw-r--r--libbb/restricted_shell.c25
1 files changed, 7 insertions, 18 deletions
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 @@
28 * SUCH DAMAGE. 28 * SUCH DAMAGE.
29 */ 29 */
30 30
31#include <stdio.h>
32#include <errno.h>
33#include <unistd.h>
34#include <string.h>
35#include <stdlib.h>
36#include <syslog.h>
37#include <ctype.h>
38#include "libbb.h" 31#include "libbb.h"
39 32
40
41
42/* Return 1 if SHELL is a restricted shell (one not returned by 33/* Return 1 if SHELL is a restricted shell (one not returned by
43 getusershell), else 0, meaning it is a standard shell. */ 34 getusershell), else 0, meaning it is a standard shell. */
44 35int restricted_shell(const char *shell)
45int restricted_shell ( const char *shell )
46{ 36{
47 char *line; 37 char *line;
48 38
49 setusershell ( ); 39 setusershell();
50 while (( line = getusershell ( ))) { 40 while ((line = getusershell())) {
51 if (( *line != '#' ) && ( strcmp ( line, shell ) == 0 )) 41 if (*line != '#' && strcmp(line, shell) == 0)
52 break; 42 return 0;
53 } 43 }
54 endusershell ( ); 44 endusershell();
55 return line ? 0 : 1; 45 return 1;
56} 46}
57