diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1995-12-14 08:43:57 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1995-12-14 08:43:57 +0000 |
commit | b9bde382b38aba7823a008759b0b88b6c7a68966 (patch) | |
tree | 2df6948320f675f2f3b178831a2c18f8062fc4d3 /kerberosIV/krb/get_pw_tkt.c | |
parent | 51285176beb2daf7fedfbdc3f22cb775c29ef5af (diff) |
Do not use hardcoded realm or host names
Diffstat (limited to 'kerberosIV/krb/get_pw_tkt.c')
-rw-r--r-- | kerberosIV/krb/get_pw_tkt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kerberosIV/krb/get_pw_tkt.c b/kerberosIV/krb/get_pw_tkt.c index 0e459a3c6d7..d2dbf5ee2e1 100644 --- a/kerberosIV/krb/get_pw_tkt.c +++ b/kerberosIV/krb/get_pw_tkt.c @@ -28,6 +28,7 @@ or implied warranty. */ #include "krb_locl.h" +#include <sys/param.h> /* * Get a ticket for the password-changing server ("changepw.KRB_MASTER"). @@ -66,17 +67,23 @@ get_pw_tkt(user, instance, realm, cpw) char *realm; char *cpw; { + char *dot, admin[MAXHOSTNAMELEN]; int kerror; + if ((kerror = krb_get_admhst(admin, realm, 1)) != KSUCCESS) + return(GT_PW_BADPW); + if ((dot = strchr(admin, '.')) != NULL) + *dot = '\0'; + kerror = krb_get_pw_in_tkt(user, instance, realm, "changepw", - KRB_MASTER, 1, cpw); + admin, 1, cpw); if (kerror == INTK_BADPW) return(GT_PW_BADPW); if (kerror == KDC_NULL_KEY) { kerror = krb_get_pw_in_tkt("default","changepw",realm,"changepw", - KRB_MASTER,1,"changepwkrb"); + admin,1,"changepwkrb"); if (kerror) return(kerror); return(GT_PW_NULL); |