1.\" $OpenBSD: netgroup_mkdb.8,v 1.8 2015/11/30 17:03:05 jmc Exp $ 2.\" 3.\" Copyright (c) 1994 Christos Zoulas 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by Christos Zoulas. 17.\" 3. The name of the author may not be used to endorse or promote products 18.\" derived from this software without specific prior written permission 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30.\" 31.Dd $Mdocdate: November 30 2015 $ 32.Dt NETGROUP_MKDB 8 33.Os 34.Sh NAME 35.Nm netgroup_mkdb 36.Nd generate the netgroup databases 37.Sh SYNOPSIS 38.Nm netgroup_mkdb 39.Op Fl o Ar database 40.Op Ar file 41.Sh DESCRIPTION 42.Nm netgroup_mkdb 43creates Berkeley databases for the specified 44.Ar file . 45If no file is specified, 46.Pa /etc/netgroup 47is used. 48These databases are then installed into 49.Pa /etc/netgroup.db . 50The file must be in the correct format (see 51.Xr netgroup 5 ) . 52.Pp 53The options are as follows: 54.Bl -tag -width Ds 55.It Fl o Ar database 56Put the output databases in the named file. 57.El 58.Pp 59The databases are used by the C library netgroup routines (see 60.Xr getnetgrent 3 ) . 61.Pp 62.Nm netgroup_mkdb 63exits zero on success, non-zero on failure. 64.Sh FILES 65.Bl -tag -width 24n -compact 66.It Pa /etc/netgroup.db 67current netgroup database 68.It Pa /etc/netgroup.db.tmp 69a temporary file 70.It Pa /etc/netgroup 71current netgroup file 72.El 73.Sh SEE ALSO 74.Xr dbopen 3 , 75.Xr getnetgrent 3 , 76.Xr netgroup 5 77.Sh BUGS 78Because 79.Nm netgroup_mkdb 80guarantees not to install a partial destination file it must 81build a temporary file in the same file system and if successful use 82.Xr rename 2 83to install over the destination file. 84.Pp 85If 86.Nm netgroup_mkdb 87fails it will leave the previous version of the destination file intact. 88