2 * Copyright information at end of file.
7 #include <security/pam_modules.h>
9 #define PAM_UNIX_RUN_HELPER PAM_CRED_INSUFFICIENT
11 #define MAXPASS 200 /* the maximum length of a password */
13 #define OLD_PASSWORDS_FILE "/etc/security/opasswd"
16 verify_pwd_hash(const char *p, char *hash, unsigned int nullok);
19 is_pwd_shadowed(const struct passwd *pwd);
22 crypt_md5_wrapper(const char *pass_new);
25 unix_selinux_confined(void);
35 save_old_password(const char *forwho, const char *oldpass,
39 save_old_password(pam_handle_t *pamh, const char *forwho, const char *oldpass,
45 helper_log_err(int err, const char *format,...);
48 helper_verify_password(const char *name, const char *p, int nullok);
54 getuidname(uid_t uid);
57 read_passwords(int fd, int npass, char **passwords);
61 #define PAMH_ARG_DECL(fname, ...) fname(__VA_ARGS__)
62 #define PAMH_ARG(...) __VA_ARGS__
64 #define PAMH_ARG_DECL(fname, ...) fname(pam_handle_t *pamh, __VA_ARGS__)
65 #define PAMH_ARG(...) pamh, __VA_ARGS__
68 PAMH_ARG_DECL(char * create_password_hash,
69 const char *password, unsigned int ctrl, int rounds);
71 PAMH_ARG_DECL(int get_account_info,
72 const char *name, struct passwd **pwd, struct spwd **spwdent);
74 PAMH_ARG_DECL(int get_pwd_hash,
75 const char *name, struct passwd **pwd, char **hash);
77 PAMH_ARG_DECL(int check_shadow_expiry,
78 struct spwd *spent, int *daysleft);
80 PAMH_ARG_DECL(int unix_update_passwd,
81 const char *forwho, const char *towhat);
83 PAMH_ARG_DECL(int unix_update_shadow,
84 const char *forwho, char *towhat);
86 /* ****************************************************************** *
87 * Copyright (c) Red Hat, Inc. 2007.
89 * Redistribution and use in source and binary forms, with or without
90 * modification, are permitted provided that the following conditions
92 * 1. Redistributions of source code must retain the above copyright
93 * notice, and the entire permission notice in its entirety,
94 * including the disclaimer of warranties.
95 * 2. Redistributions in binary form must reproduce the above copyright
96 * notice, this list of conditions and the following disclaimer in the
97 * documentation and/or other materials provided with the distribution.
98 * 3. The name of the author may not be used to endorse or promote
99 * products derived from this software without specific prior
100 * written permission.
102 * ALTERNATIVELY, this product may be distributed under the terms of
103 * the GNU Public License, in which case the provisions of the GPL are
104 * required INSTEAD OF the above restrictions. (This clause is
105 * necessary due to a potential bad interaction between the GPL and
106 * the restrictions contained in a BSD-style copyright.)
108 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
109 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
110 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
111 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
112 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
113 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
114 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
115 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
116 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
117 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
118 * OF THE POSSIBILITY OF SUCH DAMAGE.