diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index af37cf19335..6bc57ba5036 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -515,13 +515,13 @@ static struct bitmap *init_bitmap(TALLOC_CTX *mem_ctx, const char **ops) struct bitmap *bm; if (ops == NULL) { + DBG_ERR("init_bitmap, ops list is empty (logic error)\n"); return NULL; } bm = bitmap_talloc(mem_ctx, SMB_VFS_OP_LAST); if (bm == NULL) { - DEBUG(0, ("Could not alloc bitmap -- " - "defaulting to logging everything\n")); + DBG_ERR("Could not alloc bitmap\n"); return NULL; } @@ -563,7 +563,7 @@ static struct bitmap *init_bitmap(TALLOC_CTX *mem_ctx, const char **ops) } } if (i == SMB_VFS_OP_LAST) { - DEBUG(0, ("Could not find opname %s, logging all\n", + DEBUG(0, ("Could not find opname %s\n", *ops)); TALLOC_FREE(bm); return NULL; @@ -752,9 +752,19 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, pd->success_ops = init_bitmap( pd, lp_parm_string_list(SNUM(handle->conn), "full_audit", "success", none)); + if (pd->success_ops == NULL) { + DBG_ERR("Invalid success operations list. Failing connect\n"); + SMB_VFS_NEXT_DISCONNECT(handle); + return -1; + } pd->failure_ops = init_bitmap( pd, lp_parm_string_list(SNUM(handle->conn), "full_audit", "failure", none)); + if (pd->failure_ops == NULL) { + DBG_ERR("Invalid failure operations list. Failing connect\n"); + SMB_VFS_NEXT_DISCONNECT(handle); + return -1; + } /* Store the private data. */ SMB_VFS_HANDLE_SET_DATA(handle, pd, NULL,