NAME

getusershell, setusershell, endusershell - get legal user shells

SYNOPSIS

char * getusershell()
void setusershell( )
void endusershell( )

DESCRIPTION

getusershell( ) returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, a list of the ten locations of the standard system shells: /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, /usr/bin/jsh, /bin/sh, /bin/csh, /bin/ksh, /bin/jsh, /sbin/sh, /sbin/jsh, are used instead of the file.
getusershell( ) (opens the file /etc/shells if it exists) returns the next entry in the list of shells.
setusershell( ) rewinds the file, or the list.
endusershell( ) closes the file, and frees any memory used by getusershell( ) and setusershell( ). As a side effect, endusershell( ) rewinds the file /etc/shells.

FILES

/etc/shells
/usr/bin/sh
/usr/bin/csh
/usr/bin/ksh
/usr/bin/jsh
/bin/sh
/bin/csh
/bin/ksh
/bin/jsh
/sbin/sh
/sbin/jsh

RETURN VALUES

getusershell( ) returns a NULL pointer on EOF.

BUGS

All information is contained in memory that may be freed with a call to endusershell( ), so it must be copied if it is to be saved.

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()