00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef KCHECKPASS_H_
00038 #define KCHECKPASS_H_
00039
00040 #include <config.h>
00041
00042 #ifdef HAVE_CRYPT_H
00043 #include <crypt.h>
00044 #endif
00045
00046 #ifdef HAVE_PATHS_H
00047 #include <paths.h>
00048 #endif
00049
00050 #include <pwd.h>
00051 #include <sys/types.h>
00052
00053 #ifndef _PATH_TMP
00054 #define _PATH_TMP "/tmp/"
00055 #endif
00056
00057
00058 #ifdef ultrix
00059 #include <auth.h>
00060 #endif
00061
00062 #include <unistd.h>
00063
00064 #ifdef OSF1_ENH_SEC
00065 #include <sys/security.h>
00066 #include <prot.h>
00067 #endif
00068
00069
00070 #if defined(HAVE_PAM)
00071 # undef HAVE_OSF_C2_PASSWD
00072 # undef HAVE_SHADOW
00073 #elif defined(HAVE_OSF_C2_PASSWD)
00074 # undef HAVE_SHADOW
00075 #elif defined(_AIX)
00076 # define HAVE_AIX_AUTH
00077 # undef HAVE_SHADOW
00078 #elif !defined(HAVE_SHADOW)
00079 # define HAVE_ETCPASSWD
00080 #endif
00081
00082 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
00083 # define ATTR_UNUSED __attribute__((unused))
00084 # define ATTR_NORETURN __attribute__((noreturn))
00085 # define ATTR_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
00086 #else
00087 # define ATTR_UNUSED
00088 # define ATTR_NORETURN
00089 # define ATTR_PRINTFLIKE(fmt,var)
00090 #endif
00091
00092 #ifdef __cplusplus
00093 extern "C" {
00094 #endif
00095
00096
00097 typedef enum {
00098 AuthOk = 0,
00099 AuthBad = 1,
00100 AuthError = 2,
00101 AuthAbort = 3
00102 } AuthReturn;
00103
00104 typedef enum {
00105 ConvGetBinary,
00106 ConvGetNormal,
00107 ConvGetHidden,
00108 ConvPutInfo,
00109 ConvPutError
00110 } ConvRequest;
00111
00112
00113 typedef enum {
00114 IsUser = 1,
00115 IsPassword = 2
00116 } DataTag;
00117
00118
00119
00120
00121 AuthReturn Authenticate(
00122 #ifdef HAVE_PAM
00123 const char *caller,
00124 #endif
00125 const char *method,
00126 const char *user,
00127 char *(*conv) (ConvRequest, const char *));
00128
00129
00130
00131
00132 void message(const char *, ...) ATTR_PRINTFLIKE(1, 2);
00133
00134
00135
00136
00137 void dispose(char *);
00138
00139 #ifdef __cplusplus
00140 }
00141 #endif
00142 #endif