vfs: check full_audit enum->str mapping on startup
authorDavid Disseldorp <ddiss@samba.org>
Thu, 27 Sep 2012 10:34:53 +0000 (12:34 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Fri, 28 Sep 2012 17:28:49 +0000 (19:28 +0200)
Signed-off-by: Jim McDonough <jmcd@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Sep 28 19:28:49 CEST 2012 on sn-devel-104

source3/modules/vfs_full_audit.c

index 5c5f91cfd0164f187abb286cdecccaff62d65ad4..6050c550276eec42e9c3fa33c9839f77039997ef 100644 (file)
@@ -203,7 +203,7 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_LAST
 } vfs_op_type;
 
-/* The following array *must* be in the same order as defined in vfs.h */
+/* The following array *must* be in the same order as defined in vfs_op_type */
 
 static struct {
        vfs_op_type type;
@@ -444,9 +444,10 @@ static struct bitmap *init_bitmap(TALLOC_CTX *mem_ctx, const char **ops)
                }
 
                for (i=0; i<SMB_VFS_OP_LAST; i++) {
-                       if (vfs_op_names[i].name == NULL) {
+                       if ((vfs_op_names[i].name == NULL)
+                        || (vfs_op_names[i].type != i)) {
                                smb_panic("vfs_full_audit.c: name table not "
-                                         "in sync with vfs.h\n");
+                                         "in sync with vfs_op_type enums\n");
                        }
                        if (strequal(op, vfs_op_names[i].name)) {
                                if (neg) {