1.\" $OpenBSD: netgroup_mkdb.8,v 1.11 2023/01/04 13:00:11 jsg 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.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" 26.Dd $Mdocdate: January 4 2023 $ 27.Dt NETGROUP_MKDB 8 28.Os 29.Sh NAME 30.Nm netgroup_mkdb 31.Nd generate the netgroup databases 32.Sh SYNOPSIS 33.Nm netgroup_mkdb 34.Op Fl o Ar database 35.Op Ar file 36.Sh DESCRIPTION 37.Nm netgroup_mkdb 38creates Berkeley databases for the specified 39.Ar file . 40If no file is specified, 41.Pa /etc/netgroup 42is used. 43These databases are then installed into 44.Pa /etc/netgroup.db . 45The file must be in the correct format (see 46.Xr netgroup 5 ) . 47.Pp 48The options are as follows: 49.Bl -tag -width Ds 50.It Fl o Ar database 51Put the output databases in the named file. 52.El 53.Pp 54The databases are used by the C library netgroup routines (see 55.Xr getnetgrent 3 ) . 56.Sh FILES 57.Bl -tag -width 24n -compact 58.It Pa /etc/netgroup.db 59current netgroup database 60.It Pa /etc/netgroup.db.tmp 61a temporary file 62.It Pa /etc/netgroup 63current netgroup file 64.El 65.Sh EXIT STATUS 66.Ex -std netgroup_mkdb 67.Sh SEE ALSO 68.Xr dbopen 3 , 69.Xr getnetgrent 3 , 70.Xr netgroup 5 71.Sh BUGS 72Because 73.Nm netgroup_mkdb 74guarantees not to install a partial destination file, it must 75build a temporary file in the same file system and if successful use 76.Xr rename 2 77to install over the destination file. 78.Pp 79If 80.Nm netgroup_mkdb 81fails, it will leave the previous version of the destination file intact. 82