aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-12-19 00:20:20 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-12-19 00:20:20 +0000
commit421693af7d4800cd3f046e72b3ab6ff99e7d0224 (patch)
tree46b4cf5e6ce90c66b6794bf23b69705fbcb8d1e6 /libbb
parent079279f3e56d0e46ed83069aaa9eb9a06d5f70e4 (diff)
downloadbusybox-w32-421693af7d4800cd3f046e72b3ab6ff99e7d0224.tar.gz
busybox-w32-421693af7d4800cd3f046e72b3ab6ff99e7d0224.tar.bz2
busybox-w32-421693af7d4800cd3f046e72b3ab6ff99e7d0224.zip
su: make /etc/shells check configurable
ash: missing ';' git-svn-id: svn://busybox.net/trunk/busybox@17000 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-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