From 3b403d5b073e6931a6ad61a15fcb8f4e85c61bcb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 10 Apr 2020 13:27:18 -0700 Subject: [PATCH 1/2] s3: VFS: full_audit. Add missing fcntl entry in vfs_op_names[] array. Found by yannick@in2ip.nl. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14343 Signed-off-by: Jeremy Allison --- source3/modules/vfs_full_audit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 1ea58a0ffab..f8eef6eb1df 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -293,6 +293,7 @@ static struct { { SMB_VFS_OP_FALLOCATE,"fallocate" }, { SMB_VFS_OP_LOCK, "lock" }, { SMB_VFS_OP_KERNEL_FLOCK, "kernel_flock" }, + { SMB_VFS_OP_FCNTL, "fcntl" }, { SMB_VFS_OP_LINUX_SETLEASE, "linux_setlease" }, { SMB_VFS_OP_GETLOCK, "getlock" }, { SMB_VFS_OP_SYMLINKAT, "symlinkat" }, -- 2.20.1 From e23a947757eeb267a69dc8b8a0c4dc8b808cda95 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 10 Apr 2020 14:14:25 -0700 Subject: [PATCH 2/2] s3: VFS: Add cmocka test for vfs_full_audit to make sure all arrays are correct. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14343 Signed-off-by: Jeremy Allison --- source3/modules/test_vfs_full_audit.c | 49 +++++++++++++++++++++++++++ source3/modules/wscript_build | 5 +++ source3/selftest/tests.py | 4 +++ 3 files changed, 58 insertions(+) create mode 100644 source3/modules/test_vfs_full_audit.c diff --git a/source3/modules/test_vfs_full_audit.c b/source3/modules/test_vfs_full_audit.c new file mode 100644 index 00000000000..cdfee86b09c --- /dev/null +++ b/source3/modules/test_vfs_full_audit.c @@ -0,0 +1,49 @@ +/* + * Unix SMB/CIFS implementation. + * + * Unit test for entries in vfs_full_audit arrays. + * + * Copyright (C) Jeremy Allison 2020 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +/* Needed for static build to complete... */ +#include "includes.h" +#include "smbd/smbd.h" +NTSTATUS vfs_vfs_full_audit_init(TALLOC_CTX *ctx); + +#include "vfs_full_audit.c" +#include + +static void test_full_audit_array(void **state) +{ + unsigned i; + + for (i=0; i