2N/A * Copyright (c) 1990, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 2N/A/* All Rights Reserved */ 2N/A * Copyright (c) 1985 Regents of the University of California. 2N/A * All rights reserved. The Berkeley software License Agreement 2N/A * specifies the terms and conditions for redistribution. 2N/A * Do not add local shells here. They should be added in /etc/shells 2N/A * Do not add restricted shells: 2N/A * Shells returned by getusershell traditionally allow: 2N/A * - users to change away from (i.e., if you have an rksh in 2N/A * getusershell(), then users can change their shell to ksh) 2N/A * - by default, ftp in is allowed only for shells returned by 2N/A * getusershell(); since FTP has no restrictions on directory 2N/A * movement, adding rksh to getusershell() would defeat that 2N/A/* The three entries: 2N/A * are included in the array below, to allow compatibility 2N/A * with older systems, where, for example, the shell defined 2N/A * Get a list of shells from SHELLS, if it exists. 2N/A * The +1 in the malloc() below is needed to handle the final 2N/A * fgets() NULL terminator. From fgets(3S): 2N/A * char *fgets(char *s, int n, FILE *stream); 2N/A * The fgets() function reads characters from the stream into 2N/A * the array pointed to by s, until n-1 characters are read, or 2N/A * a newline character is read and transferred to s, or an end- 2N/A * of-file condition is encountered. The string is then termi- 2N/A * nated with a null character. 2N/A while (*
cp !=
'#' && *
cp !=
'/' && *
cp !=
'\0')