rename -a "none" to "plaintext", also bail out if requesting

unsupported auth method


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14043 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2004-07-14 09:04:34 +00:00
parent b2fc2ab0e8
commit 252c9a30bc

View File

@@ -210,7 +210,15 @@ static struct getargs args[] = {
#if defined(KRB4) || defined(KRB5) #if defined(KRB4) || defined(KRB5)
{ "kerberos", 'k', arg_flag, &kerberos_flag, "use kerberos" }, { "kerberos", 'k', arg_flag, &kerberos_flag, "use kerberos" },
#endif #endif
{ "auth-mode", 'a', arg_string, &auth_str, "required authentication" }, { "auth-mode", 'a', arg_string, &auth_str, "required authentication",
"plaintext"
#ifdef OTP
"|otp"
#endif
#ifdef SASL
"|sasl"
#endif
},
{ "debug", 'd', arg_flag, &debug_flag }, { "debug", 'd', arg_flag, &debug_flag },
{ "interactive", 'i', arg_flag, &interactive_flag, "create new socket" }, { "interactive", 'i', arg_flag, &interactive_flag, "create new socket" },
{ "port", 'p', arg_string, &port_str, "port to listen to", "port" }, { "port", 'p', arg_string, &port_str, "port to listen to", "port" },
@@ -302,14 +310,27 @@ pop_init(POP *p,int argcount,char **argmessage)
} }
if(auth_str){ if(auth_str){
if (strcmp (auth_str, "none") == 0) if (strcasecmp (auth_str, "plaintext") == 0 ||
strcasecmp (auth_str, "none") == 0)
p->auth_level = AUTH_NONE; p->auth_level = AUTH_NONE;
else if(strcmp(auth_str, "otp") == 0) else if(strcasecmp(auth_str, "otp") == 0) {
#ifdef OTP
p->auth_level = AUTH_OTP; p->auth_level = AUTH_OTP;
else if(strcmp(auth_str, "sasl") == 0) #else
pop_log (p, POP_PRIORITY, "support for OTP not enabled");
exit(1);
#endif
} else if(strcasecmp(auth_str, "sasl") == 0) {
#ifdef SASL
p->auth_level = AUTH_SASL; p->auth_level = AUTH_SASL;
else #else
warnx ("bad value for -a: %s", optarg); pop_log (p, POP_PRIORITY, "support for SASL not enabled");
exit(1);
#endif
} else {
pop_log (p, POP_PRIORITY, "bad value for -a: %s", auth_str);
exit(1);
}
} }
/* Debugging requested */ /* Debugging requested */
p->debug = debug_flag; p->debug = debug_flag;