passwdutil.h (dd1104fbe0f0f41434502f335b9f0b34999f771c) passwdutil.h (36e852a172cba914383d7341c988128b2c667fbd)
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 (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 86 unchanged lines hidden (view full) ---

95 size_t scope_len;
96} pwu_repository_t;
97
98#define PWU_DEFAULT_REP (pwu_repository_t *)NULL
99
100#define REP_NOREP 0 /* Can't find suitable repository */
101#define REP_FILES 0x0001 /* /etc/passwd, /etc/shadow */
102#define REP_NIS 0x0002
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 (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 86 unchanged lines hidden (view full) ---

95 size_t scope_len;
96} pwu_repository_t;
97
98#define PWU_DEFAULT_REP (pwu_repository_t *)NULL
99
100#define REP_NOREP 0 /* Can't find suitable repository */
101#define REP_FILES 0x0001 /* /etc/passwd, /etc/shadow */
102#define REP_NIS 0x0002
103#define REP_NISPLUS 0x0004
104#define REP_LDAP 0x0008
105#define REP_NSS 0x0010
103#define REP_LDAP 0x0004
104#define REP_NSS 0x0008
106#define REP_LAST REP_NSS
107#define REP_ERANGE 0x8000 /* Unknown repository specified */
108
109#define REP_COMPAT_NIS 0x1000
105#define REP_LAST REP_NSS
106#define REP_ERANGE 0x8000 /* Unknown repository specified */
107
108#define REP_COMPAT_NIS 0x1000
110#define REP_COMPAT_NISPLUS 0x2000
111#define REP_COMPAT_LDAP 0x4000
109#define REP_COMPAT_LDAP 0x2000
112
113/* For the time being, these are also defined in pam_*.h */
110
111/* For the time being, these are also defined in pam_*.h */
114#undef IS_NISPLUS
115#undef IS_FILES
116#undef IS_NIS
117#undef IS_LDAP
118
119#define IS_FILES(r) (r.type != NULL && strcmp(r.type, "files") == 0)
120#define IS_NIS(r) (r.type != NULL && strcmp(r.type, "nis") == 0)
112#undef IS_FILES
113#undef IS_NIS
114#undef IS_LDAP
115
116#define IS_FILES(r) (r.type != NULL && strcmp(r.type, "files") == 0)
117#define IS_NIS(r) (r.type != NULL && strcmp(r.type, "nis") == 0)
121#define IS_NISPLUS(r) (r.type != NULL && strcmp(r.type, "nisplus") == 0)
122#define IS_LDAP(r) (r.type != NULL && strcmp(r.type, "ldap") == 0)
123
124#define MINWEEKS -1
125#define MAXWEEKS -1
126#define WARNWEEKS -1
127
118#define IS_LDAP(r) (r.type != NULL && strcmp(r.type, "ldap") == 0)
119
120#define MINWEEKS -1
121#define MAXWEEKS -1
122#define WARNWEEKS -1
123
128#define NISPLUS_LOOKUP 0
129#define NISPLUS_UPDATE 1
130
131typedef struct repops {
132 int (*checkhistory)(char *, char *, pwu_repository_t *);
133 int (*getattr)(char *, attrlist *, pwu_repository_t *);
134 int (*getpwnam)(char *, attrlist *, pwu_repository_t *, void **);
135 int (*update)(attrlist *, pwu_repository_t *, void *);
124typedef struct repops {
125 int (*checkhistory)(char *, char *, pwu_repository_t *);
126 int (*getattr)(char *, attrlist *, pwu_repository_t *);
127 int (*getpwnam)(char *, attrlist *, pwu_repository_t *, void **);
128 int (*update)(attrlist *, pwu_repository_t *, void *);
136 int (*putpwnam)(char *, char *, char *, pwu_repository_t *, void *);
129 int (*putpwnam)(char *, char *, pwu_repository_t *, void *);
137 int (*user_to_authenticate)(char *, pwu_repository_t *, char **, int *);
138 int (*lock)(void);
139 int (*unlock)(void);
140} repops_t;
141
130 int (*user_to_authenticate)(char *, pwu_repository_t *, char **, int *);
131 int (*lock)(void);
132 int (*unlock)(void);
133} repops_t;
134
142extern repops_t files_repops, nis_repops,
143 nisplus_repops, ldap_repops, nss_repops;
135extern repops_t files_repops, nis_repops, ldap_repops, nss_repops;
144
145extern repops_t *rops[];
146
147/*
148 * utils.c
149 */
150void turn_on_default_aging(struct spwd *);
151int def_getint(char *name, int defvalue);

--- 14 unchanged lines hidden (view full) ---

166struct passwd *getpwnam_from(const char *, pwu_repository_t *, int);
167struct passwd *getpwuid_from(uid_t, pwu_repository_t *, int);
168struct spwd *getspnam_from(const char *, pwu_repository_t *, int);
169int name_to_int(char *);
170
171/*
172 * __set_authtok_attr.c
173 */
136
137extern repops_t *rops[];
138
139/*
140 * utils.c
141 */
142void turn_on_default_aging(struct spwd *);
143int def_getint(char *name, int defvalue);

