Regularize warning messages
authorAlan T. DeKok <aland@freeradius.org>
Fri, 6 Aug 2010 15:48:44 +0000 (17:48 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 7 Aug 2010 07:46:28 +0000 (09:46 +0200)
src/modules/rlm_pap/rlm_pap.c

index 2088df2..e1b0e22 100644 (file)
@@ -468,7 +468,7 @@ static int pap_authorize(void *instance, REQUEST *request)
         *      Don't touch existing Auth-Types.
         */
        if (auth_type) {
-               RDEBUG2("Found existing Auth-Type, not changing it.");
+               RDEBUG2("WARNING: Auth-Type already set.  Not setting to PAP");
                return RLM_MODULE_NOOP;
        }
 
@@ -515,16 +515,9 @@ static int pap_authenticate(void *instance, REQUEST *request)
        char buff2[MAX_STRING_LEN + 50];
        int scheme = PAP_ENC_INVALID;
 
-       if (!request->password){
-               radlog_request(L_AUTH, 0, request, "Attribute \"Password\" is required for authentication.");
-               return RLM_MODULE_INVALID;
-       }
-
-       /*
-        *      Clear-text passwords are the only ones we support.
-        */
-       if (request->password->attribute != PW_USER_PASSWORD) {
-               radlog_request(L_AUTH, 0, request, "Attribute \"User-Password\" is required for authentication. Cannot use \"%s\".", request->password->name);
+       if (!request->password ||
+           (request->password->attribute != PW_USER_PASSWORD)) {
+               RDEBUG("ERROR: You set 'Auth-Type = PAP' for a request that does not contain a User-Password attribute!");
                return RLM_MODULE_INVALID;
        }