9330 stack overflow when creating a deeply nested dataset
[unleashed.git] / usr / src / man / man3c / getusershell.3c
blob9ce726a26a0f5864b8fa40471ce8dce679db9f30
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Copyright (c) 1985 Regents of the University of California.  All rights reserved.  The Berkeley software License Agreement specifies the terms and conditions for redistribution.
4 .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
5 .TH GETUSERSHELL 3C "Nov 1, 2007"
6 .SH NAME
7 getusershell, setusershell, endusershell \- get legal user shells
8 .SH SYNOPSIS
9 .LP
10 .nf
11 #include <unistd.h>
13 \fBchar *\fR\fBgetusershell\fR(\fBvoid\fR);
14 .fi
16 .LP
17 .nf
18 \fBvoid\fR \fBsetusershell\fR(\fBvoid\fR);
19 .fi
21 .LP
22 .nf
23 \fBvoid\fR \fBendusershell\fR(\fBvoid\fR);
24 .fi
26 .SH DESCRIPTION
27 .sp
28 .LP
29 The \fBgetusershell()\fR function returns a pointer to a legal user shell as
30 defined by the system manager in the file \fB/etc/shells\fR. If
31 \fB/etc/shells\fR does not exist, the following locations of the standard
32 system shells are used in its place:
33 .sp
34 .in +2
35 .nf
36 \fB/bin/bash\fR                  \fB/bin/csh\fR
37 \fB/bin/jsh\fR                   \fB/bin/ksh\fR
38 \fB/bin/ksh93\fR                 \fB/bin/pfcsh\fR
39 \fB/bin/pfksh\fR                 \fB/bin/pfsh\fR
40 \fB/bin/sh\fR                    \fB/bin/tcsh\fR
41 \fB/bin/zsh\fR                   \fB/sbin/jsh\fR
42 \fB/sbin/pfsh\fR                 \fB/sbin/sh\fR
43 \fB/usr/bin/bash\fR              \fB/usr/bin/csh\fR
44 \fB/usr/bin/jsh\fR               \fB/usr/bin/ksh\fR
45 \fB/usr/bin/ksh93\fR             \fB/usr/bin/pfcsh\fR
46 \fB/usr/bin/pfksh\fR             \fB/usr/bin/pfsh\fR
47 \fB/usr/bin/sh\fR                \fB/usr/bin/tcsh\fR
48 \fB/usr/bin/zsh\fR               \fB/usr/sfw/bin/zsh\fR
49 \fB/usr/xpg4/bin/sh\fR
50 .fi
51 .in -2
53 .sp
54 .LP
55 The \fBgetusershell()\fR function opens the file \fB/etc/shells\fR, if it
56 exists, and returns the next entry in the list of shells.
57 .sp
58 .LP
59 The \fBsetusershell()\fR function rewinds the file or the list.
60 .sp
61 .LP
62 The \fBendusershell()\fR function closes the file, frees any memory used by
63 \fBgetusershell()\fR and \fBsetusershell()\fR, and rewinds the file
64 \fB/etc/shells\fR.
65 .SH RETURN VALUES
66 .sp
67 .LP
68 The \fBgetusershell()\fR function returns a null pointer on EOF.
69 .SH BUGS
70 .sp
71 .LP
72 All information is contained in memory that may be freed with a call to
73 \fBendusershell()\fR, so it must be copied if it is to be saved.
74 .SH NOTES
75 .sp
76 .LP
77 Restricted shells should not be listed in \fB/etc/shells\fR.