aboutsummaryrefslogblamecommitdiff
path: root/ja_JP.eucJP/man/man3/getnetgrent.3
blob: 11e2f0b46047c56e0f45d7233c67701a70275f41 (plain) (tree)
































                                                                              
             































































































                                                                                             
.\" Copyright (c) 1992, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)getnetgrent.3	8.1 (Berkeley) 6/4/93
.\"
.\" $FreeBSD$
.Dd June 4, 1993
.Dt GETNETGRENT 3
.Os
.Sh 名称
.Nm getnetgrent ,
.Nm innetgr ,
.Nm setnetgrent ,
.Nm endnetgrent
.Nd ネットグループデータベースの操作
.Sh 書式
.Ft int
.Fn getnetgrent "char **host" "char **user" "char **domain"
.Ft int
.Fn innetgr "const char *netgroup" "const char *host" "const char *user" "const char *domain"
.Ft void
.Fn setnetgrent "const char *netgroup"
.Ft void
.Fn endnetgrent void
.Sh 解説
これらの関数はいずれも、
.Xr netgroup 5
に記述されたネットグループデータベースのファイル
/etc/netgroup
を操作します。データベースはネットグループの集合を定義しますが、
ネットグループはぞれぞれ、1 つまたは複数の次のような 3 つ組で構成されます。
.Bd -literal -offset indent
(host, user, domain)
.Ed
それぞれ、ホスト、ユーザおよびドメインの組み合わせを定義します。
3 つのフィールドのどれにも、あらゆるストリングに適合する
`'ワイルドカード' を指定可能です。
.Pp
関数
.Fn getnetgrent
は、現在のネットグループの次のメンバの、文字列に対する
3 つのポインタ引数を設定します。文字列ポインタのどれかが
.Sy (char *)0
だと、そのフィールドはワイルドカードと見なされます。
.Pp
関数
.Fn setnetgrent
は現在のネットグループを設定し、
.Fn endnetgrent
は現在のネットグループを終了します。
前の呼び出しとは違うネットグループに対して
.Fn setnetgrent
が呼び出された場合、暗黙に
.Fn endnetgrent
が実行されます。
.Fn setnetgrent
はまた、ネットグループの最初のメンバのオフセットを設定します。
.Pp
関数
.Fn innetgr
は適合するものがあるかどうか、指定したグループにあるすべての
フィールドを検索します。
.Sy host
.Sy user
.Sy domain
引数のどれかが
.Sy (char *)0
の場合、そのフィールドは指定されたネットグループメンバのあらゆる
文字列値に適合します。
.Sh 戻り値
関数
.Fn getnetgrent
は ``それ以上ネットグループメンバがない'' 場合には 0 を返し、
その他の場合は 1 を返します。
関数
.Fn innetgr
は、適合するフィールドがあった場合は 1 を、
その他の場合は 0 を返します。
関数
.Fn setnetgrent
および
.Fn endnetgrent
には戻り値がありません。
.Sh 関連ファイル
.Bl -tag -width /etc/netgroup -compact
.It Pa /etc/netgroup
ネットグループデータベースファイル
.El
.Sh 関連項目
.Xr netgroup 5
.Sh 互換性
ネットグループメンバには、他のベンダによる実装との互換性を維持するために
3 つの文字列フィールドがありますが、
.Sy domain
文字列の BSD 内での使用法が明らかではありません。
.Sh バグ
関数
.Fn getnetgrent
は、動的に割り振られたデータ領域のポインタを返しますが、
関数
.Fn endnetgrent
が呼び出されるとそのデータ領域は解放されます。