/* pam_winbind header file (Solaris needs some macros from Linux for common PAM code) Shirish Kalele 2000 */ #ifdef HAVE_FEATURES_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #define MODULE_NAME "pam_winbind" #define PAM_SM_AUTH #define PAM_SM_ACCOUNT #define PAM_SM_PASSWORD #include #if defined(SUNOS5) || defined(SUNOS4) || defined(HPUX) || defined(FREEBSD) || defined(AIX) /* Solaris always uses dynamic pam modules */ #define PAM_EXTERN extern #include #ifndef PAM_AUTHTOK_RECOVER_ERR #define PAM_AUTHTOK_RECOVER_ERR PAM_AUTHTOK_RECOVERY_ERR #endif #endif #ifdef HAVE_SECURITY_PAM_MODULES_H #include #endif #ifdef HAVE_SECURITY__PAM_MACROS_H #include #else /* Define required macros from (Linux PAM 0.68) security/_pam_macros.h */ #define _pam_drop_reply(/* struct pam_response * */ reply, /* int */ replies) \ do { \ int reply_i; \ \ for (reply_i=0; reply_i #define PAM_WB_REMARK_DIRECT(h,x)\ {\ const char *error_string = NULL; \ error_string = _get_ntstatus_error_string(x);\ if (error_string != NULL) {\ _make_remark(h, PAM_ERROR_MSG, error_string);\ } else {\ _make_remark(h, PAM_ERROR_MSG, x);\ };\ }; #define PAM_WB_REMARK_DIRECT_RET(h,x)\ {\ const char *error_string = NULL; \ error_string = _get_ntstatus_error_string(x);\ if (error_string != NULL) {\ _make_remark(h, PAM_ERROR_MSG, error_string);\ return ret;\ };\ _make_remark(h, PAM_ERROR_MSG, x);\ return ret;\ }; #define PAM_WB_REMARK_CHECK_RESPONSE_RET(h,x,y)\ {\ const char *ntstatus = x.data.auth.nt_status_string; \ const char *error_string = NULL; \ if (!strcasecmp(ntstatus,y)) {\ error_string = _get_ntstatus_error_string(y);\ if (error_string != NULL) {\ _make_remark(h, PAM_ERROR_MSG, error_string);\ return ret;\ };\ if (x.data.auth.error_string[0] != '\0') {\ _make_remark(h, PAM_ERROR_MSG, x.data.auth.error_string);\ return ret;\ };\ _make_remark(h, PAM_ERROR_MSG, y);\ return ret;\ };\ }; /* from include/rpc_samr.h */ #define DOMAIN_PASSWORD_COMPLEX 0x00000001 #define REJECT_REASON_OTHER 0x00000000 #define REJECT_REASON_TOO_SHORT 0x00000001 #define REJECT_REASON_IN_HISTORY 0x00000002 #define REJECT_REASON_NOT_COMPLEX 0x00000005 /* from include/smb.h */ #define ACB_PWNOEXP 0x00000200 /* from include/rpc_netlogon.h */ #define LOGON_CACHED_ACCOUNT 0x00000004