getusershell, setusershell, endusershell - get legal user shells


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


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.




getusershell( ) returns a NULL pointer on EOF.


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) 人氣()