summaryrefslogtreecommitdiff
path: root/usr/src/man/man3c/getusershell.3c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/man/man3c/getusershell.3c')
-rw-r--r--usr/src/man/man3c/getusershell.3c77
1 files changed, 77 insertions, 0 deletions
diff --git a/usr/src/man/man3c/getusershell.3c b/usr/src/man/man3c/getusershell.3c
new file mode 100644
index 0000000000..7b695cf81b
--- /dev/null
+++ b/usr/src/man/man3c/getusershell.3c
@@ -0,0 +1,77 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (c) 1985 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
+.\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
+.TH getusershell 3C "1 Nov 2007" "SunOS 5.11" "Standard C Library Functions"
+.SH NAME
+getusershell, setusershell, endusershell \- get legal user shells
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBchar *\fR\fBgetusershell\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBsetusershell\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBendusershell\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetusershell()\fR function returns a pointer to a legal user shell as
+defined by the system manager in the file \fB/etc/shells\fR. If
+\fB/etc/shells\fR does not exist, the following locations of the standard
+system shells are used in its place:
+.sp
+.in +2
+.nf
+\fB/bin/bash\fR \fB/bin/csh\fR
+\fB/bin/jsh\fR \fB/bin/ksh\fR
+\fB/bin/ksh93\fR \fB/bin/pfcsh\fR
+\fB/bin/pfksh\fR \fB/bin/pfsh\fR
+\fB/bin/sh\fR \fB/bin/tcsh\fR
+\fB/bin/zsh\fR \fB/sbin/jsh\fR
+\fB/sbin/pfsh\fR \fB/sbin/sh\fR
+\fB/usr/bin/bash\fR \fB/usr/bin/csh\fR
+\fB/usr/bin/jsh\fR \fB/usr/bin/ksh\fR
+\fB/usr/bin/ksh93\fR \fB/usr/bin/pfcsh\fR
+\fB/usr/bin/pfksh\fR \fB/usr/bin/pfsh\fR
+\fB/usr/bin/sh\fR \fB/usr/bin/tcsh\fR
+\fB/usr/bin/zsh\fR \fB/usr/sfw/bin/zsh\fR
+\fB/usr/xpg4/bin/sh\fR
+.fi
+.in -2
+
+.sp
+.LP
+The \fBgetusershell()\fR function opens the file \fB/etc/shells\fR, if it
+exists, and returns the next entry in the list of shells.
+.sp
+.LP
+The \fBsetusershell()\fR function rewinds the file or the list.
+.sp
+.LP
+The \fBendusershell()\fR function closes the file, frees any memory used by
+\fBgetusershell()\fR and \fBsetusershell()\fR, and rewinds the file
+\fB/etc/shells\fR.
+.SH RETURN VALUES
+.sp
+.LP
+The \fBgetusershell()\fR function returns a null pointer on EOF.
+.SH BUGS
+.sp
+.LP
+All information is contained in memory that may be freed with a call to
+\fBendusershell()\fR, so it must be copied if it is to be saved.
+.SH NOTES
+.sp
+.LP
+Restricted shells should not be listed in \fB/etc/shells\fR.