conditionalize OTP-support
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3689 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -226,7 +226,7 @@ pop_init(POP *p,int argcount,char **argmessage)
|
||||
krb5_set_warn_dest(p->context, p->logf);
|
||||
#else
|
||||
/* Open the log file */
|
||||
openlog(p->myname,POP_LOGOPTS,POP_FACILITY);
|
||||
roken_openlog(p->myname,POP_LOGOPTS,POP_FACILITY);
|
||||
#endif
|
||||
|
||||
p->auth_level = AUTH_NONE;
|
||||
@@ -312,7 +312,7 @@ pop_init(POP *p,int argcount,char **argmessage)
|
||||
p->ipport = ntohs(cs.sin_port);
|
||||
|
||||
/* Get the canonical name of the host to whom I am speaking */
|
||||
ch = gethostbyaddr((const char *)&cs.sin_addr,
|
||||
ch = roken_gethostbyaddr((const char *)&cs.sin_addr,
|
||||
sizeof(cs.sin_addr),
|
||||
AF_INET);
|
||||
if (ch == NULL){
|
||||
@@ -329,7 +329,7 @@ pop_init(POP *p,int argcount,char **argmessage)
|
||||
|
||||
/* See if the name obtained for the client's IP
|
||||
address returns an address */
|
||||
if ((ch_again = gethostbyname(ch->h_name)) == NULL) {
|
||||
if ((ch_again = roken_gethostbyname(ch->h_name)) == NULL) {
|
||||
pop_log(p,POP_PRIORITY,
|
||||
"Client at \"%s\" resolves to an unknown host name \"%s\"",
|
||||
p->ipaddr,ch->h_name);
|
||||
|
@@ -133,7 +133,7 @@ pop_pass (POP *p)
|
||||
p->ipaddr,
|
||||
p->kdata.pname, p->kdata.pinst, p->kdata.prealm,
|
||||
p->user);
|
||||
}
|
||||
} else
|
||||
#endif /* KRB4 */
|
||||
#ifdef KRB5
|
||||
if (p->version == 5) {
|
||||
@@ -164,9 +164,12 @@ pop_pass (POP *p)
|
||||
"Password supplied for \"%s\" is incorrect.",
|
||||
p->user));
|
||||
|
||||
#ifdef OTP
|
||||
if (otp_verify_user (&p->otp_ctx, p->pop_parm[1]) == 0)
|
||||
;
|
||||
else if(p->auth_level != AUTH_NONE)
|
||||
else
|
||||
#endif
|
||||
if(p->auth_level != AUTH_NONE)
|
||||
return pop_msg(p, POP_FAILURE,
|
||||
"Password supplied for \"%s\" is incorrect.",
|
||||
p->user);
|
||||
|
@@ -18,10 +18,13 @@ pop_user (POP *p)
|
||||
|
||||
strcpy(p->user, p->pop_parm[1]);
|
||||
|
||||
#ifdef OTP
|
||||
if (otp_challenge (&p->otp_ctx, p->user, ss, sizeof(ss)) == 0) {
|
||||
return pop_msg(p, POP_SUCCESS, "Password %s required for %s.",
|
||||
ss, p->user);
|
||||
} else if (p->auth_level != AUTH_NONE) {
|
||||
} else
|
||||
#endif
|
||||
if (p->auth_level != AUTH_NONE) {
|
||||
char *s = otp_error(&p->otp_ctx);
|
||||
return pop_msg(p, POP_FAILURE, "Permission denied%s%s",
|
||||
s ? ":" : "", s ? s : "");
|
||||
|
@@ -267,7 +267,9 @@ typedef struct { /* POP parameter block */
|
||||
#endif
|
||||
int version; /* 4 or 5? */
|
||||
int auth_level; /* Dont allow cleartext */
|
||||
#ifdef OTP
|
||||
OtpContext otp_ctx; /* OTP context */
|
||||
#endif
|
||||
} POP;
|
||||
|
||||
typedef struct { /* State information for
|
||||
|
Reference in New Issue
Block a user