diff options
author | Jeremy Allison <jra@samba.org> | 1998-02-26 22:58:21 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-02-26 22:58:21 +0000 |
commit | 60f6302b1972e49159bf6e1a838e691268e4399c (patch) | |
tree | fa93463a4db8e2796b276df0eacc1340db3a7f08 /source/smbd/password.c | |
parent | 140fba461bc22f26055c13b04a084d2df16ac604 (diff) | |
download | samba-60f6302b1972e49159bf6e1a838e691268e4399c.tar.gz samba-60f6302b1972e49159bf6e1a838e691268e4399c.tar.xz samba-60f6302b1972e49159bf6e1a838e691268e4399c.zip |
Makefile, password.c, includes.h: Added KRB4 patches from Johan Hedin <johanh@fusion.kth.se>
nmbd_packets.c: Patch for aliased interfaces from Daniel Haun <dhaun@ecf2.puc.edu>.
Jeremy.
Diffstat (limited to 'source/smbd/password.c')
-rw-r--r-- | source/smbd/password.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/smbd/password.c b/source/smbd/password.c index 607d01d2cfb..19115154045 100644 --- a/source/smbd/password.c +++ b/source/smbd/password.c @@ -670,6 +670,32 @@ static BOOL krb5_auth(char *this_user,char *password) } #endif /* KRB5_AUTH */ +#ifdef KRB4_AUTH +/******************************************************************* +check on Kerberos authentication +********************************************************************/ +static BOOL krb4_auth(char *this_user,char *password) +{ + char realm[REALM_SZ]; + char tkfile[MAXPATHLEN]; + + if (krb_get_lrealm(realm, 1) != KSUCCESS) + (void) strncpy(realm, KRB_REALM, sizeof (realm)); + + (void) sprintf(tkfile, "/tmp/samba_tkt_%d", getpid()); + + krb_set_tkt_string(tkfile); + if (krb_verify_user(this_user, "", realm, + password, 0, + "rmcd") == KSUCCESS) { + unlink(tkfile); + return 1; + } + unlink(tkfile); + return 0; +} +#endif /* KRB4_AUTH */ + #ifdef LINUX_BIGCRYPT /**************************************************************************** an enhanced crypt for Linux to handle password longer than 8 characters @@ -775,6 +801,10 @@ Hence we make a direct return to avoid a second chance!!! if (krb5_auth(this_user,password)) return(True); #endif +#ifdef KRB4_AUTH + if (krb4_auth(this_user,password)) return(True); +#endif + #ifdef PWDAUTH if (pwdauth(this_user,password) == 0) return(True); |