00001
00002 #ifndef __JBXL_PASSWORD_H_
00003 #define __JBXL_PASSWORD_H_
00004
00012
00013
00014
00015
00016
00017
00018
00019 #include "tools.h"
00020 #include <pwd.h>
00021
00022
00023 #ifdef HAVE_SHADOW_H
00024 #include <shadow.h>
00025 #endif
00026
00027 #ifdef HAVE_UNISTD_H
00028 #ifndef _XOPEN_SOURCE
00029 #define _XOPEN_SOURCE
00030 #endif
00031 #include <unistd.h>
00032 #endif
00033
00034 #ifdef HAVE_CRYPT_H
00035 #include <crypt.h>
00036 #endif
00037
00038 #ifdef HAVE_RPCSVC_YPCLNT_H
00039 #include <rpcsvc/ypclnt.h>
00040 #endif
00041
00042
00043 #ifdef AIX
00044 struct dom_binding {int dummy;};
00045 #endif
00046
00047
00048 #define LEN_DOLLAR_SALT 12
00049 #define LEN_DOLLAR2_SALT 29
00050 #define LEN_DOLLAR5_SALT 20
00051 #define LEN_DOLLAR6_SALT 20
00052
00053 #define LEN_MD5PASS 34
00054 #define LEN_MD5SALT 12
00055 #define LEN_DESPASS 13
00056 #define LEN_DESSALT 2
00057
00058
00059 char* get_passwd(char* user_id);
00060 void free_pw(struct passwd* pw);
00061 int check_passwd(char* passwd, char* cryptpass);
00062 int check_salt(char* passwd);
00063
00064 char* x2crypt(char* pass, char* salt);
00065
00066
00067 #ifdef HAVE_RPCSVC_YPCLNT_H
00068 char* get_nis_passwdf(char* usrid);
00069 struct passwd* getnisnam(char* usrid);
00070 #endif
00071
00072
00073 #endif