Add Book to My BookshelfPurchase This Book Online

Chapter 8 - Users and Groups

UNIX Systems Programming for SVR4
David A. Curry
 Copyright © 1996 O'Reilly & Associates, Inc.

The Shells File
The /etc/shells file exists so that a system administrator can list the valid shells on his system. This allows commands such as ftp to refuse access to users whose shells are not listed here. On systems that support the chsh command for changing a user's login shell, this file gives the legal values they may choose from.
The /etc/shells file is simply a list of the pathnames of the legal shells. However, if it is not present, then the legal values are the normal system shells, usually /bin/sh, /bin/csh, /bin/ksh, and sometimes /bin/rsh. In order to allow programs to deal with this in a portable fashion, three functions are provided:
    char *getusershell(void);
    void setusershell(void);
    void endusershell(void);
The getusershell function returns a pointer to a character string containing the name of the next shell listed in the file. If the file does not exist, it returns the name of the next shell listed in the list of standard shells. The setusershell and endusershell functions open and rewind, and close the file, respectively.
These functions are not available in IRIX 5.x.

Previous SectionNext Section
Books24x7.com, Inc © 2000 –  Feedback