xref: /illumos-gate/usr/src/tools/protocmp/stdusers.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #include <string.h>
30 #include "stdusers.h"
31 
32 const struct stdlist usernames[] = {
33 	{ "root", 0 },
34 	{ "daemon", 1 },
35 	{ "bin", 2 },
36 	{ "sys", 3 },
37 	{ "adm", 4 },
38 	{ "uucp", 5 },
39 	{ "nuucp", 9 },
40 	{ "smmsp", 25 },
41 	{ "listen", 37 },
42 	{ "lp", 71 },
43 	{ "nobody", 60001 },
44 	{ "noaccess", 60002 },
45 	{ "nobody4", 65534 },
46 	{ NULL, 0 }
47 };
48 
49 const struct stdlist groupnames[] = {
50 	{ "root", 0 },
51 	{ "other", 1 },
52 	{ "bin", 2 },
53 	{ "sys", 3 },
54 	{ "adm", 4 },
55 	{ "uucp", 5 },
56 	{ "mail", 6 },
57 	{ "tty", 7 },
58 	{ "lp", 8 },
59 	{ "nuucp", 9 },
60 	{ "staff", 10 },
61 	{ "daemon", 12 },
62 	{ "sysadmin", 14 },
63 	{ "smmsp", 25 },
64 	{ "nobody", 60001 },
65 	{ "noaccess", 60002 },
66 	{ "nogroup", 65534 },
67 	{ NULL, 0 }
68 };
69 
70 int
71 stdfind(const char *name, const struct stdlist *list)
72 {
73 	while (list->name != NULL) {
74 		if (strcmp(name, list->name) == 0)
75 			return (list->value);
76 		list++;
77 	}
78 	return (-1);
79 }
80