1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2015-02-04 23:33+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: build/C/man3/fgetgrent.3:30
26 #: build/C/man3/fgetgrent.3:30 build/C/man3/getgrnam.3:33 build/C/man3/getgrouplist.3:29
32 #: build/C/man3/fgetgrent.3:30 build/C/man3/fgetpwent.3:33 build/C/man3/getgrent_r.3:24 build/C/man3/getgrouplist.3:29 build/C/man3/getpw.3:32 build/C/man3/getpwent.3:33 build/C/man3/getpwent_r.3:24 build/C/man3/getpwnam.3:37 build/C/man3/getspnam.3:8 build/C/man3/initgroups.3:32 build/C/man3/putgrent.3:7 build/C/man3/putpwent.3:30 build/C/man3/setaliasent.3:9
38 #: build/C/man3/fgetgrent.3:30 build/C/man3/fgetpwent.3:33 build/C/man5/ftpusers.5:19 build/C/man3/getgrent.3:30 build/C/man3/getgrent_r.3:24 build/C/man3/getgrnam.3:33 build/C/man3/getgrouplist.3:29 build/C/man3/getpw.3:32 build/C/man3/getpwent.3:33 build/C/man3/getpwent_r.3:24 build/C/man3/getpwnam.3:37 build/C/man3/getspnam.3:8 build/C/man5/group.5:26 build/C/man3/initgroups.3:32 build/C/man5/passwd.5:30 build/C/man3/putgrent.3:7 build/C/man3/putpwent.3:30 build/C/man3/setaliasent.3:9
40 msgid "Linux Programmer's Manual"
44 #: build/C/man3/fgetgrent.3:31 build/C/man3/fgetpwent.3:34 build/C/man5/ftpusers.5:20 build/C/man3/getgrent.3:31 build/C/man3/getgrent_r.3:25 build/C/man3/getgrnam.3:34 build/C/man3/getgrouplist.3:30 build/C/man3/getpw.3:33 build/C/man3/getpwent.3:34 build/C/man3/getpwent_r.3:25 build/C/man3/getpwnam.3:38 build/C/man3/getspnam.3:9 build/C/man5/group.5:27 build/C/man3/initgroups.3:33 build/C/man5/passwd.5:31 build/C/man3/putgrent.3:8 build/C/man3/putpwent.3:31 build/C/man3/setaliasent.3:10
50 #: build/C/man3/fgetgrent.3:33
51 msgid "fgetgrent - get group file entry"
55 #: build/C/man3/fgetgrent.3:33 build/C/man3/fgetpwent.3:36 build/C/man3/getgrent.3:33 build/C/man3/getgrent_r.3:27 build/C/man3/getgrnam.3:36 build/C/man3/getgrouplist.3:32 build/C/man3/getpw.3:35 build/C/man3/getpwent.3:36 build/C/man3/getpwent_r.3:27 build/C/man3/getpwnam.3:40 build/C/man3/getspnam.3:13 build/C/man3/initgroups.3:35 build/C/man3/putgrent.3:10 build/C/man3/putpwent.3:33 build/C/man3/setaliasent.3:13
61 #: build/C/man3/fgetgrent.3:38
64 "B<#include E<lt>stdio.hE<gt>>\n"
65 "B<#include E<lt>sys/types.hE<gt>>\n"
66 "B<#include E<lt>grp.hE<gt>>\n"
70 #: build/C/man3/fgetgrent.3:40
72 msgid "B<struct group *fgetgrent(FILE *>I<stream>B<);>\n"
76 #: build/C/man3/fgetgrent.3:45 build/C/man3/fgetpwent.3:48 build/C/man3/getgrent.3:48 build/C/man3/getgrent_r.3:43 build/C/man3/getgrnam.3:57 build/C/man3/getgrouplist.3:42 build/C/man3/getpwent.3:51 build/C/man3/getpwent_r.3:43 build/C/man3/getpwnam.3:61 build/C/man3/getspnam.3:61 build/C/man3/initgroups.3:46 build/C/man3/putpwent.3:45
77 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
81 #: build/C/man3/fgetgrent.3:49
82 msgid "B<fgetgrent>(): _SVID_SOURCE"
86 #: build/C/man3/fgetgrent.3:49 build/C/man3/fgetpwent.3:52 build/C/man5/ftpusers.5:22 build/C/man3/getgrent.3:68 build/C/man3/getgrent_r.3:51 build/C/man3/getgrnam.3:67 build/C/man3/getgrouplist.3:46 build/C/man3/getpw.3:43 build/C/man3/getpwent.3:62 build/C/man3/getpwent_r.3:50 build/C/man3/getpwnam.3:71 build/C/man3/getspnam.3:72 build/C/man5/group.5:29 build/C/man3/initgroups.3:50 build/C/man5/passwd.5:33 build/C/man3/putgrent.3:16 build/C/man3/putpwent.3:49 build/C/man3/setaliasent.3:31
92 #: build/C/man3/fgetgrent.3:63
94 "The B<fgetgrent>() function returns a pointer to a structure containing the "
95 "group information from the file referred to by I<stream>. The first time it "
96 "is called it returns the first entry; thereafter, it returns successive "
97 "entries. The file referred to by I<stream> must have the same format as "
98 "I</etc/group> (see B<group>(5))."
102 #: build/C/man3/fgetgrent.3:65 build/C/man3/getgrent.3:92 build/C/man3/getgrent_r.3:68 build/C/man3/getgrnam.3:86
103 msgid "The I<group> structure is defined in I<E<lt>grp.hE<gt>> as follows:"
107 #: build/C/man3/fgetgrent.3:75 build/C/man3/getgrent.3:102 build/C/man3/getgrent_r.3:78 build/C/man3/getgrnam.3:96
111 " char *gr_name; /* group name */\n"
112 " char *gr_passwd; /* group password */\n"
113 " gid_t gr_gid; /* group ID */\n"
114 " char **gr_mem; /* NULL-terminated array of pointers\n"
115 " to names of group members */\n"
120 #: build/C/man3/fgetgrent.3:77 build/C/man3/fgetpwent.3:81 build/C/man3/getgrent.3:107 build/C/man3/getgrent_r.3:102 build/C/man3/getgrnam.3:137 build/C/man3/getgrouplist.3:78 build/C/man3/getpw.3:72 build/C/man3/getpwent.3:103 build/C/man3/getpwent_r.3:103 build/C/man3/getpwnam.3:143 build/C/man3/getspnam.3:216 build/C/man3/initgroups.3:68 build/C/man3/putgrent.3:41 build/C/man3/putpwent.3:70 build/C/man3/setaliasent.3:89
126 #: build/C/man3/fgetgrent.3:87
128 "The B<fgetgrent>() function returns a pointer to a I<group> structure, or "
129 "NULL if there are no more entries or an error occurs. In the event of an "
130 "error, I<errno> is set to indicate the cause."
134 #: build/C/man3/fgetgrent.3:87 build/C/man3/fgetpwent.3:91 build/C/man3/getgrent.3:130 build/C/man3/getgrent_r.3:109 build/C/man3/getgrnam.3:175 build/C/man3/getpw.3:88 build/C/man3/getpwent.3:125 build/C/man3/getpwent_r.3:110 build/C/man3/getpwnam.3:181 build/C/man3/getspnam.3:229 build/C/man3/initgroups.3:75 build/C/man3/putpwent.3:78
140 #: build/C/man3/fgetgrent.3:88 build/C/man3/fgetpwent.3:92 build/C/man3/getgrent.3:153 build/C/man3/getgrnam.3:197 build/C/man3/getpw.3:97 build/C/man3/getpwent.3:140 build/C/man3/getpwnam.3:203 build/C/man3/initgroups.3:76
146 #. to allocate the group structure, or to allocate buffers
148 #: build/C/man3/fgetgrent.3:93 build/C/man3/getgrent.3:159 build/C/man3/getgrnam.3:204
149 msgid "Insufficient memory to allocate I<group> structure."
153 #: build/C/man3/fgetgrent.3:93 build/C/man3/fgetpwent.3:101 build/C/man3/getgrent.3:177 build/C/man3/getgrent_r.3:117 build/C/man3/getgrnam.3:224 build/C/man3/getgrouplist.3:98 build/C/man3/getpw.3:106 build/C/man3/getpwent.3:165 build/C/man3/getpwent_r.3:118 build/C/man3/getpwnam.3:230 build/C/man3/getspnam.3:249 build/C/man3/initgroups.3:88 build/C/man3/putgrent.3:43 build/C/man3/putpwent.3:82 build/C/man3/setaliasent.3:101
155 msgid "CONFORMING TO"
159 #: build/C/man3/fgetgrent.3:95 build/C/man3/fgetpwent.3:103 build/C/man3/putpwent.3:84
164 #: build/C/man3/fgetgrent.3:95 build/C/man3/fgetpwent.3:103 build/C/man5/ftpusers.5:49 build/C/man3/getgrent.3:179 build/C/man3/getgrent_r.3:184 build/C/man3/getgrnam.3:247 build/C/man3/getgrouplist.3:189 build/C/man3/getpw.3:115 build/C/man3/getpwent.3:170 build/C/man3/getpwent_r.3:180 build/C/man3/getpwnam.3:326 build/C/man3/getspnam.3:253 build/C/man5/group.5:61 build/C/man3/initgroups.3:90 build/C/man5/passwd.5:162 build/C/man3/putgrent.3:45 build/C/man3/putpwent.3:84 build/C/man3/setaliasent.3:145
170 #: build/C/man3/fgetgrent.3:105
172 "B<endgrent>(3), B<fgetgrent_r>(3), B<fopen>(3), B<getgrent>(3), "
173 "B<getgrgid>(3), B<getgrnam>(3), B<putgrent>(3), B<setgrent>(3), B<group>(5)"
177 #: build/C/man3/fgetgrent.3:105 build/C/man3/fgetpwent.3:114 build/C/man5/ftpusers.5:53 build/C/man3/getgrent.3:187 build/C/man3/getgrent_r.3:191 build/C/man3/getgrnam.3:254 build/C/man3/getgrouplist.3:196 build/C/man3/getpw.3:124 build/C/man3/getpwent.3:178 build/C/man3/getpwent_r.3:188 build/C/man3/getpwnam.3:336 build/C/man3/getspnam.3:258 build/C/man5/group.5:67 build/C/man3/initgroups.3:94 build/C/man5/passwd.5:173 build/C/man3/putgrent.3:49 build/C/man3/putpwent.3:92 build/C/man3/setaliasent.3:154
183 #: build/C/man3/fgetgrent.3:113 build/C/man3/fgetpwent.3:122 build/C/man5/ftpusers.5:61 build/C/man3/getgrent.3:195 build/C/man3/getgrent_r.3:199 build/C/man3/getgrnam.3:262 build/C/man3/getgrouplist.3:204 build/C/man3/getpw.3:132 build/C/man3/getpwent.3:186 build/C/man3/getpwent_r.3:196 build/C/man3/getpwnam.3:344 build/C/man3/getspnam.3:266 build/C/man5/group.5:75 build/C/man3/initgroups.3:102 build/C/man5/passwd.5:181 build/C/man3/putgrent.3:57 build/C/man3/putpwent.3:100 build/C/man3/setaliasent.3:162
185 "This page is part of release 3.79 of the Linux I<man-pages> project. A "
186 "description of the project, information about reporting bugs, and the latest "
187 "version of this page, can be found at "
188 "\\%http://www.kernel.org/doc/man-pages/."
192 #: build/C/man3/fgetpwent.3:33
198 #: build/C/man3/fgetpwent.3:33 build/C/man3/putpwent.3:30
204 #: build/C/man3/fgetpwent.3:36
205 msgid "fgetpwent - get password file entry"
209 #: build/C/man3/fgetpwent.3:41 build/C/man3/putpwent.3:38
212 "B<#include E<lt>stdio.hE<gt>>\n"
213 "B<#include E<lt>sys/types.hE<gt>>\n"
214 "B<#include E<lt>pwd.hE<gt>>\n"
218 #: build/C/man3/fgetpwent.3:43
220 msgid "B<struct passwd *fgetpwent(FILE *>I<stream>B<);>\n"
224 #: build/C/man3/fgetpwent.3:52
225 msgid "B<fgetpwent>(): _SVID_SOURCE"
229 #: build/C/man3/fgetpwent.3:65
231 "The B<fgetpwent>() function returns a pointer to a structure containing the "
232 "broken out fields of a line in the file I<stream>. The first time it is "
233 "called it returns the first entry; thereafter, it returns successive "
234 "entries. The file referred to by I<stream> must have the same format as "
235 "I</etc/passwd> (see B<passwd>(5))."
239 #: build/C/man3/fgetpwent.3:67 build/C/man3/getpw.3:55 build/C/man3/getpwent.3:86 build/C/man3/getpwent_r.3:67 build/C/man3/getpwnam.3:90 build/C/man3/putpwent.3:56
240 msgid "The I<passwd> structure is defined in I<E<lt>pwd.hE<gt>> as follows:"
244 #: build/C/man3/fgetpwent.3:79
248 " char *pw_name; /* username */\n"
249 " char *pw_passwd; /* user password */\n"
250 " uid_t pw_uid; /* user ID */\n"
251 " gid_t pw_gid; /* group ID */\n"
252 " char *pw_gecos; /* real name */\n"
253 " char *pw_dir; /* home directory */\n"
254 " char *pw_shell; /* shell program */\n"
259 #: build/C/man3/fgetpwent.3:91
261 "The B<fgetpwent>() function returns a pointer to a I<passwd> structure, or "
262 "NULL if there are no more entries or an error occurs. In the event of an "
263 "error, I<errno> is set to indicate the cause."
267 #. This structure is static, allocated 0 or 1 times. No memory leak. (libc45)
269 #: build/C/man3/fgetpwent.3:97 build/C/man3/getpw.3:102 build/C/man3/getpwent.3:147 build/C/man3/getpwnam.3:210
270 msgid "Insufficient memory to allocate I<passwd> structure."
274 #: build/C/man3/fgetpwent.3:97 build/C/man5/ftpusers.5:47 build/C/man3/getgrent.3:162 build/C/man3/getgrnam.3:207 build/C/man3/getpw.3:102 build/C/man3/getpwent.3:150 build/C/man3/getpwnam.3:213 build/C/man3/getspnam.3:236 build/C/man5/group.5:53 build/C/man3/initgroups.3:84 build/C/man5/passwd.5:142 build/C/man3/setaliasent.3:95
280 #: build/C/man3/fgetpwent.3:98 build/C/man3/getpw.3:103 build/C/man3/getpwent.3:151 build/C/man3/getpwnam.3:214 build/C/man5/passwd.5:144
282 msgid "I</etc/passwd>"
286 #: build/C/man3/fgetpwent.3:101 build/C/man3/getpw.3:106
287 msgid "password database file"
291 #: build/C/man3/fgetpwent.3:114
293 "B<endpwent>(3), B<fgetpwent_r>(3), B<fopen>(3), B<getpw>(3), B<getpwent>(3), "
294 "B<getpwnam>(3), B<getpwuid>(3), B<putpwent>(3), B<setpwent>(3), B<passwd>(5)"
298 #: build/C/man5/ftpusers.5:19
304 #: build/C/man5/ftpusers.5:19
310 #: build/C/man5/ftpusers.5:19 build/C/man5/group.5:26 build/C/man5/passwd.5:30
316 #: build/C/man5/ftpusers.5:22
317 msgid "ftpusers - list of users that may not log in via the FTP daemon"
321 #: build/C/man5/ftpusers.5:41
323 "The text file B<ftpusers> contains a list of users that may not log in using "
324 "the File Transfer Protocol (FTP) server daemon. This file is used not "
325 "merely for system administration purposes but for improving security within "
326 "a TCP/IP networked environment. It will typically contain a list of the "
327 "users that either have no business using ftp or have too many privileges to "
328 "be allowed to log in through the FTP server daemon. Such users usually "
329 "include root, daemon, bin, uucp, and news. If your FTP server daemon "
330 "doesn't use B<ftpusers>, then it is suggested that you read its "
331 "documentation to find out how to block access for certain users. Washington "
332 "University FTP server Daemon (wuftpd) and Professional FTP Daemon (proftpd) "
333 "are known to make use of B<ftpusers>."
337 #: build/C/man5/ftpusers.5:41
343 #: build/C/man5/ftpusers.5:47
345 "The format of B<ftpusers> is very simple. There is one account name (or "
346 "username) per line. Lines starting with a # are ignored."
350 #: build/C/man5/ftpusers.5:49
351 msgid "I</etc/ftpusers>"
355 #: build/C/man5/ftpusers.5:53
356 msgid "B<passwd>(5), B<proftpd>(8), B<wuftpd>(8)"
360 #: build/C/man3/getgrent.3:30
366 #: build/C/man3/getgrent.3:30
372 #: build/C/man3/getgrent.3:33
373 msgid "getgrent, setgrent, endgrent - get group file entry"
377 #: build/C/man3/getgrent.3:37 build/C/man3/getgrnam.3:40 build/C/man3/initgroups.3:39
380 "B<#include E<lt>sys/types.hE<gt>>\n"
381 "B<#include E<lt>grp.hE<gt>>\n"
385 #: build/C/man3/getgrent.3:39
387 msgid "B<struct group *getgrent(void);>\n"
391 #: build/C/man3/getgrent.3:41
393 msgid "B<void setgrent(void);>\n"
397 #: build/C/man3/getgrent.3:43
399 msgid "B<void endgrent(void);>\n"
403 #: build/C/man3/getgrent.3:53
404 msgid "B<setgrent>():"
408 #: build/C/man3/getgrent.3:56
410 "_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || "
411 "_XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED ||"
415 #: build/C/man3/getgrent.3:58
416 msgid "/* Since glibc 2.12: */ _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
420 #: build/C/man3/getgrent.3:62
421 msgid "B<getgrent>(), B<endgrent>():"
425 #: build/C/man3/getgrent.3:65
427 "_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || "
428 "_XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED"
432 #: build/C/man3/getgrent.3:80
434 "The B<getgrent>() function returns a pointer to a structure containing the "
435 "broken-out fields of a record in the group database (e.g., the local group "
436 "file I</etc/group>, NIS, and LDAP). The first time B<getgrent>() is "
437 "called, it returns the first entry; thereafter, it returns successive "
442 #: build/C/man3/getgrent.3:85
444 "The B<setgrent>() function rewinds to the beginning of the group database, "
445 "to allow repeated scans."
449 #: build/C/man3/getgrent.3:90
451 "The B<endgrent>() function is used to close the group database after all "
452 "processing has been performed."
456 #: build/C/man3/getgrent.3:107 build/C/man3/getgrent_r.3:83 build/C/man3/getgrnam.3:101
457 msgid "For more information about the fields of this structure, see B<group>(5)."
461 #: build/C/man3/getgrent.3:114
463 "The B<getgrent>() function returns a pointer to a I<group> structure, or "
464 "NULL if there are no more entries or an error occurs."
468 #: build/C/man3/getgrent.3:121
470 "Upon error, I<errno> may be set. If one wants to check I<errno> after the "
471 "call, it should be set to zero before the call."
475 #: build/C/man3/getgrent.3:130
477 "The return value may point to a static area, and may be overwritten by "
478 "subsequent calls to B<getgrent>(), B<getgrgid>(3), or B<getgrnam>(3). (Do "
479 "not pass the returned pointer to B<free>(3).)"
483 #: build/C/man3/getgrent.3:131
489 #: build/C/man3/getgrent.3:136
491 "The service was temporarily unavailable; try again later. For NSS backends "
492 "in glibc this indicates a temporary error talking to the backend. The error "
493 "may correct itself, retrying later is suggested."
497 #: build/C/man3/getgrent.3:136 build/C/man3/getgrnam.3:183 build/C/man3/getpwent.3:126 build/C/man3/getpwnam.3:189
503 #: build/C/man3/getgrent.3:139 build/C/man3/getgrnam.3:186 build/C/man3/getpwent.3:129 build/C/man3/getpwnam.3:192
504 msgid "A signal was caught."
508 #: build/C/man3/getgrent.3:139 build/C/man3/getgrnam.3:186 build/C/man3/getpwent.3:129 build/C/man3/getpwnam.3:192
514 #: build/C/man3/getgrent.3:142 build/C/man3/getgrnam.3:189 build/C/man3/getpwent.3:132 build/C/man3/getpwnam.3:195
519 #: build/C/man3/getgrent.3:142 build/C/man3/getgrnam.3:189 build/C/man3/getpwent.3:132 build/C/man3/getpwnam.3:195
525 #: build/C/man3/getgrent.3:145
526 msgid "The calling process already has too many open files."
530 #: build/C/man3/getgrent.3:145 build/C/man3/getgrnam.3:194 build/C/man3/getpwent.3:137 build/C/man3/getpwnam.3:200
536 #: build/C/man3/getgrent.3:148
537 msgid "Too many open files in the system."
541 #: build/C/man3/getgrent.3:148 build/C/man3/getgrent_r.3:110 build/C/man3/getpwent_r.3:111
547 #: build/C/man3/getgrent.3:153
549 "A necessary input file cannot be found. For NSS backends in glibc this "
550 "indicates the backend is not correctly configured."
554 #: build/C/man3/getgrent.3:159 build/C/man3/getgrent_r.3:113 build/C/man3/getgrnam.3:204 build/C/man3/getpwent.3:147 build/C/man3/getpwent_r.3:114 build/C/man3/getpwnam.3:210 build/C/man3/getspnam.3:233
560 #: build/C/man3/getgrent.3:162 build/C/man3/getgrnam.3:207 build/C/man3/getpwent.3:150 build/C/man3/getpwnam.3:213
561 msgid "Insufficient buffer space supplied."
565 #: build/C/man3/getgrent.3:163 build/C/man3/getgrnam.3:208
567 msgid "I</etc/group>"
571 #: build/C/man3/getgrent.3:166 build/C/man3/getgrnam.3:211
572 msgid "local group database file"
576 #: build/C/man3/getgrent.3:166 build/C/man3/getgrnam.3:211 build/C/man3/getpwent.3:154 build/C/man3/getpwnam.3:217
582 #: build/C/man3/getgrent.3:167 build/C/man3/getgrnam.3:212 build/C/man3/getpwent.3:155 build/C/man3/getpwnam.3:218
584 msgid "Multithreading (see pthreads(7))"
588 #: build/C/man3/getgrent.3:171
589 msgid "The B<getgrent>() function is not thread-safe."
593 #: build/C/man3/getgrent.3:177
594 msgid "The B<setgrent>() and B<endgrent>() functions are thread-safe."
598 #: build/C/man3/getgrent.3:179 build/C/man3/getgrnam.3:226
599 msgid "SVr4, 4.3BSD, POSIX.1-2001."
603 #: build/C/man3/getgrent.3:187
605 "B<fgetgrent>(3), B<getgrent_r>(3), B<getgrgid>(3), B<getgrnam>(3), "
606 "B<getgrouplist>(3), B<putgrent>(3), B<group>(5)"
610 #: build/C/man3/getgrent_r.3:24
616 #: build/C/man3/getgrent_r.3:24 build/C/man3/getpw.3:32 build/C/man3/getpwent_r.3:24 build/C/man3/getspnam.3:8 build/C/man3/putgrent.3:7
622 #: build/C/man3/getgrent_r.3:27
623 msgid "getgrent_r, fgetgrent_r - get group file entry reentrantly"
627 #: build/C/man3/getgrent_r.3:30
629 msgid "B<#include E<lt>grp.hE<gt>>\n"
633 #: build/C/man3/getgrent_r.3:32
635 msgid "B<int getgrent_r(struct group *>I<gbuf>B<, char *>I<buf>B<,>\n"
639 #: build/C/man3/getgrent_r.3:34
641 msgid "B< size_t >I<buflen>B<, struct group **>I<gbufp>B<);>\n"
645 #: build/C/man3/getgrent_r.3:36
648 "B<int fgetgrent_r(FILE *>I<stream>B<, struct group *>I<gbuf>B<, char "
653 #: build/C/man3/getgrent_r.3:38
655 msgid "B< size_t >I<buflen>B<, struct group **>I<gbufp>B<);>\n"
658 #. FIXME . The FTM requirements seem inconsistent here. File a glibc bug?
660 #: build/C/man3/getgrent_r.3:48
661 msgid "B<getgrent_r>(): _GNU_SOURCE"
665 #: build/C/man3/getgrent_r.3:51
666 msgid "B<fgetgrent_r>(): _SVID_SOURCE"
670 #: build/C/man3/getgrent_r.3:64
672 "The functions B<getgrent_r>() and B<fgetgrent_r>() are the reentrant "
673 "versions of B<getgrent>(3) and B<fgetgrent>(3). The former reads the next "
674 "group entry from the stream initialized by B<setgrent>(3). The latter reads "
675 "the next group entry from I<stream>."
679 #: build/C/man3/getgrent_r.3:102
681 "The nonreentrant functions return a pointer to static storage, where this "
682 "static storage contains further pointers to group name, password and "
683 "members. The reentrant functions described here return all of that in "
684 "caller-provided buffers. First of all there is the buffer I<gbuf> that can "
685 "hold a I<struct group>. And next the buffer I<buf> of size I<buflen> that "
686 "can hold additional strings. The result of these functions, the I<struct "
687 "group> read from the stream, is stored in the provided buffer I<*gbuf>, and "
688 "a pointer to this I<struct group> is returned in I<*gbufp>."
692 #: build/C/man3/getgrent_r.3:109
694 "On success, these functions return 0 and I<*gbufp> is a pointer to the "
695 "I<struct group>. On error, these functions return an error value and "
700 #: build/C/man3/getgrent_r.3:113 build/C/man3/getpwent_r.3:114
701 msgid "No more entries."
705 #: build/C/man3/getgrent_r.3:117 build/C/man3/getpwent_r.3:118
706 msgid "Insufficient buffer space supplied. Try again with larger buffer."
710 #: build/C/man3/getgrent_r.3:122 build/C/man3/getpwent_r.3:123
712 "These functions are GNU extensions, done in a style resembling the POSIX "
713 "version of functions like B<getpwnam_r>(3). Other systems use the prototype"
717 #: build/C/man3/getgrent_r.3:127
720 "struct group *getgrent_r(struct group *grp, char *buf,\n"
725 #: build/C/man3/getgrent_r.3:131 build/C/man3/getpwent_r.3:132
730 #: build/C/man3/getgrent_r.3:136
733 "int getgrent_r(struct group *grp, char *buf, int buflen,\n"
738 #: build/C/man3/getgrent_r.3:138 build/C/man3/getgrnam.3:226 build/C/man3/getpwent_r.3:140 build/C/man3/getpwnam.3:235 build/C/man5/passwd.5:144
744 #: build/C/man3/getgrent_r.3:143
746 "The function B<getgrent_r>() is not really reentrant since it shares the "
747 "reading position in the stream with all other threads."
751 #: build/C/man3/getgrent_r.3:143 build/C/man3/getgrouplist.3:109 build/C/man3/getpwent_r.3:145 build/C/man3/getpwnam.3:274 build/C/man3/setaliasent.3:115
757 #: build/C/man3/getgrent_r.3:150
760 "#define _GNU_SOURCE\n"
761 "#include E<lt>grp.hE<gt>\n"
762 "#include E<lt>stdio.hE<gt>\n"
763 "#include E<lt>stdlib.hE<gt>\n"
764 "#define BUFLEN 4096\n"
768 #: build/C/man3/getgrent_r.3:157
774 " struct group grp, *grpp;\n"
775 " char buf[BUFLEN];\n"
780 #: build/C/man3/getgrent_r.3:174
785 " i = getgrent_r(&grp, buf, BUFLEN, &grpp);\n"
788 " printf(\"%s (%d):\", grpp-E<gt>gr_name, grpp-E<gt>gr_gid);\n"
789 " for (i = 0; ; i++) {\n"
790 " if (grpp-E<gt>gr_mem[i] == NULL)\n"
792 " printf(\" %s\", grpp-E<gt>gr_mem[i]);\n"
794 " printf(\"\\en\");\n"
797 " exit(EXIT_SUCCESS);\n"
802 #: build/C/man3/getgrent_r.3:191
804 "B<fgetgrent>(3), B<getgrent>(3), B<getgrgid>(3), B<getgrnam>(3), "
805 "B<putgrent>(3), B<group>(5)"
809 #: build/C/man3/getgrnam.3:33
815 #: build/C/man3/getgrnam.3:36
816 msgid "getgrnam, getgrnam_r, getgrgid, getgrgid_r - get group file entry"
820 #: build/C/man3/getgrnam.3:42
822 msgid "B<struct group *getgrnam(const char *>I<name>B<);>\n"
826 #: build/C/man3/getgrnam.3:44
828 msgid "B<struct group *getgrgid(gid_t >I<gid>B<);>\n"
832 #: build/C/man3/getgrnam.3:46
834 msgid "B<int getgrnam_r(const char *>I<name>B<, struct group *>I<grp>B<,>\n"
838 #: build/C/man3/getgrnam.3:48 build/C/man3/getgrnam.3:52
841 "B< char *>I<buf>B<, size_t >I<buflen>B<, struct group "
842 "**>I<result>B<);>\n"
846 #: build/C/man3/getgrnam.3:50
848 msgid "B<int getgrgid_r(gid_t >I<gid>B<, struct group *>I<grp>B<,>\n"
852 #: build/C/man3/getgrnam.3:62
853 msgid "B<getgrnam_r>(), B<getgrgid_r>():"
857 #: build/C/man3/getgrnam.3:65 build/C/man3/getpwnam.3:69
859 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE "
864 #: build/C/man3/getgrnam.3:77
866 "The B<getgrnam>() function returns a pointer to a structure containing the "
867 "broken-out fields of the record in the group database (e.g., the local group "
868 "file I</etc/group>, NIS, and LDAP) that matches the group name I<name>."
872 #: build/C/man3/getgrnam.3:84
874 "The B<getgrgid>() function returns a pointer to a structure containing the "
875 "broken-out fields of the record in the group database that matches the group "
880 #: build/C/man3/getgrnam.3:124
882 "The B<getgrnam_r>() and B<getgrgid_r>() functions obtain the same "
883 "information as B<getgrnam>() and B<getgrgid>(), but store the retrieved "
884 "I<group> structure in the space pointed to by I<grp>. The string fields "
885 "pointed to by the members of the I<group> structure are stored in the buffer "
886 "I<buf> of size I<buflen>. A pointer to the result (in case of success) or "
887 "NULL (in case no entry was found or an error occurred) is stored in "
892 #: build/C/man3/getgrnam.3:126 build/C/man3/getpwnam.3:132
897 #: build/C/man3/getgrnam.3:128
899 msgid " sysconf(_SC_GETGR_R_SIZE_MAX)\n"
903 #: build/C/man3/getgrnam.3:137 build/C/man3/getpwnam.3:143
905 "returns either -1, without changing I<errno>, or an initial suggested size "
906 "for I<buf>. (If this size is too small, the call fails with B<ERANGE>, in "
907 "which case the caller can retry with a larger buffer.)"
911 #: build/C/man3/getgrnam.3:152
913 "The B<getgrnam>() and B<getgrgid>() functions return a pointer to a "
914 "I<group> structure, or NULL if the matching entry is not found or an error "
915 "occurs. If an error occurs, I<errno> is set appropriately. If one wants to "
916 "check I<errno> after the call, it should be set to zero before the call."
920 #: build/C/man3/getgrnam.3:161
922 "The return value may point to a static area, and may be overwritten by "
923 "subsequent calls to B<getgrent>(3), B<getgrgid>(), or B<getgrnam>(). (Do "
924 "not pass the returned pointer to B<free>(3).)"
928 #: build/C/man3/getgrnam.3:175
930 "On success, B<getgrnam_r>() and B<getgrgid_r>() return zero, and set "
931 "I<*result> to I<grp>. If no matching group record was found, these "
932 "functions return 0 and store NULL in I<*result>. In case of error, an error "
933 "number is returned, and NULL is stored in I<*result>."
937 #: build/C/man3/getgrnam.3:176 build/C/man3/getpwnam.3:182
939 msgid "B<0> or B<ENOENT> or B<ESRCH> or B<EBADF> or B<EPERM> or ... "
943 #: build/C/man3/getgrnam.3:183
944 msgid "The given I<name> or I<gid> was not found."
948 #: build/C/man3/getgrnam.3:194 build/C/man3/getpwent.3:137 build/C/man3/getpwnam.3:200
950 "The maximum number (B<OPEN_MAX>) of files was open already in the calling "
955 #: build/C/man3/getgrnam.3:197 build/C/man3/getpwent.3:140 build/C/man3/getpwnam.3:203
956 msgid "The maximum number of files was open already in the system."
960 #: build/C/man3/getgrnam.3:218
961 msgid "The B<getgrnam>() and B<getgrgid>() functions are not thread-safe."
965 #: build/C/man3/getgrnam.3:224
966 msgid "The B<getgrnam_r>() and B<getgrgid_r>() functions are thread-safe."
970 #. AIX 5.1 - gives ESRCH
971 #. OSF1 4.0g - gives EWOULDBLOCK
972 #. libc, glibc up to version 2.6, Irix 6.5 - give ENOENT
973 #. glibc since version 2.7 - give 0
974 #. FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 - give EPERM
975 #. SunOS 5.8 - gives EBADF
976 #. Tru64 5.1b, HP-UX-11i, SunOS 5.7 - give 0
978 #: build/C/man3/getgrnam.3:247
980 "The formulation given above under \"RETURN VALUE\" is from POSIX.1-2001. It "
981 "does not call \"not found\" an error, hence does not specify what value "
982 "I<errno> might have in this situation. But that makes it impossible to "
983 "recognize errors. One might argue that according to POSIX I<errno> should "
984 "be left unchanged if an entry is not found. Experiments on various "
985 "UNIX-like systems shows that lots of different values occur in this "
986 "situation: 0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM, and probably others."
990 #: build/C/man3/getgrnam.3:254
992 "B<endgrent>(3), B<fgetgrent>(3), B<getgrent>(3), B<getpwnam>(3), "
993 "B<setgrent>(3), B<group>(5)"
997 #: build/C/man3/getgrouplist.3:29
1003 #: build/C/man3/getgrouplist.3:32
1004 msgid "getgrouplist - get list of groups to which a user belongs"
1008 #: build/C/man3/getgrouplist.3:34 build/C/man3/putgrent.3:14
1009 msgid "B<#include E<lt>grp.hE<gt>>"
1013 #: build/C/man3/getgrouplist.3:36
1014 msgid "B<int getgrouplist(const char *>I<user>B<, gid_t >I<group>B<,>"
1018 #: build/C/man3/getgrouplist.3:38
1019 msgid "B< gid_t *>I<groups>B<, int *>I<ngroups>B<);>"
1023 #: build/C/man3/getgrouplist.3:46
1024 msgid "B<getgrouplist>(): _BSD_SOURCE"
1028 #: build/C/man3/getgrouplist.3:58
1030 "The B<getgrouplist>() function scans the group database (see B<group>(5)) "
1031 "to obtain the list of groups that I<user> belongs to. Up to I<*ngroups> of "
1032 "these groups are returned in the array I<groups>."
1036 #: build/C/man3/getgrouplist.3:68
1038 "If it was not among the groups defined for I<user> in the group database, "
1039 "then I<group> is included in the list of groups returned by "
1040 "B<getgrouplist>(); typically this argument is specified as the group ID from "
1041 "the password record for I<user>."
1045 #: build/C/man3/getgrouplist.3:78
1047 "The I<ngroups> argument is a value-result argument: on return it always "
1048 "contains the number of groups found for I<user>, including I<group>; this "
1049 "value may be greater than the number of groups stored in I<groups>."
1053 #: build/C/man3/getgrouplist.3:86
1055 "If the number of groups of which I<user> is a member is less than or equal "
1056 "to I<*ngroups>, then the value I<*ngroups> is returned."
1060 #: build/C/man3/getgrouplist.3:96
1062 "If the user is a member of more than I<*ngroups> groups, then "
1063 "B<getgrouplist>() returns -1. In this case, the value returned in "
1064 "I<*ngroups> can be used to resize the buffer passed to a further call "
1065 "B<getgrouplist>()."
1069 #: build/C/man3/getgrouplist.3:96
1075 #: build/C/man3/getgrouplist.3:98
1076 msgid "This function is present since glibc 2.2.4."
1080 #: build/C/man3/getgrouplist.3:100
1081 msgid "This function is nonstandard; it appears on most BSDs."
1085 #: build/C/man3/getgrouplist.3:100 build/C/man3/getpw.3:108 build/C/man5/group.5:55
1091 #: build/C/man3/getgrouplist.3:109
1093 "In glibc versions before 2.3.3, the implementation of this function contains "
1094 "a buffer-overrun bug: it returns the complete list of groups for I<user> in "
1095 "the array I<groups>, even when the number of groups exceeds I<*ngroups>."
1099 #: build/C/man3/getgrouplist.3:118
1101 "The program below displays the group list for the user named in its first "
1102 "command-line argument. The second command-line argument specifies the "
1103 "I<ngroups> value to be supplied to B<getgrouplist>(). The following shell "
1104 "session shows examples of the use of this program:"
1108 #: build/C/man3/getgrouplist.3:128
1111 "$B< ./a.out cecilia 0>\n"
1112 "getgrouplist() returned -1; ngroups = 3\n"
1113 "$B< ./a.out cecilia 3>\n"
1121 #: build/C/man3/getgrouplist.3:130
1123 msgid "Program source"
1127 #: build/C/man3/getgrouplist.3:137
1130 "#include E<lt>stdio.hE<gt>\n"
1131 "#include E<lt>stdlib.hE<gt>\n"
1132 "#include E<lt>grp.hE<gt>\n"
1133 "#include E<lt>pwd.hE<gt>\n"
1137 #: build/C/man3/getgrouplist.3:145
1141 "main(int argc, char *argv[])\n"
1143 " int j, ngroups;\n"
1145 " struct passwd *pw;\n"
1146 " struct group *gr;\n"
1150 #: build/C/man3/getgrouplist.3:150
1153 " if (argc != 3) {\n"
1154 " fprintf(stderr, \"Usage: %s E<lt>userE<gt> E<lt>ngroupsE<gt>\\en\", "
1156 " exit(EXIT_FAILURE);\n"
1161 #: build/C/man3/getgrouplist.3:152
1163 msgid " ngroups = atoi(argv[2]);\n"
1167 #: build/C/man3/getgrouplist.3:158
1170 " groups = malloc(ngroups * sizeof (gid_t));\n"
1171 " if (groups == NULL) {\n"
1172 " perror(\"malloc\");\n"
1173 " exit(EXIT_FAILURE);\n"
1178 #: build/C/man3/getgrouplist.3:160
1180 msgid " /* Fetch passwd structure (contains first group ID for user) */\n"
1184 #: build/C/man3/getgrouplist.3:166
1187 " pw = getpwnam(argv[1]);\n"
1188 " if (pw == NULL) {\n"
1189 " perror(\"getpwnam\");\n"
1190 " exit(EXIT_SUCCESS);\n"
1195 #: build/C/man3/getgrouplist.3:168
1197 msgid " /* Retrieve group list */\n"
1201 #: build/C/man3/getgrouplist.3:174
1204 " if (getgrouplist(argv[1], pw-E<gt>pw_gid, groups, &ngroups) == -1) {\n"
1205 " fprintf(stderr, \"getgrouplist() returned -1; ngroups = %d\\en\",\n"
1207 " exit(EXIT_FAILURE);\n"
1212 #: build/C/man3/getgrouplist.3:176
1214 msgid " /* Display list of retrieved groups, along with group names */\n"
1218 #: build/C/man3/getgrouplist.3:185
1221 " fprintf(stderr, \"ngroups = %d\\en\", ngroups);\n"
1222 " for (j = 0; j E<lt> ngroups; j++) {\n"
1223 " printf(\"%d\", groups[j]);\n"
1224 " gr = getgrgid(groups[j]);\n"
1225 " if (gr != NULL)\n"
1226 " printf(\" (%s)\", gr-E<gt>gr_name);\n"
1227 " printf(\"\\en\");\n"
1232 #: build/C/man3/getgrouplist.3:188
1235 " exit(EXIT_SUCCESS);\n"
1240 #: build/C/man3/getgrouplist.3:196
1242 "B<getgroups>(2), B<setgroups>(2), B<getgrent>(3), B<group_member>(3), "
1243 "B<group>(5), B<passwd>(5)"
1247 #: build/C/man3/getpw.3:32
1253 #: build/C/man3/getpw.3:35
1254 msgid "getpw - reconstruct password line entry"
1258 #: build/C/man3/getpw.3:40
1261 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
1262 "B<#include E<lt>sys/types.hE<gt>>\n"
1263 "B<#include E<lt>pwd.hE<gt>>\n"
1267 #: build/C/man3/getpw.3:42
1269 msgid "B<int getpw(uid_t >I<uid>B<, char *>I<buf>B<);>\n"
1273 #: build/C/man3/getpw.3:49
1275 "The B<getpw>() function reconstructs the password line entry for the given "
1276 "user ID I<uid> in the buffer I<buf>. The returned buffer contains a line of "
1281 #: build/C/man3/getpw.3:52
1282 msgid "B<name:passwd:uid:gid:gecos:dir:shell>"
1286 #: build/C/man3/getpw.3:67 build/C/man3/getpwent.3:98 build/C/man3/getpwnam.3:102
1290 " char *pw_name; /* username */\n"
1291 " char *pw_passwd; /* user password */\n"
1292 " uid_t pw_uid; /* user ID */\n"
1293 " gid_t pw_gid; /* group ID */\n"
1294 " char *pw_gecos; /* user information */\n"
1295 " char *pw_dir; /* home directory */\n"
1296 " char *pw_shell; /* shell program */\n"
1301 #: build/C/man3/getpw.3:72 build/C/man3/getpwent.3:103 build/C/man3/getpwent_r.3:84
1302 msgid "For more information about the fields of this structure, see B<passwd>(5)."
1306 #: build/C/man3/getpw.3:78
1308 "The B<getpw>() function returns 0 on success; on error, it returns -1, and "
1309 "I<errno> is set to indicate the error."
1313 #: build/C/man3/getpw.3:88
1315 "If I<uid> is not found in the password database, B<getpw>() returns -1, "
1316 "sets I<errno> to 0, and leaves I<buf> unchanged."
1320 #: build/C/man3/getpw.3:89
1322 msgid "B<0> or B<ENOENT>"
1326 #: build/C/man3/getpw.3:93
1327 msgid "No user corresponding to I<uid>."
1331 #: build/C/man3/getpw.3:93 build/C/man3/putpwent.3:79
1337 #: build/C/man3/getpw.3:97
1338 msgid "I<buf> is NULL."
1342 #: build/C/man3/getpw.3:108
1347 #: build/C/man3/getpw.3:115
1349 "The B<getpw>() function is dangerous as it may overflow the provided buffer "
1350 "I<buf>. It is obsoleted by B<getpwuid>(3)."
1354 #: build/C/man3/getpw.3:124
1356 "B<endpwent>(3), B<fgetpwent>(3), B<getpwent>(3), B<getpwnam>(3), "
1357 "B<getpwuid>(3), B<putpwent>(3), B<setpwent>(3), B<passwd>(5)"
1361 #: build/C/man3/getpwent.3:33
1367 #: build/C/man3/getpwent.3:33
1373 #: build/C/man3/getpwent.3:36
1374 msgid "getpwent, setpwent, endpwent - get password file entry"
1378 #: build/C/man3/getpwent.3:40 build/C/man3/getpwnam.3:44
1381 "B<#include E<lt>sys/types.hE<gt>>\n"
1382 "B<#include E<lt>pwd.hE<gt>>\n"
1386 #: build/C/man3/getpwent.3:42
1388 msgid "B<struct passwd *getpwent(void);>\n"
1392 #: build/C/man3/getpwent.3:44
1394 msgid "B<void setpwent(void);>\n"
1398 #: build/C/man3/getpwent.3:46
1400 msgid "B<void endpwent(void);>\n"
1404 #: build/C/man3/getpwent.3:57
1405 msgid "B<getpwent>(), B<setpwent>(), B<endpwent>():"
1409 #: build/C/man3/getpwent.3:60
1411 "_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || "
1412 "_XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED"
1416 #: build/C/man3/getpwent.3:74
1418 "The B<getpwent>() function returns a pointer to a structure containing the "
1419 "broken-out fields of a record from the password database (e.g., the local "
1420 "password file I</etc/passwd>, NIS, and LDAP). The first time B<getpwent>() "
1421 "is called, it returns the first entry; thereafter, it returns successive "
1426 #: build/C/man3/getpwent.3:79
1428 "The B<setpwent>() function rewinds to the beginning of the password "
1433 #: build/C/man3/getpwent.3:84
1435 "The B<endpwent>() function is used to close the password database after all "
1436 "processing has been performed."
1440 #: build/C/man3/getpwent.3:116
1442 "The B<getpwent>() function returns a pointer to a I<passwd> structure, or "
1443 "NULL if there are no more entries or an error occurred. If an error occurs, "
1444 "I<errno> is set appropriately. If one wants to check I<errno> after the "
1445 "call, it should be set to zero before the call."
1449 #: build/C/man3/getpwent.3:125
1451 "The return value may point to a static area, and may be overwritten by "
1452 "subsequent calls to B<getpwent>(), B<getpwnam>(3), or B<getpwuid>(3). (Do "
1453 "not pass the returned pointer to B<free>(3).)"
1457 #: build/C/man3/getpwent.3:154 build/C/man3/getpwnam.3:217
1458 msgid "local password database file"
1462 #: build/C/man3/getpwent.3:159
1463 msgid "The B<getpwent>() function is not thread-safe."
1467 #: build/C/man3/getpwent.3:165
1468 msgid "The B<setpwent>() and B<endpwent>() functions are thread-safe."
1472 #: build/C/man3/getpwent.3:170 build/C/man3/getpwnam.3:235
1474 "SVr4, 4.3BSD, POSIX.1-2001. The I<pw_gecos> field is not specified in "
1475 "POSIX, but is present on most implementations."
1479 #: build/C/man3/getpwent.3:178
1481 "B<fgetpwent>(3), B<getpw>(3), B<getpwent_r>(3), B<getpwnam>(3), "
1482 "B<getpwuid>(3), B<putpwent>(3), B<passwd>(5)"
1486 #: build/C/man3/getpwent_r.3:24
1492 #: build/C/man3/getpwent_r.3:27
1493 msgid "getpwent_r, fgetpwent_r - get passwd file entry reentrantly"
1497 #: build/C/man3/getpwent_r.3:30
1499 msgid "B<#include E<lt>pwd.hE<gt>>\n"
1503 #: build/C/man3/getpwent_r.3:32
1505 msgid "B<int getpwent_r(struct passwd *>I<pwbuf>B<, char *>I<buf>B<,>\n"
1509 #: build/C/man3/getpwent_r.3:34
1511 msgid "B< size_t >I<buflen>B<, struct passwd **>I<pwbufp>B<);>\n"
1515 #: build/C/man3/getpwent_r.3:36
1518 "B<int fgetpwent_r(FILE *>I<stream>B<, struct passwd *>I<pwbuf>B<, char "
1523 #: build/C/man3/getpwent_r.3:38
1525 msgid "B< size_t >I<buflen>B<, struct passwd **>I<pwbufp>B<);>\n"
1529 #: build/C/man3/getpwent_r.3:47
1530 msgid "B<getpwent_r>(), _BSD_SOURCE || _SVID_SOURCE"
1534 #: build/C/man3/getpwent_r.3:50
1535 msgid "B<fgetpwent_r>(): _SVID_SOURCE"
1539 #: build/C/man3/getpwent_r.3:63
1541 "The functions B<getpwent_r>() and B<fgetpwent_r>() are the reentrant "
1542 "versions of B<getpwent>(3) and B<fgetpwent>(3). The former reads the next "
1543 "passwd entry from the stream initialized by B<setpwent>(3). The latter "
1544 "reads the next passwd entry from I<stream>."
1548 #: build/C/man3/getpwent_r.3:79
1552 " char *pw_name; /* username */\n"
1553 " char *pw_passwd; /* user password */\n"
1554 " uid_t pw_uid; /* user ID */\n"
1555 " gid_t pw_gid; /* group ID */\n"
1556 " char *pw_gecos; /* user information */\n"
1557 " char *pw_dir; /* home directory */\n"
1558 " char *pw_shell; /* shell program */\n"
1563 #: build/C/man3/getpwent_r.3:103
1565 "The nonreentrant functions return a pointer to static storage, where this "
1566 "static storage contains further pointers to user name, password, gecos "
1567 "field, home directory and shell. The reentrant functions described here "
1568 "return all of that in caller-provided buffers. First of all there is the "
1569 "buffer I<pwbuf> that can hold a I<struct passwd>. And next the buffer "
1570 "I<buf> of size I<buflen> that can hold additional strings. The result of "
1571 "these functions, the I<struct passwd> read from the stream, is stored in the "
1572 "provided buffer I<*pwbuf>, and a pointer to this I<struct passwd> is "
1573 "returned in I<*pwbufp>."
1577 #: build/C/man3/getpwent_r.3:110
1579 "On success, these functions return 0 and I<*pwbufp> is a pointer to the "
1580 "I<struct passwd>. On error, these functions return an error value and "
1581 "I<*pwbufp> is NULL."
1585 #: build/C/man3/getpwent_r.3:128
1589 "getpwent_r(struct passwd *pwd, char *buf, int buflen);\n"
1593 #: build/C/man3/getpwent_r.3:138
1597 "getpwent_r(struct passwd *pwd, char *buf, int buflen,\n"
1602 #: build/C/man3/getpwent_r.3:145
1604 "The function B<getpwent_r>() is not really reentrant since it shares the "
1605 "reading position in the stream with all other threads."
1609 #: build/C/man3/getpwent_r.3:151
1612 "#define _GNU_SOURCE\n"
1613 "#include E<lt>pwd.hE<gt>\n"
1614 "#include E<lt>stdio.hE<gt>\n"
1615 "#define BUFLEN 4096\n"
1619 #: build/C/man3/getpwent_r.3:158
1625 " struct passwd pw, *pwp;\n"
1626 " char buf[BUFLEN];\n"
1631 #: build/C/man3/getpwent_r.3:170
1636 " i = getpwent_r(&pw, buf, BUFLEN, &pwp);\n"
1639 " printf(\"%s (%d)\\etHOME %s\\etSHELL %s\\en\", pwp-E<gt>pw_name,\n"
1640 " pwp-E<gt>pw_uid, pwp-E<gt>pw_dir, pwp-E<gt>pw_shell);\n"
1643 " exit(EXIT_SUCCESS);\n"
1648 #: build/C/man3/getpwent_r.3:188
1650 "B<fgetpwent>(3), B<getpw>(3), B<getpwent>(3), B<getpwnam>(3), "
1651 "B<getpwuid>(3), B<putpwent>(3), B<passwd>(5)"
1655 #: build/C/man3/getpwnam.3:37
1661 #: build/C/man3/getpwnam.3:37
1667 #: build/C/man3/getpwnam.3:40
1668 msgid "getpwnam, getpwnam_r, getpwuid, getpwuid_r - get password file entry"
1672 #: build/C/man3/getpwnam.3:46
1674 msgid "B<struct passwd *getpwnam(const char *>I<name>B<);>\n"
1678 #: build/C/man3/getpwnam.3:48
1680 msgid "B<struct passwd *getpwuid(uid_t >I<uid>B<);>\n"
1684 #: build/C/man3/getpwnam.3:50
1686 msgid "B<int getpwnam_r(const char *>I<name>B<, struct passwd *>I<pwd>B<,>\n"
1690 #: build/C/man3/getpwnam.3:52 build/C/man3/getpwnam.3:56
1693 "B< char *>I<buf>B<, size_t >I<buflen>B<, struct passwd "
1694 "**>I<result>B<);>\n"
1698 #: build/C/man3/getpwnam.3:54
1700 msgid "B<int getpwuid_r(uid_t >I<uid>B<, struct passwd *>I<pwd>B<,>\n"
1704 #: build/C/man3/getpwnam.3:66
1705 msgid "B<getpwnam_r>(), B<getpwuid_r>():"
1709 #: build/C/man3/getpwnam.3:81
1711 "The B<getpwnam>() function returns a pointer to a structure containing the "
1712 "broken-out fields of the record in the password database (e.g., the local "
1713 "password file I</etc/passwd>, NIS, and LDAP) that matches the username "
1718 #: build/C/man3/getpwnam.3:88
1720 "The B<getpwuid>() function returns a pointer to a structure containing the "
1721 "broken-out fields of the record in the password database that matches the "
1726 #: build/C/man3/getpwnam.3:108
1727 msgid "See B<passwd>(5) for more information about these fields."
1731 #: build/C/man3/getpwnam.3:130
1733 "The B<getpwnam_r>() and B<getpwuid_r>() functions obtain the same "
1734 "information as B<getpwnam>() and B<getpwuid>(), but store the retrieved "
1735 "I<passwd> structure in the space pointed to by I<pwd>. The string fields "
1736 "pointed to by the members of the I<passwd> structure are stored in the "
1737 "buffer I<buf> of size I<buflen>. A pointer to the result (in case of "
1738 "success) or NULL (in case no entry was found or an error occurred) is stored "
1743 #: build/C/man3/getpwnam.3:134
1745 msgid " sysconf(_SC_GETPW_R_SIZE_MAX)\n"
1749 #: build/C/man3/getpwnam.3:158
1751 "The B<getpwnam>() and B<getpwuid>() functions return a pointer to a "
1752 "I<passwd> structure, or NULL if the matching entry is not found or an error "
1753 "occurs. If an error occurs, I<errno> is set appropriately. If one wants to "
1754 "check I<errno> after the call, it should be set to zero before the call."
1758 #: build/C/man3/getpwnam.3:167
1760 "The return value may point to a static area, and may be overwritten by "
1761 "subsequent calls to B<getpwent>(3), B<getpwnam>(), or B<getpwuid>(). (Do "
1762 "not pass the returned pointer to B<free>(3).)"
1766 #: build/C/man3/getpwnam.3:181
1768 "On success, B<getpwnam_r>() and B<getpwuid_r>() return zero, and set "
1769 "I<*result> to I<pwd>. If no matching password record was found, these "
1770 "functions return 0 and store NULL in I<*result>. In case of error, an error "
1771 "number is returned, and NULL is stored in I<*result>."
1775 #: build/C/man3/getpwnam.3:189
1776 msgid "The given I<name> or I<uid> was not found."
1780 #: build/C/man3/getpwnam.3:224
1781 msgid "The B<getpwnam>() and B<getpwuid>() functions are not thread-safe."
1785 #: build/C/man3/getpwnam.3:230
1786 msgid "The B<getpwnam_r>() and B<getpwuid_r>() functions are thread-safe."
1790 #. AIX 5.1 - gives ESRCH
1791 #. OSF1 4.0g - gives EWOULDBLOCK
1792 #. libc, glibc up to version 2.6, Irix 6.5 - give ENOENT
1793 #. glibc since version 2.7 - give 0
1794 #. FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 - give EPERM
1795 #. SunOS 5.8 - gives EBADF
1796 #. Tru64 5.1b, HP-UX-11i, SunOS 5.7 - give 0
1798 #: build/C/man3/getpwnam.3:256
1800 "The formulation given above under \"RETURN VALUE\" is from POSIX.1-2001. It "
1801 "does not call \"not found\" an error, and hence does not specify what value "
1802 "I<errno> might have in this situation. But that makes it impossible to "
1803 "recognize errors. One might argue that according to POSIX I<errno> should "
1804 "be left unchanged if an entry is not found. Experiments on various "
1805 "UNIX-like systems show that lots of different values occur in this "
1806 "situation: 0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM, and probably others."
1810 #: build/C/man3/getpwnam.3:274
1812 "The I<pw_dir> field contains the name of the initial working directory of "
1813 "the user. Login programs use the value of this field to initialize the "
1814 "B<HOME> environment variable for the login shell. An application that wants "
1815 "to determine its user's home directory should inspect the value of B<HOME> "
1816 "(rather than the value I<getpwuid(getuid())-E<gt>pw_dir>) since this allows "
1817 "the user to modify their notion of \"the home directory\" during a login "
1818 "session. To determine the (initial) home directory of another user, it is "
1819 "necessary to use I<getpwnam(\"username\")-E<gt>pw_dir> or similar."
1823 #: build/C/man3/getpwnam.3:279
1825 "The program below demonstrates the use of B<getpwnam_r>() to find the full "
1826 "username and user ID for the username supplied as a command-line argument."
1830 #: build/C/man3/getpwnam.3:286
1833 "#include E<lt>pwd.hE<gt>\n"
1834 "#include E<lt>stdio.hE<gt>\n"
1835 "#include E<lt>stdlib.hE<gt>\n"
1836 "#include E<lt>unistd.hE<gt>\n"
1837 "#include E<lt>errno.hE<gt>\n"
1841 #: build/C/man3/getpwnam.3:295
1845 "main(int argc, char *argv[])\n"
1847 " struct passwd pwd;\n"
1848 " struct passwd *result;\n"
1850 " size_t bufsize;\n"
1855 #: build/C/man3/getpwnam.3:300
1858 " if (argc != 2) {\n"
1859 " fprintf(stderr, \"Usage: %s username\\en\", argv[0]);\n"
1860 " exit(EXIT_FAILURE);\n"
1865 #: build/C/man3/getpwnam.3:304
1868 " bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);\n"
1869 " if (bufsize == -1) /* Value was indeterminate */\n"
1870 " bufsize = 16384; /* Should be more than enough */\n"
1874 #: build/C/man3/getpwnam.3:310
1877 " buf = malloc(bufsize);\n"
1878 " if (buf == NULL) {\n"
1879 " perror(\"malloc\");\n"
1880 " exit(EXIT_FAILURE);\n"
1885 #: build/C/man3/getpwnam.3:321
1888 " s = getpwnam_r(argv[1], &pwd, buf, bufsize, &result);\n"
1889 " if (result == NULL) {\n"
1891 " printf(\"Not found\\en\");\n"
1894 " perror(\"getpwnam_r\");\n"
1896 " exit(EXIT_FAILURE);\n"
1901 #: build/C/man3/getpwnam.3:325
1904 " printf(\"Name: %s; UID: %ld\\en\", pwd.pw_gecos, (long) pwd.pw_uid);\n"
1905 " exit(EXIT_SUCCESS);\n"
1910 #: build/C/man3/getpwnam.3:336
1912 "B<endpwent>(3), B<fgetpwent>(3), B<getgrnam>(3), B<getpw>(3), "
1913 "B<getpwent>(3), B<getspnam>(3), B<putpwent>(3), B<setpwent>(3), B<passwd>(5)"
1917 #: build/C/man3/getspnam.3:8
1923 #: build/C/man3/getspnam.3:13
1925 "getspnam, getspnam_r, getspent, getspent_r, setspent, endspent, fgetspent, "
1926 "fgetspent_r, sgetspent, sgetspent_r, putspent, lckpwdf, ulckpwdf - get "
1927 "shadow password file entry"
1931 #: build/C/man3/getspnam.3:16
1933 msgid "/* General shadow password file API */\n"
1937 #: build/C/man3/getspnam.3:18 build/C/man3/getspnam.3:40
1939 msgid "B<#include E<lt>shadow.hE<gt>>\n"
1943 #: build/C/man3/getspnam.3:20
1945 msgid "B<struct spwd *getspnam(const char *>I<name>B<);>\n"
1949 #: build/C/man3/getspnam.3:22
1951 msgid "B<struct spwd *getspent(void);>\n"
1955 #: build/C/man3/getspnam.3:24
1957 msgid "B<void setspent(void);>\n"
1961 #: build/C/man3/getspnam.3:26
1963 msgid "B<void endspent(void);>\n"
1967 #: build/C/man3/getspnam.3:28
1969 msgid "B<struct spwd *fgetspent(FILE *>I<stream>B<);>\n"
1973 #: build/C/man3/getspnam.3:30
1975 msgid "B<struct spwd *sgetspent(const char *>I<s>B<);>\n"
1979 #: build/C/man3/getspnam.3:32
1981 msgid "B<int putspent(const struct spwd *>I<p>B<, FILE *>I<stream>B<);>\n"
1985 #: build/C/man3/getspnam.3:34
1987 msgid "B<int lckpwdf(void);>\n"
1991 #: build/C/man3/getspnam.3:36
1993 msgid "B<int ulckpwdf(void);>\n"
1997 #: build/C/man3/getspnam.3:38
1999 msgid "/* GNU extension */\n"
2003 #: build/C/man3/getspnam.3:42
2005 msgid "B<int getspent_r(struct spwd *>I<spbuf>B<,>\n"
2009 #: build/C/man3/getspnam.3:44 build/C/man3/getspnam.3:48 build/C/man3/getspnam.3:52 build/C/man3/getspnam.3:56
2012 "B< char *>I<buf>B<, size_t >I<buflen>B<, struct spwd "
2013 "**>I<spbufp>B<);>\n"
2017 #: build/C/man3/getspnam.3:46
2019 msgid "B<int getspnam_r(const char *>I<name>B<, struct spwd *>I<spbuf>B<,>\n"
2023 #: build/C/man3/getspnam.3:50
2025 msgid "B<int fgetspent_r(FILE *>I<stream>B<, struct spwd *>I<spbuf>B<,>\n"
2029 #: build/C/man3/getspnam.3:54
2031 msgid "B<int sgetspent_r(const char *>I<s>B<, struct spwd *>I<spbuf>B<,>\n"
2035 #: build/C/man3/getspnam.3:68
2036 msgid "B<getspent_r>(), B<getspnam_r>(), B<fgetspent_r>(), B<sgetspent_r>():"
2040 #: build/C/man3/getspnam.3:70
2041 msgid "_BSD_SOURCE || _SVID_SOURCE"
2045 #: build/C/man3/getspnam.3:84
2047 "Long ago it was considered safe to have encrypted passwords openly visible "
2048 "in the password file. When computers got faster and people got more "
2049 "security-conscious, this was no longer acceptable. Julianne Frances Haugh "
2050 "implemented the shadow password suite that keeps the encrypted passwords in "
2051 "the shadow password database (e.g., the local shadow password file "
2052 "I</etc/shadow>, NIS, and LDAP), readable only by root."
2055 #. FIXME . I've commented out the following for the
2056 #. moment. The relationship between PAM and nsswitch.conf needs
2057 #. to be clearly documented in one place, which is pointed to by
2058 #. the pages for the user, group, and shadow password functions.
2061 #. This shadow password setup has been superseded by PAM
2062 #. (pluggable authentication modules), and the file
2063 #. .I /etc/nsswitch.conf
2064 #. now describes the sources to be used.
2066 #: build/C/man3/getspnam.3:101
2068 "The functions described below resemble those for the traditional password "
2069 "database (e.g., see B<getpwnam>(3) and B<getpwent>(3))."
2073 #: build/C/man3/getspnam.3:108
2075 "The B<getspnam>() function returns a pointer to a structure containing the "
2076 "broken-out fields of the record in the shadow password database that matches "
2077 "the username I<name>."
2080 #. some systems require a call of setspent() before the first getspent()
2083 #: build/C/man3/getspnam.3:120
2085 "The B<getspent>() function returns a pointer to the next entry in the "
2086 "shadow password database. The position in the input stream is initialized "
2087 "by B<setspent>(). When done reading, the program may call B<endspent>() so "
2088 "that resources can be deallocated."
2092 #: build/C/man3/getspnam.3:127
2094 "The B<fgetspent>() function is similar to B<getspent>() but uses the "
2095 "supplied stream instead of the one implicitly opened by B<setspent>()."
2099 #: build/C/man3/getspnam.3:134
2101 "The B<sgetspent>() function parses the supplied string I<s> into a struct "
2106 #: build/C/man3/getspnam.3:144
2108 "The B<putspent>() function writes the contents of the supplied struct "
2109 "I<spwd> I<*p> as a text line in the shadow password file format to "
2110 "I<stream>. String entries with value NULL and numerical entries with value "
2111 "-1 are written as an empty string."
2115 #: build/C/man3/getspnam.3:159
2117 "The B<lckpwdf>() function is intended to protect against multiple "
2118 "simultaneous accesses of the shadow password database. It tries to acquire "
2119 "a lock, and returns 0 on success, or -1 on failure (lock not obtained within "
2120 "15 seconds). The B<ulckpwdf>() function releases the lock again. Note "
2121 "that there is no protection against direct access of the shadow password "
2122 "file. Only programs that use B<lckpwdf>() will notice the lock."
2126 #. SUN doesn't have sgetspent()
2128 #: build/C/man3/getspnam.3:164
2130 "These were the functions that formed the original shadow API. They are "
2135 #: build/C/man3/getspnam.3:164
2137 msgid "Reentrant versions"
2141 #: build/C/man3/getspnam.3:181
2143 "Analogous to the reentrant functions for the password database, glibc also "
2144 "has reentrant functions for the shadow password database. The "
2145 "B<getspnam_r>() function is like B<getspnam>() but stores the retrieved "
2146 "shadow password structure in the space pointed to by I<spbuf>. This shadow "
2147 "password structure contains pointers to strings, and these strings are "
2148 "stored in the buffer I<buf> of size I<buflen>. A pointer to the result (in "
2149 "case of success) or NULL (in case no entry was found or an error occurred) "
2150 "is stored in I<*spbufp>."
2154 #: build/C/man3/getspnam.3:188
2156 "The functions B<getspent_r>(), B<fgetspent_r>(), and B<sgetspent_r>() are "
2157 "similarly analogous to their nonreentrant counterparts."
2160 #. SUN doesn't have sgetspent_r()
2162 #: build/C/man3/getspnam.3:192
2164 "Some non-glibc systems also have functions with these names, often with "
2165 "different prototypes."
2169 #: build/C/man3/getspnam.3:192
2175 #: build/C/man3/getspnam.3:194
2177 "The shadow password structure is defined in I<E<lt>shadow.hE<gt>> as "
2182 #: build/C/man3/getspnam.3:214
2186 " char *sp_namp; /* Login name */\n"
2187 " char *sp_pwdp; /* Encrypted password */\n"
2188 " long sp_lstchg; /* Date of last change\n"
2189 " (measured in days since\n"
2190 " 1970-01-01 00:00:00 +0000 (UTC)) */\n"
2191 " long sp_min; /* Min # of days between changes */\n"
2192 " long sp_max; /* Max # of days between changes */\n"
2193 " long sp_warn; /* # of days before password expires\n"
2194 " to warn user to change it */\n"
2195 " long sp_inact; /* # of days after password expires\n"
2196 " until account is disabled */\n"
2197 " long sp_expire; /* Date when account expires\n"
2198 " (measured in days since\n"
2199 " 1970-01-01 00:00:00 +0000 (UTC)) */\n"
2200 " unsigned long sp_flag; /* Reserved */\n"
2205 #: build/C/man3/getspnam.3:223
2207 "The functions that return a pointer return NULL if no more entries are "
2208 "available or if an error occurs during processing. The functions which have "
2209 "I<int> as the return value return 0 for success and -1 for failure, with "
2210 "I<errno> set to indicate the cause of the error."
2214 #: build/C/man3/getspnam.3:226
2216 "For the nonreentrant functions, the return value may point to static area, "
2217 "and may be overwritten by subsequent calls to these functions."
2221 #: build/C/man3/getspnam.3:229
2223 "The reentrant functions return zero on success. In case of error, an error "
2224 "number is returned."
2228 #: build/C/man3/getspnam.3:230
2234 #: build/C/man3/getspnam.3:233
2235 msgid "The caller does not have permission to access the shadow password file."
2239 #: build/C/man3/getspnam.3:236
2240 msgid "Supplied buffer is too small."
2244 #: build/C/man3/getspnam.3:237
2246 msgid "I</etc/shadow>"
2250 #: build/C/man3/getspnam.3:240
2251 msgid "local shadow password database file"
2255 #: build/C/man3/getspnam.3:240
2257 msgid "I</etc/.pwd.lock>"
2261 #: build/C/man3/getspnam.3:243
2266 #: build/C/man3/getspnam.3:249
2268 "The include file I<E<lt>paths.hE<gt>> defines the constant B<_PATH_SHADOW> "
2269 "to the pathname of the shadow password file."
2273 #: build/C/man3/getspnam.3:253
2275 "The shadow password database and its associated API are not specified in "
2276 "POSIX.1-2001. However, many other systems provide a similar API."
2280 #: build/C/man3/getspnam.3:258
2281 msgid "B<getgrnam>(3), B<getpwnam>(3), B<getpwnam_r>(3), B<shadow>(5)"
2285 #: build/C/man5/group.5:26
2291 #: build/C/man5/group.5:26
2297 #: build/C/man5/group.5:29
2298 msgid "group - user group file"
2302 #: build/C/man5/group.5:34
2304 "The I</etc/group> file is a text file that defines the groups on the "
2305 "system. There is one entry per line, with the following format:"
2309 #: build/C/man5/group.5:37
2310 msgid "group_name:password:GID:user_list"
2314 #: build/C/man5/group.5:40
2315 msgid "The fields are as follows:"
2319 #: build/C/man5/group.5:40
2321 msgid "I<group_name>"
2325 #: build/C/man5/group.5:43
2326 msgid "the name of the group."
2330 #: build/C/man5/group.5:43 build/C/man5/passwd.5:91
2336 #: build/C/man5/group.5:47
2338 "the (encrypted) group password. If this field is empty, no password is "
2343 #: build/C/man5/group.5:47 build/C/man5/passwd.5:103
2349 #: build/C/man5/group.5:50
2350 msgid "the numeric group ID."
2354 #: build/C/man5/group.5:50
2356 msgid "I<user_list>"
2360 #: build/C/man5/group.5:53
2361 msgid "a list of the usernames that are members of this group, separated by commas."
2365 #: build/C/man5/group.5:55
2370 #: build/C/man5/group.5:61
2372 "As the 4.2BSD B<initgroups>(3) man page says: No-one seems to keep "
2373 "I</etc/group> up-to-date."
2377 #: build/C/man5/group.5:67
2378 msgid "B<login>(1), B<newgrp>(1), B<getgrent>(3), B<getgrnam>(3), B<passwd>(5)"
2382 #: build/C/man3/initgroups.3:32
2388 #: build/C/man3/initgroups.3:32
2394 #: build/C/man3/initgroups.3:35
2395 msgid "initgroups - initialize the supplementary group access list"
2399 #: build/C/man3/initgroups.3:41
2401 msgid "B<int initgroups(const char *>I<user>B<, gid_t >I<group>B<);>\n"
2405 #: build/C/man3/initgroups.3:50
2406 msgid "B<initgroups>(): _BSD_SOURCE"
2410 #: build/C/man3/initgroups.3:64
2412 "The B<initgroups>() function initializes the group access list by reading "
2413 "the group database I</etc/group> and using all groups of which I<user> is a "
2414 "member. The additional group I<group> is also added to the list."
2418 #: build/C/man3/initgroups.3:68
2419 msgid "The I<user> argument must be non-NULL."
2423 #: build/C/man3/initgroups.3:75
2425 "The B<initgroups>() function returns 0 on success. On error, -1 is "
2426 "returned, and I<errno> is set appropriately."
2430 #: build/C/man3/initgroups.3:79
2431 msgid "Insufficient memory to allocate group information structure."
2435 #: build/C/man3/initgroups.3:79
2441 #: build/C/man3/initgroups.3:84
2443 "The calling process has insufficient privilege. See the underlying system "
2444 "call B<setgroups>(2)."
2448 #: build/C/man3/initgroups.3:87
2450 msgid "I</etc/group>\t\tgroup database file\n"
2454 #: build/C/man3/initgroups.3:90
2455 msgid "SVr4, 4.3BSD."
2459 #: build/C/man3/initgroups.3:94
2460 msgid "B<getgroups>(2), B<setgroups>(2), B<credentials>(7)"
2464 #: build/C/man5/passwd.5:30
2470 #: build/C/man5/passwd.5:30
2476 #: build/C/man5/passwd.5:33
2477 msgid "passwd - password file"
2481 #: build/C/man5/passwd.5:41
2483 "The I</etc/passwd> file is a text file that describes user login accounts "
2484 "for the system. It should have read permission allowed for all users (many "
2485 "utilities, like B<ls>(1) use it to map user IDs to usernames), but write "
2486 "access only for the superuser."
2490 #: build/C/man5/passwd.5:53
2492 "In the good old days there was no great problem with this general read "
2493 "permission. Everybody could read the encrypted passwords, but the hardware "
2494 "was too slow to crack a well-chosen password, and moreover the basic "
2495 "assumption used to be that of a friendly user-community. These days many "
2496 "people run some version of the shadow password suite, where I</etc/passwd> "
2497 "has an \\(aqx\\(aq character in the password field, and the encrypted "
2498 "passwords are in I</etc/shadow>, which is readable by the superuser only."
2502 #: build/C/man5/passwd.5:62
2504 "If the encrypted password, whether in I</etc/passwd> or in I</etc/shadow>, "
2505 "is an empty string, login is allowed without even asking for a password. "
2506 "Note that this functionality may be intentionally disabled in applications, "
2507 "or configurable (for example using the \"nullok\" or \"nonull\" arguments to "
2512 #: build/C/man5/passwd.5:67
2514 "If the encrypted password in I</etc/passwd> is \"I<*NP*>\" (without the "
2515 "quotes), the shadow record should be obtained from an NIS+ server."
2519 #: build/C/man5/passwd.5:73
2521 "Regardless of whether shadow passwords are used, many system administrators "
2522 "use an asterisk (*) in the encrypted password field to make sure that this "
2523 "user can not authenticate him- or herself using a password. (But see NOTES "
2528 #: build/C/man5/passwd.5:78
2530 "If you create a new login, first put an asterisk (*) in the password field, "
2531 "then use B<passwd>(1) to set it."
2535 #: build/C/man5/passwd.5:81
2537 "Each line of the file describes a single user, and contains seven "
2538 "colon-separated fields:"
2542 #: build/C/man5/passwd.5:84
2543 msgid "name:password:UID:GID:GECOS:directory:shell"
2547 #: build/C/man5/passwd.5:87
2548 msgid "The field are as follows:"
2552 #: build/C/man5/passwd.5:87
2558 #: build/C/man5/passwd.5:91
2559 msgid "This is the user's login name. It should not contain capital letters."
2563 #: build/C/man5/passwd.5:98
2565 "This is either the encrypted user password, an asterisk (*), or the letter "
2566 "\\(aqx\\(aq. (See B<pwconv>(8) for an explanation of \\(aqx\\(aq.)"
2570 #: build/C/man5/passwd.5:98
2576 #: build/C/man5/passwd.5:103
2577 msgid "The privileged I<root> login account (superuser) has the user ID 0."
2581 #: build/C/man5/passwd.5:108
2583 "This is the numeric primary group ID for this user. (Additional groups for "
2584 "the user are defined in the system group file; see B<group>(5))."
2588 #: build/C/man5/passwd.5:108
2594 #: build/C/man5/passwd.5:116
2596 "This field (sometimes called the \"comment field\") is optional and used "
2597 "only for informational purposes. Usually, it contains the full username. "
2598 "Some programs (for example, B<finger>(1)) display information from this "
2603 #: build/C/man5/passwd.5:125
2605 "GECOS stands for \"General Electric Comprehensive Operating System\", which "
2606 "was renamed to GCOS when GE's large systems division was sold to Honeywell. "
2607 "Dennis Ritchie has reported: \"Sometimes we sent printer output or batch "
2608 "jobs to the GCOS machine. The gcos field in the password file was a place "
2609 "to stash the information for the $IDENTcard. Not elegant.\""
2613 #: build/C/man5/passwd.5:125
2615 msgid "I<directory>"
2619 #: build/C/man5/passwd.5:132
2621 "This is the user's home directory: the initial directory where the user is "
2622 "placed after logging in. The value in this field is used to set the B<HOME> "
2623 "environment variable."
2627 #: build/C/man5/passwd.5:132
2633 #: build/C/man5/passwd.5:142
2635 "This is the program to run at login (if empty, use I</bin/sh>). If set to a "
2636 "nonexistent executable, the user will be unable to login through "
2637 "B<login>(1). The value in this field is used to set the B<SHELL> "
2638 "environment variable."
2642 #: build/C/man5/passwd.5:148
2644 "If you want to create user groups, there must be an entry in I</etc/group>, "
2645 "or no group will exist."
2649 #: build/C/man5/passwd.5:162
2651 "If the encrypted password is set to an asterisk (*), the user will be unable "
2652 "to login using B<login>(1), but may still login using B<rlogin>(1), run "
2653 "existing processes and initiate new ones through B<rsh>(1), B<cron>(8), "
2654 "B<at>(1), or mail filters, etc. Trying to lock an account by simply "
2655 "changing the shell field yields the same result and additionally allows the "
2660 #: build/C/man5/passwd.5:173
2662 "B<chfn>(1), B<chsh>(1), B<login>(1), B<passwd>(1), B<su>(1), B<crypt>(3), "
2663 "B<getpwent>(3), B<getpwnam>(3), B<group>(5), B<shadow>(5)"
2667 #: build/C/man3/putgrent.3:7
2673 #: build/C/man3/putgrent.3:10
2674 msgid "putgrent - write a group database entry to a file"
2678 #: build/C/man3/putgrent.3:12
2679 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
2683 #: build/C/man3/putgrent.3:16
2684 msgid "B<int putgrent(const struct group *>I<grp>B<, FILE *>I<stream>B<);>"
2688 #: build/C/man3/putgrent.3:26
2690 "The B<putgrent>() function is the counterpart for B<fgetgrent>(3). The "
2691 "function writes the content of the provided I<struct group> into the "
2692 "I<stream>. The list of group members must be NULL-terminated or "
2697 #: build/C/man3/putgrent.3:30
2698 msgid "The I<struct group> is defined as follows:"
2702 #: build/C/man3/putgrent.3:39
2706 " char *gr_name; /* group name */\n"
2707 " char *gr_passwd; /* group password */\n"
2708 " gid_t gr_gid; /* group ID */\n"
2709 " char **gr_mem; /* group members */\n"
2714 #: build/C/man3/putgrent.3:43
2715 msgid "The function returns zero on success, and a nonzero value on error."
2719 #: build/C/man3/putgrent.3:45
2720 msgid "This function is a GNU extension."
2724 #: build/C/man3/putgrent.3:49
2725 msgid "B<fgetgrent>(3), B<getgrent>(3), B<group>(5)"
2729 #: build/C/man3/putpwent.3:30
2735 #: build/C/man3/putpwent.3:33
2736 msgid "putpwent - write a password file entry"
2740 #: build/C/man3/putpwent.3:40
2742 msgid "B<int putpwent(const struct passwd *>I<p>B<, FILE *>I<stream>B<);>\n"
2746 #: build/C/man3/putpwent.3:49
2747 msgid "B<putpwent>(): _SVID_SOURCE"
2751 #: build/C/man3/putpwent.3:54
2753 "The B<putpwent>() function writes a password entry from the structure I<p> "
2754 "in the file associated with I<stream>."
2758 #: build/C/man3/putpwent.3:68
2762 " char *pw_name; /* username */\n"
2763 " char *pw_passwd; /* user password */\n"
2764 " uid_t pw_uid; /* user ID */\n"
2765 " gid_t pw_gid; /* group ID */\n"
2766 " char *pw_gecos; /* real name */\n"
2767 " char *pw_dir; /* home directory */\n"
2768 " char *pw_shell; /* shell program */\n"
2773 #: build/C/man3/putpwent.3:78
2775 "The B<putpwent>() function returns 0 on success, or -1 if an error occurs. "
2776 "In the event of an error, I<errno> is set to indicate the cause."
2780 #: build/C/man3/putpwent.3:82
2781 msgid "Invalid (NULL) argument given."
2785 #: build/C/man3/putpwent.3:92
2787 "B<endpwent>(3), B<fgetpwent>(3), B<getpw>(3), B<getpwent>(3), "
2788 "B<getpwnam>(3), B<getpwuid>(3), B<setpwent>(3)"
2792 #: build/C/man3/setaliasent.3:9
2798 #: build/C/man3/setaliasent.3:9
2804 #: build/C/man3/setaliasent.3:13
2806 "setaliasent, endaliasent, getaliasent, getaliasent_r, getaliasbyname, "
2807 "getaliasbyname_r - read an alias entry"
2811 #: build/C/man3/setaliasent.3:15
2812 msgid "B<#include E<lt>aliases.hE<gt>>"
2816 #: build/C/man3/setaliasent.3:17
2817 msgid "B<void setaliasent(void);>"
2821 #: build/C/man3/setaliasent.3:19
2822 msgid "B<void endaliasent(void);>"
2826 #: build/C/man3/setaliasent.3:21
2827 msgid "B<struct aliasent *getaliasent(void);>"
2831 #: build/C/man3/setaliasent.3:23
2832 msgid "B<int getaliasent_r(struct aliasent *>I<result>B<,>"
2836 #: build/C/man3/setaliasent.3:25 build/C/man3/setaliasent.3:31
2837 msgid "B< char *>I<buffer>B<, size_t >I<buflen>B<, struct aliasent **>I<res>B<);>"
2841 #: build/C/man3/setaliasent.3:27
2842 msgid "B<struct aliasent *getaliasbyname(const char *>I<name>B<);>"
2846 #: build/C/man3/setaliasent.3:29
2848 "B<int getaliasbyname_r(const char *>I<name>B<, struct aliasent "
2853 #: build/C/man3/setaliasent.3:37
2855 "One of the databases available with the Name Service Switch (NSS) is the "
2856 "aliases database, that contains mail aliases. (To find out which databases "
2857 "are supported, try I<getent --help>.) Six functions are provided to access "
2858 "the aliases database."
2862 #: build/C/man3/setaliasent.3:44
2864 "The B<getaliasent>() function returns a pointer to a structure containing "
2865 "the group information from the aliases database. The first time it is "
2866 "called it returns the first entry; thereafter, it returns successive "
2871 #: build/C/man3/setaliasent.3:49
2873 "The B<setaliasent>() function rewinds the file pointer to the beginning of "
2874 "the aliases database."
2878 #: build/C/man3/setaliasent.3:53
2879 msgid "The B<endaliasent>() function closes the aliases database."
2883 #: build/C/man3/setaliasent.3:60
2885 "B<getaliasent_r>() is the reentrant version of the previous function. The "
2886 "requested structure is stored via the first argument but the programmer "
2887 "needs to fill the other arguments also. Not providing enough space causes "
2888 "the function to fail."
2892 #: build/C/man3/setaliasent.3:66
2894 "The function B<getaliasbyname>() takes the name argument and searches the "
2895 "aliases database. The entry is returned as a pointer to a I<struct "
2900 #: build/C/man3/setaliasent.3:73
2902 "B<getaliasbyname_r>() is the reentrant version of the previous function. "
2903 "The requested structure is stored via the second argument but the programmer "
2904 "needs to fill the other arguments also. Not providing enough space causes "
2905 "the function to fail."
2909 #: build/C/man3/setaliasent.3:78
2910 msgid "The I<struct aliasent> is defined in I<E<lt>aliases.hE<gt>>:"
2914 #: build/C/man3/setaliasent.3:87
2917 "struct aliasent {\n"
2918 " char *alias_name; /* alias name */\n"
2919 " size_t alias_members_len;\n"
2920 " char **alias_members; /* alias name list */\n"
2921 " int alias_local;\n"
2926 #: build/C/man3/setaliasent.3:95
2928 "The functions B<getaliasent_r>() and B<getaliasbyname_r>() return a "
2929 "nonzero value on error."
2933 #: build/C/man3/setaliasent.3:101
2935 "The default alias database is the file I</etc/aliases>. This can be changed "
2936 "in the I</etc/nsswitch.conf> file."
2940 #: build/C/man3/setaliasent.3:104
2941 msgid "These routines are glibc-specific. The NeXT system has similar routines:"
2945 #: build/C/man3/setaliasent.3:108
2947 msgid "#include E<lt>aliasdb.hE<gt>\n"
2951 #: build/C/man3/setaliasent.3:113
2954 "void alias_setent(void);\n"
2955 "void alias_endent(void);\n"
2956 "alias_ent *alias_getent(void);\n"
2957 "alias_ent *alias_getbyname(char *name);\n"
2961 #: build/C/man3/setaliasent.3:119
2963 "The following example compiles with I<gcc example.c -o example>. It will "
2964 "dump all names in the alias database."
2968 #: build/C/man3/setaliasent.3:125
2971 "#include E<lt>aliases.hE<gt>\n"
2972 "#include E<lt>stdio.hE<gt>\n"
2973 "#include E<lt>stdlib.hE<gt>\n"
2974 "#include E<lt>errno.hE<gt>\n"
2978 #: build/C/man3/setaliasent.3:144
2984 " struct aliasent *al;\n"
2987 " al = getaliasent();\n"
2988 " if (al == NULL)\n"
2990 " printf(\"Name: %s\\en\", al-E<gt>alias_name);\n"
2993 " perror(\"reading alias\");\n"
2994 " exit(EXIT_FAILURE);\n"
2997 " exit(EXIT_SUCCESS);\n"
3002 #. /etc/sendmail/aliases
3004 #. newaliases, postalias
3006 #: build/C/man3/setaliasent.3:154
3007 msgid "B<getgrent>(3), B<getpwent>(3), B<getspent>(3), B<aliases>(5)"