From 589c09c41d620ad45b9808d5eb6b79410d820752 Mon Sep 17 00:00:00 2001 From: Unknown User d91-jda Date: Thu, 18 Apr 1996 01:58:26 +0000 Subject: [PATCH] Fixes. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@403 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftpd/auth.c | 23 ++++++++++++++--------- appl/ftp/ftpd/auth.h | 2 ++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/appl/ftp/ftpd/auth.c b/appl/ftp/ftpd/auth.c index 0f7b4b157..d9554f4d6 100644 --- a/appl/ftp/ftpd/auth.c +++ b/appl/ftp/ftpd/auth.c @@ -52,6 +52,11 @@ void delete_ftp_command(void) } } +int auth_ok(void) +{ + return ct && auth_complete; +} + void auth(char *auth) { for(ct=auth_types; ct->name; ct++){ @@ -74,7 +79,7 @@ void adat(char *auth) void pbsz(int size) { int old = buffer_size; - if(ct && auth_complete) + if(auth_ok()) ct->pbsz(size); else reply(503, "Incomplete security data exchange."); @@ -111,7 +116,7 @@ void prot(char *pl) return; } - if(ct && auth_complete){ + if(auth_ok()){ if(ct->prot(p)){ reply(536, "%s does not support %s protection.", ct->name, protection_names[p]); @@ -127,7 +132,7 @@ void prot(char *pl) void ccc(void) { - if(ct && auth_complete){ + if(auth_ok()){ if(!ct->ccc()) prot_level = prot_clear; }else @@ -136,7 +141,7 @@ void ccc(void) void mic(char *msg) { - if(ct && auth_complete){ + if(auth_ok()){ if(!ct->mic(msg)) prot_level = prot_safe; }else @@ -145,7 +150,7 @@ void mic(char *msg) void conf(char *msg) { - if(ct && auth_complete){ + if(auth_ok()){ if(!ct->conf(msg)) prot_level = prot_confidential; }else @@ -154,7 +159,7 @@ void conf(char *msg) void enc(char *msg) { - if(ct && auth_complete){ + if(auth_ok()){ if(!ct->enc(msg)) prot_level = prot_private; }else @@ -163,7 +168,7 @@ void enc(char *msg) int auth_read(int fd, void *data, int length) { - if(ct && auth_complete && data_protection) + if(auth_ok() && data_protection) return ct->read(fd, data, length); else return read(fd, data, length); @@ -171,7 +176,7 @@ int auth_read(int fd, void *data, int length) int auth_write(int fd, void *data, int length) { - if(ct && auth_complete && data_protection) + if(auth_ok() && data_protection) return ct->write(fd, data, length); else return write(fd, data, length); @@ -179,7 +184,7 @@ int auth_write(int fd, void *data, int length) void auth_vprintf(const char *fmt, va_list ap) { - if(ct && auth_complete && prot_level){ + if(auth_ok() && prot_level){ ct->vprintf(fmt, ap); }else vprintf(fmt, ap); diff --git a/appl/ftp/ftpd/auth.h b/appl/ftp/ftpd/auth.h index 9eb91a5ff..cf2fbfa67 100644 --- a/appl/ftp/ftpd/auth.h +++ b/appl/ftp/ftpd/auth.h @@ -37,6 +37,8 @@ extern int auth_complete; void auth_init(void); +int auth_ok(void); + void auth(char*); void adat(char*); void pbsz(int);