]> git.pond.sub.org Git - empserver/commitdiff
(ef_verify): Check pchr[].p_level matches pchr[].p_type.
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 8 Jun 2006 20:22:58 +0000 (20:22 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 8 Jun 2006 20:22:58 +0000 (20:22 +0000)
src/lib/common/ef_verify.c

index 41f5a54ac9774f27683c8bfe11d0dd297a1b4155..08a3c7c59bf59df3e8b926db73f676ab069e9ed8 100644 (file)
@@ -170,5 +170,16 @@ ef_verify()
            retval += verify_row(ep->uid, i);
        }
     }
+
+    /* Special checks */
+    for (i = 0; pchr[i].p_sname; i++) {
+       if ((pchr[i].p_type >= 0) == (pchr[i].p_level >= 0)) {
+           fprintf(stderr,
+               "Config %s uid %d field level doesn't match field type\n",
+               ef_nameof(EF_PRODUCT), i);
+           retval = -1;
+       }
+    }
+
     return retval;
 }