added bitch about check-items in the reply-item list.
authoraland <aland>
Thu, 2 Sep 1999 14:59:48 +0000 (14:59 +0000)
committeraland <aland>
Thu, 2 Sep 1999 14:59:48 +0000 (14:59 +0000)
It now prints out a DESCRIPTIVE error message saying exactly
what's the user did wrong.

src/modules/rlm_files/rlm_files.c

index 7c33ed5..6d95562 100644 (file)
@@ -45,7 +45,7 @@ char rlm_files_sccsid[] =
 static DBM     *dbmfile;
 #endif
 
-PAIR_LIST      *users = NULL;
+static PAIR_LIST       *users = NULL;
 
 #if defined(WITH_DBM) || defined(WITH_NDBM)
 /*
@@ -202,6 +202,38 @@ static int file_init(int argc, char **argv)
 
        if (!use_dbm) users = pairlist_read(fn, 1);
 
+       /*
+        *      Walk through the 'users' file list, looking for
+        *      check-items in the reply-item lists.
+        */
+       if (debug_flag) {
+         PAIR_LIST *entry;
+         VALUE_PAIR *vp;
+
+         entry = users;
+         while (entry) {
+           vp = entry->reply;
+           while (vp) {
+             /*
+              *        If it's NOT a vendor attribute,
+              *        and it's NOT a wire protocol
+              *        and we ignore Fall-Through,
+              *        then bitch about it, giving a good warning message.
+              */
+             if (!(vp->attribute & ~0xffff) &&
+                 (vp->attribute > 0xff) &&
+                 (vp->attribute != PW_FALL_THROUGH)) {
+               log_debug("[%s]:%d WARNING! Found possible check item '%s' in "
+                         "the reply list for user %s",
+                         fn, entry->lineno, vp->name, entry->name);
+             }
+             vp = vp->next;
+           }
+           entry = entry->next;
+         }
+
+       }
+
        return users ? 0 : -1;
 }