[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    getusershell(3C) manual page Table of Contents

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.


Table of Contents