--- 14 unchanged lines hidden (view full) ---

158struct passwd *getpwnam_from(const char *, pwu_repository_t *, int);
159struct passwd *getpwuid_from(uid_t, pwu_repository_t *, int);
160struct spwd *getspnam_from(const char *, pwu_repository_t *, int);
161int name_to_int(char *);
162
163/*
164 * __set_authtok_attr.c
165 */
174int __set_authtoken_attr(char *, char *, char *, pwu_repository_t *,
175 attrlist *, int *);
166int __set_authtoken_attr(char *, char *, pwu_repository_t *, attrlist *, int *);
176/*
177 * __get_authtokenn_attr.c
178 */
179int __get_authtoken_attr(char *, pwu_repository_t *, attrlist *);
180
181/*
182 * __user_to_authenticate.c
183 */
184int __user_to_authenticate(char *, pwu_repository_t *, char **, int *);
185
186/*
167/*
168 * __get_authtokenn_attr.c
169 */
170int __get_authtoken_attr(char *, pwu_repository_t *, attrlist *);
171
172/*
173 * __user_to_authenticate.c
174 */
175int __user_to_authenticate(char *, pwu_repository_t *, char **, int *);
176
177/*
187 * __verify_rpc_passwd.c
188 */
189int __verify_rpc_passwd(char *, char *, pwu_repository_t *);
190
191/*
192 * Password history definitions
193 */
194#define DEFHISTORY 0 /* default history depth */
195#define MAXHISTORY 26 /* max depth of history 1 yr every 2 weeks */
196
197/*
198 * __check_history.c
199 */

--- 16 unchanged lines hidden (view full) ---

216#define PWU_NOMEM -8 /* Not enough memory */
217#define PWU_SERVER_ERROR -9 /* NIS server errors */
218#define PWU_SYSTEM_ERROR -10 /* NIS local configuration problem */
219#define PWU_DENIED -11 /* NIS update denied */
220#define PWU_NO_CHANGE -12 /* Data hasn't changed */
221#define PWU_REPOSITORY_ERROR -13 /* Unknown repository specified */
222#define PWU_AGING_DISABLED -14 /* Modifying min/warn while max==-1 */
223
178 * Password history definitions
179 */
180#define DEFHISTORY 0 /* default history depth */
181#define MAXHISTORY 26 /* max depth of history 1 yr every 2 weeks */
182
183/*
184 * __check_history.c
185 */

--- 16 unchanged lines hidden (view full) ---

202#define PWU_NOMEM -8 /* Not enough memory */
203#define PWU_SERVER_ERROR -9 /* NIS server errors */
204#define PWU_SYSTEM_ERROR -10 /* NIS local configuration problem */
205#define PWU_DENIED -11 /* NIS update denied */
206#define PWU_NO_CHANGE -12 /* Data hasn't changed */
207#define PWU_REPOSITORY_ERROR -13 /* Unknown repository specified */
208#define PWU_AGING_DISABLED -14 /* Modifying min/warn while max==-1 */
209
224/* NISPLUS specific errors */
210/* More errors */
225
211
226#define PWU_RECOVERY_ERR -15 /* can't recover old auth token */
227#define PWU_CRED_UPDATE_ERR -16 /* failed to update credentials */
228#define PWU_ATTR_UPDATE_ERR -17 /* failed to update attributes */
229#define PWU_CRED_ERROR -18 /* failed to obtain user credentials */
230#define PWU_PARTIAL_SUCCESS -19 /* passwd is updated, creds are not */
231#define PWU_BAD_CREDPASS -20 /* password doesn't decrypt creds */
232#define PWU_NO_PRIV_CRED_UPDATE -21 /* priv. user can't update creds */
233#define PWU_UPDATED_SOME_CREDS -22 /* some, not all, creds were updated */
212#define PWU_PWD_TOO_SHORT -15 /* new passwd too short */
213#define PWU_PWD_INVALID -16 /* new passwd has invalid syntax */
214#define PWU_PWD_IN_HISTORY -17 /* new passwd in history list */
215#define PWU_CHANGE_NOT_ALLOWED -18 /* change not allowed */
216#define PWU_WITHIN_MIN_AGE -19 /* change not allowed, within min age */
217#define PWU_ACCOUNT_LOCKED -20 /* account successfully locked */
234
218
235/* More errors, not NISPLUS specific */
236
237#define PWU_PWD_TOO_SHORT -23 /* new passwd too short */
238#define PWU_PWD_INVALID -24 /* new passwd has invalid syntax */
239#define PWU_PWD_IN_HISTORY -25 /* new passwd in history list */
240#define PWU_CHANGE_NOT_ALLOWED -26 /* change not allowed */
241#define PWU_WITHIN_MIN_AGE -27 /* change not allowed, within min age */
242#define PWU_ACCOUNT_LOCKED -28 /* account successfully locked */
243
244#ifdef __cplusplus
245}
246#endif
247
248#endif /* _PASSWDUTIL_H */
219#ifdef __cplusplus
220}
221#endif
222
223#endif /* _PASSWDUTIL_H */