Print this page
4078 groupadd execs getent unnecessarily
Reviewed by: Rich Lowe <richlowe@richlowe.net>
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Reviewed by: Milan Jurik <milan.jurik@xylab.cz>
Reviewed by: Gordon Ross <Gordon.W.Ross@gmail.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libcmdutils/libcmdutils.h
+++ new/usr/src/lib/libcmdutils/libcmdutils.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 +/*
26 + * Copyright (c) 2013 RackTop Systems.
27 + */
25 28
26 29 /*
27 30 * Declarations for the functions in libcmdutils.
28 31 */
29 32
30 33 #ifndef _LIBCMDUTILS_H
31 34 #define _LIBCMDUTILS_H
32 35
33 36 #pragma ident "%Z%%M% %I% %E% SMI"
34 37
35 38 /*
36 39 * This is a private header file. Applications should not directly include
37 40 * this file.
38 41 */
39 42
40 43 #include <stdio.h>
41 44 #include <unistd.h>
42 45 #include <stdlib.h>
43 46 #include <errno.h>
44 47 #include <fcntl.h>
45 48 #include <limits.h>
46 49 #include <libintl.h>
47 50 #include <string.h>
48 51 #include <dirent.h>
49 52 #include <attr.h>
50 53 #include <sys/avl.h>
51 54 #include <sys/types.h>
52 55 #include <sys/stat.h>
53 56 #include <sys/mman.h>
54 57 #include <libnvpair.h>
55 58
56 59 #ifdef __cplusplus
57 60 extern "C" {
58 61 #endif
59 62
60 63 /* extended system attribute support */
61 64 #define _NOT_SATTR 0
62 65 #define _RO_SATTR 1
63 66 #define _RW_SATTR 2
64 67
65 68 #define MAXMAPSIZE (1024*1024*8) /* map at most 8MB */
66 69 #define SMALLFILESIZE (32*1024) /* don't use mmap on little file */
67 70 #define ISREG(A) (((A).st_mode & S_IFMT) == S_IFREG)
68 71
69 72 /* avltree */
70 73 #define OFFSETOF(s, m) ((size_t)(&(((s *)0)->m)))
71 74
72 75 /* Type used for a node containing a device id and inode number */
73 76 typedef struct tree_node {
74 77 dev_t node_dev;
75 78 ino_t node_ino;
76 79 avl_node_t avl_link;
77 80 } tree_node_t;
78 81
79 82
80 83 /* extended system attribute support */
81 84
82 85 /* Determine if a file is the name of an extended system attribute file */
83 86 extern int sysattr_type(char *);
84 87
85 88 /* Determine if the underlying file system supports system attributes */
86 89 extern int sysattr_support(char *, int);
87 90
88 91 /* Copies the content of the source file to the target file */
89 92 extern int writefile(int, int, char *, char *, char *, char *,
90 93 struct stat *, struct stat *);
91 94
92 95 /* Gets file descriptors of the source and target attribute files */
93 96 extern int get_attrdirs(int, int, char *, int *, int *);
94 97
95 98 /* Move extended attribute and extended system attribute */
96 99 extern int mv_xattrs(char *, char *, char *, int, int);
97 100
98 101 /* Returns non default extended system attribute list */
99 102 extern nvlist_t *sysattr_list(char *, int, char *);
100 103
101 104
102 105
103 106 /* avltree */
104 107
105 108 /*
106 109 * Used to compare two nodes. We are attempting to match the 1st
107 110 * argument (node) against the 2nd argument (a node which
108 111 * is already in the search tree).
109 112 */
110 113
111 114 extern int tnode_compare(const void *, const void *);
112 115
113 116 /*
114 117 * Used to add a single node (containing the input device id and
115 118 * inode number) to the specified search tree. The calling
116 119 * application must set the tree pointer to NULL before calling
117 120 * add_tnode() for the first time.
↓ open down ↓ |
83 lines elided |
↑ open up ↑ |
118 121 */
119 122 extern int add_tnode(avl_tree_t **, dev_t, ino_t);
120 123
121 124 /*
122 125 * Used to destroy a whole tree (all nodes) without rebalancing.
123 126 * The calling application is responsible for setting the tree
124 127 * pointer to NULL upon return.
125 128 */
126 129 extern void destroy_tree(avl_tree_t *);
127 130
131 +
132 +
133 + /* user/group id helpers */
134 +
135 +/*
136 + * Used to get the next available user id in given range.
137 + */
138 +extern int findnextuid(uid_t, uid_t, uid_t *);
139 +
140 +/*
141 + * Used to get the next available group id in given range.
142 + */
143 +extern int findnextgid(gid_t, gid_t, gid_t *);
144 +
128 145 #ifdef __cplusplus
129 146 }
130 147 #endif
131 148
132 149 #endif /* _LIBCMDUTILS_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX