xref: /freebsd/lib/libc/gen/getusershell.3 (revision dc36d6f9bb1753f3808552f3afd30eda9a7b206a)
1248aee62SJacques Vidrine.\"	$NetBSD: getusershell.3,v 1.6 1999/03/22 19:44:42 garbled Exp $
2248aee62SJacques Vidrine.\"
358f0484fSRodney W. Grimes.\" Copyright (c) 1985, 1991, 1993
458f0484fSRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
558f0484fSRodney W. Grimes.\"
658f0484fSRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
758f0484fSRodney W. Grimes.\" modification, are permitted provided that the following conditions
858f0484fSRodney W. Grimes.\" are met:
958f0484fSRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
1058f0484fSRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
1158f0484fSRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
1258f0484fSRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
1358f0484fSRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
14*fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
1558f0484fSRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
1658f0484fSRodney W. Grimes.\"    without specific prior written permission.
1758f0484fSRodney W. Grimes.\"
1858f0484fSRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1958f0484fSRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2058f0484fSRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2158f0484fSRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2258f0484fSRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2358f0484fSRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2458f0484fSRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2558f0484fSRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2658f0484fSRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2758f0484fSRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2858f0484fSRodney W. Grimes.\" SUCH DAMAGE.
2958f0484fSRodney W. Grimes.\"
30248aee62SJacques Vidrine.Dd January 16, 1999
3158f0484fSRodney W. Grimes.Dt GETUSERSHELL 3
32248aee62SJacques Vidrine.Os
3358f0484fSRodney W. Grimes.Sh NAME
3458f0484fSRodney W. Grimes.Nm getusershell ,
3558f0484fSRodney W. Grimes.Nm setusershell ,
3658f0484fSRodney W. Grimes.Nm endusershell
37248aee62SJacques Vidrine.Nd get valid user shells
3825bb73e0SAlexey Zelkin.Sh LIBRARY
3925bb73e0SAlexey Zelkin.Lb libc
4058f0484fSRodney W. Grimes.Sh SYNOPSIS
4132eef9aeSRuslan Ermilov.In unistd.h
4258f0484fSRodney W. Grimes.Ft char *
4358f0484fSRodney W. Grimes.Fn getusershell void
4458f0484fSRodney W. Grimes.Ft void
4558f0484fSRodney W. Grimes.Fn setusershell void
4658f0484fSRodney W. Grimes.Ft void
4758f0484fSRodney W. Grimes.Fn endusershell void
4858f0484fSRodney W. Grimes.Sh DESCRIPTION
4958f0484fSRodney W. GrimesThe
5058f0484fSRodney W. Grimes.Fn getusershell
5158f0484fSRodney W. Grimesfunction
52248aee62SJacques Vidrinereturns a pointer to a valid user shell as defined by the
53248aee62SJacques Vidrinesystem manager in the shells database as described in
54248aee62SJacques Vidrine.Xr shells 5 .
55248aee62SJacques VidrineIf the shells database is not available,
5658f0484fSRodney W. Grimes.Fn getusershell
5758f0484fSRodney W. Grimesbehaves as if
5858f0484fSRodney W. Grimes.Pa /bin/sh
5958f0484fSRodney W. Grimesand
6058f0484fSRodney W. Grimes.Pa /bin/csh
61248aee62SJacques Vidrinewere listed.
6258f0484fSRodney W. Grimes.Pp
6358f0484fSRodney W. GrimesThe
6458f0484fSRodney W. Grimes.Fn getusershell
6558f0484fSRodney W. Grimesfunction
6658f0484fSRodney W. Grimesreads the next
6758f0484fSRodney W. Grimesline (opening the file if necessary);
6858f0484fSRodney W. Grimes.Fn setusershell
6958f0484fSRodney W. Grimesrewinds the file;
7058f0484fSRodney W. Grimes.Fn endusershell
7158f0484fSRodney W. Grimescloses it.
7258f0484fSRodney W. Grimes.Sh FILES
7358f0484fSRodney W. Grimes.Bl -tag -width /etc/shells -compact
7458f0484fSRodney W. Grimes.It Pa /etc/shells
7558f0484fSRodney W. Grimes.El
7658f0484fSRodney W. Grimes.Sh DIAGNOSTICS
7758f0484fSRodney W. GrimesThe routine
7858f0484fSRodney W. Grimes.Fn getusershell
7958f0484fSRodney W. Grimesreturns a null pointer (0) on
8058f0484fSRodney W. Grimes.Dv EOF .
8158f0484fSRodney W. Grimes.Sh SEE ALSO
82248aee62SJacques Vidrine.Xr nsswitch.conf 5 ,
8358f0484fSRodney W. Grimes.Xr shells 5
8458f0484fSRodney W. Grimes.Sh HISTORY
8558f0484fSRodney W. GrimesThe
8658f0484fSRodney W. Grimes.Fn getusershell
8758f0484fSRodney W. Grimesfunction appeared in
8858f0484fSRodney W. Grimes.Bx 4.3 .
8958f0484fSRodney W. Grimes.Sh BUGS
9058f0484fSRodney W. GrimesThe
9158f0484fSRodney W. Grimes.Fn getusershell
9258f0484fSRodney W. Grimesfunction leaves its result in an internal static object and returns
93067c7f48SSheldon Hearna pointer to that object.
94067c7f48SSheldon HearnSubsequent calls to
9558f0484fSRodney W. Grimes.Fn getusershell
9658f0484fSRodney W. Grimeswill modify the same object.
97