williamr@2
|
1 |
/* PWD.H
|
williamr@2
|
2 |
*
|
williamr@2
|
3 |
* Portions copyright (c) 1997-1999 Symbian Ltd. All rights reserved.
|
williamr@2
|
4 |
*/
|
williamr@2
|
5 |
|
williamr@2
|
6 |
/*-
|
williamr@2
|
7 |
* Copyright (c) 1989 The Regents of the University of California.
|
williamr@2
|
8 |
* All rights reserved.
|
williamr@2
|
9 |
*
|
williamr@2
|
10 |
* Redistribution and use in source and binary forms, with or without
|
williamr@2
|
11 |
* modification, are permitted provided that the following conditions
|
williamr@2
|
12 |
* are met:
|
williamr@2
|
13 |
* 1. Redistributions of source code must retain the above copyright
|
williamr@2
|
14 |
* notice, this list of conditions and the following disclaimer.
|
williamr@2
|
15 |
* 2. Redistributions in binary form must reproduce the above copyright
|
williamr@2
|
16 |
* notice, this list of conditions and the following disclaimer in the
|
williamr@2
|
17 |
* documentation and/or other materials provided with the distribution.
|
williamr@2
|
18 |
* 3. All advertising materials mentioning features or use of this software
|
williamr@2
|
19 |
* must display the following acknowledgement:
|
williamr@2
|
20 |
* This product includes software developed by the University of
|
williamr@2
|
21 |
* California, Berkeley and its contributors.
|
williamr@2
|
22 |
* 4. Neither the name of the University nor the names of its contributors
|
williamr@2
|
23 |
* may be used to endorse or promote products derived from this software
|
williamr@2
|
24 |
* without specific prior written permission.
|
williamr@2
|
25 |
*
|
williamr@2
|
26 |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
williamr@2
|
27 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
williamr@2
|
28 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
williamr@2
|
29 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
williamr@2
|
30 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
williamr@2
|
31 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
williamr@2
|
32 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
williamr@2
|
33 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
williamr@2
|
34 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
williamr@2
|
35 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
williamr@2
|
36 |
* SUCH DAMAGE.
|
williamr@2
|
37 |
*
|
williamr@2
|
38 |
* @(#)pwd.h 5.13 (Berkeley) 5/28/91
|
williamr@2
|
39 |
*/
|
williamr@2
|
40 |
|
williamr@2
|
41 |
/** @file
|
williamr@2
|
42 |
@publishedAll
|
williamr@2
|
43 |
@released
|
williamr@2
|
44 |
*/
|
williamr@2
|
45 |
|
williamr@2
|
46 |
#ifndef _PWD_H_
|
williamr@2
|
47 |
#ifdef __cplusplus
|
williamr@2
|
48 |
extern "C" {
|
williamr@2
|
49 |
#endif
|
williamr@2
|
50 |
#define _PWD_H_
|
williamr@2
|
51 |
|
williamr@2
|
52 |
#include <sys/types.h>
|
williamr@2
|
53 |
|
williamr@2
|
54 |
#ifndef _POSIX_SOURCE
|
williamr@2
|
55 |
#define _PATH_PASSWD "/etc/passwd"
|
williamr@2
|
56 |
/** max length, not counting NULL
|
williamr@2
|
57 |
*/
|
williamr@2
|
58 |
#define _PASSWORD_LEN 128
|
williamr@2
|
59 |
#endif
|
williamr@2
|
60 |
|
williamr@2
|
61 |
/** password
|
williamr@2
|
62 |
*/
|
williamr@2
|
63 |
struct passwd {
|
williamr@2
|
64 |
/** user name
|
williamr@2
|
65 |
*/
|
williamr@2
|
66 |
char *pw_name;
|
williamr@2
|
67 |
|
williamr@2
|
68 |
/** encrypted password
|
williamr@2
|
69 |
*/
|
williamr@2
|
70 |
char *pw_passwd;
|
williamr@2
|
71 |
|
williamr@2
|
72 |
/** user uid
|
williamr@2
|
73 |
*/
|
williamr@2
|
74 |
int pw_uid;
|
williamr@2
|
75 |
|
williamr@2
|
76 |
/** user gid
|
williamr@2
|
77 |
*/
|
williamr@2
|
78 |
int pw_gid;
|
williamr@2
|
79 |
|
williamr@2
|
80 |
/** comment
|
williamr@2
|
81 |
*/
|
williamr@2
|
82 |
char *pw_comment;
|
williamr@2
|
83 |
|
williamr@2
|
84 |
/** Honeywell login info
|
williamr@2
|
85 |
*/
|
williamr@2
|
86 |
char *pw_gecos;
|
williamr@2
|
87 |
|
williamr@2
|
88 |
/** home directory
|
williamr@2
|
89 |
*/
|
williamr@2
|
90 |
char *pw_dir;
|
williamr@2
|
91 |
|
williamr@2
|
92 |
/** default shell
|
williamr@2
|
93 |
*/
|
williamr@2
|
94 |
char *pw_shell;
|
williamr@2
|
95 |
};
|
williamr@2
|
96 |
|
williamr@2
|
97 |
extern struct passwd *getpwuid (uid_t);
|
williamr@2
|
98 |
extern struct passwd *getpwnam (const char *);
|
williamr@2
|
99 |
#ifndef _POSIX_SOURCE
|
williamr@2
|
100 |
extern struct passwd *getpwent (void);
|
williamr@2
|
101 |
extern void setpwent (void);
|
williamr@2
|
102 |
extern void endpwent (void);
|
williamr@2
|
103 |
#endif
|
williamr@2
|
104 |
|
williamr@2
|
105 |
#ifdef __cplusplus
|
williamr@2
|
106 |
}
|
williamr@2
|
107 |
#endif
|
williamr@2
|
108 |
#endif /* _PWD_H_ */
|