Minor comment updates ...
[Samba/gebeck_regimport.git] / source3 / nsswitch / pam_winbind.h
blob0afcceb6aa2e8d01bd8572e78ee179ea9ed97e1a
1 /* pam_winbind header file
2 (Solaris needs some macros from Linux for common PAM code)
4 Shirish Kalele 2000
5 */
7 #ifdef HAVE_FEATURES_H
8 #include <features.h>
9 #endif
11 #include <stdlib.h>
12 #include <unistd.h>
13 #include <string.h>
14 #include <syslog.h>
15 #include <stdarg.h>
16 #include <sys/types.h>
17 #include <sys/stat.h>
18 #include <fcntl.h>
19 #include <errno.h>
21 #include <config.h>
23 #define MODULE_NAME "pam_winbind"
24 #define PAM_SM_AUTH
25 #define PAM_SM_ACCOUNT
26 #define PAM_SM_PASSWORD
28 #if defined(SUNOS5) || defined(SUNOS4) || defined(HPUX) || defined(FREEBSD)
30 /* Solaris always uses dynamic pam modules */
31 #define PAM_EXTERN extern
32 #include <security/pam_appl.h>
34 #ifndef PAM_AUTHTOK_RECOVER_ERR
35 #define PAM_AUTHTOK_RECOVER_ERR PAM_AUTHTOK_RECOVERY_ERR
36 #endif
38 #endif
40 #ifdef HAVE_SECURITY_PAM_MODULES_H
41 #include <security/pam_modules.h>
42 #endif
44 #ifdef HAVE_SECURITY__PAM_MACROS_H
45 #include <security/_pam_macros.h>
46 #else
47 /* Define required macros from (Linux PAM 0.68) security/_pam_macros.h */
48 #define _pam_drop_reply(/* struct pam_response * */ reply, /* int */ replies) \
49 do { \
50 int reply_i; \
52 for (reply_i=0; reply_i<replies; ++reply_i) { \
53 if (reply[reply_i].resp) { \
54 _pam_overwrite(reply[reply_i].resp); \
55 free(reply[reply_i].resp); \
56 } \
57 } \
58 if (reply) \
59 free(reply); \
60 } while (0)
62 #define _pam_overwrite(x) \
63 do { \
64 register char *__xx__; \
65 if ((__xx__=(x))) \
66 while (*__xx__) \
67 *__xx__++ = '\0'; \
68 } while (0)
71 * Don't just free it, forget it too.
74 #define _pam_drop(X) SAFE_FREE(X)
76 #define x_strdup(s) ( (s) ? strdup(s):NULL )
77 #endif
79 #define WINBIND_DEBUG_ARG (1<<0)
80 #define WINBIND_USE_AUTHTOK_ARG (1<<1)
81 #define WINBIND_UNKNOWN_OK_ARG (1<<2)
82 #define WINBIND_TRY_FIRST_PASS_ARG (1<<3)
83 #define WINBIND_USE_FIRST_PASS_ARG (1<<4)
84 #define WINBIND__OLD_PASSWORD (1<<5)
87 * here is the string to inform the user that the new passwords they
88 * typed were not the same.
91 #define MISTYPED_PASS "Sorry, passwords do not match"
93 #define on(x, y) (x & y)
94 #define off(x, y) (!(x & y))
96 #include "winbind_client.h"