1 |
/* getusershell.c -- Return names of valid user shells. |
/* getusershell.c -- Return names of valid user shells. |
2 |
|
|
3 |
Copyright (C) 1991, 1997, 2000, 2001, 2003, 2004 Free Software |
Copyright (C) 1991, 1997, 2000, 2001, 2003, 2004, 2005 Free Software |
4 |
Foundation, Inc. |
Foundation, Inc. |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
15 |
|
|
16 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
17 |
along with this program; if not, write to the Free Software Foundation, |
along with this program; if not, write to the Free Software Foundation, |
18 |
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ |
19 |
|
|
20 |
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> */ |
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> */ |
21 |
|
|
37 |
#include <stdlib.h> |
#include <stdlib.h> |
38 |
#include <ctype.h> |
#include <ctype.h> |
39 |
|
|
40 |
|
#include "stdio-safer.h" |
41 |
#include "xalloc.h" |
#include "xalloc.h" |
42 |
|
|
43 |
#if USE_UNLOCKED_IO |
#if USE_UNLOCKED_IO |
99 |
|
|
100 |
if (shellstream == NULL) |
if (shellstream == NULL) |
101 |
{ |
{ |
102 |
shellstream = fopen (SHELLS_FILE, "r"); |
shellstream = fopen_safer (SHELLS_FILE, "r"); |
103 |
if (shellstream == NULL) |
if (shellstream == NULL) |
104 |
{ |
{ |
105 |
/* No shells file. Use the default list. */ |
/* No shells file. Use the default list. */ |