Changeset 1770 in MondoRescue for branches/stable/mindi-busybox/libbb/restricted_shell.c
- Timestamp:
- Nov 6, 2007, 11:01:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi-busybox/libbb/restricted_shell.c
r821 r1770 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 31 #include "libbb.h" 39 40 41 32 42 33 /* Return 1 if SHELL is a restricted shell (one not returned by 43 34 getusershell), else 0, meaning it is a standard shell. */ 44 45 int restricted_shell ( const char *shell ) 35 int restricted_shell(const char *shell) 46 36 { 47 37 char *line; 48 38 49 setusershell ();50 while (( line = getusershell ())) {51 if ( ( *line != '#' ) && ( strcmp ( line, shell ) == 0 ))52 break;39 setusershell(); 40 while ((line = getusershell())) { 41 if (*line != '#' && strcmp(line, shell) == 0) 42 return 0; 53 43 } 54 endusershell ();55 return line ? 0 :1;44 endusershell(); 45 return 1; 56 46 } 57
Note:
See TracChangeset
for help on using the changeset viewer.