--- ./source3/modules/vfs_acl_common.c_orig	2020-09-23 08:55:42 +0000
+++ ./source3/modules/vfs_acl_common.c	2020-09-23 08:59:05 +0000
@@ -33,6 +33,10 @@
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
+#ifdef _AIX
+#define AT_REMOVEDIR  1
+#endif
+
 static NTSTATUS create_acl_blob(const struct security_descriptor *psd,
 			DATA_BLOB *pblob,
 			uint16_t hash_type,
--- ./source3/modules/vfs_recycle.c_orig	2020-09-23 09:02:49 +0000
+++ ./source3/modules/vfs_recycle.c	2020-09-23 09:03:44 +0000
@@ -28,6 +28,10 @@
 #include "../librpc/gen_ndr/ndr_netlogon.h"
 #include "auth.h"
 
+#ifdef _AIX
+#define AT_REMOVEDIR  1
+#endif
+
 #define ALLOC_CHECK(ptr, label) do { if ((ptr) == NULL) { DEBUG(0, ("recycle.bin: out of memory!\n")); errno = ENOMEM; goto label; } } while(0)
 
 static int vfs_recycle_debug_level = DBGC_VFS;
--- ./source3/smbd/close.c_orig	2020-09-23 07:02:15 +0000
+++ ./source3/smbd/close.c	2020-09-23 07:03:05 +0000
@@ -33,6 +33,10 @@
 #include "../librpc/gen_ndr/open_files.h"
 #include "lib/util/tevent_ntstatus.h"
 
+#ifdef _AIX
+#define AT_REMOVEDIR 1
+#endif
+
 /****************************************************************************
  Run a file if it is a magic script.
 ****************************************************************************/
--- ./source3/smbd/vfs.c_orig	2020-09-23 06:59:40 +0000
+++ ./source3/smbd/vfs.c	2020-09-23 07:00:16 +0000
@@ -37,6 +37,10 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
 
+#ifdef _AIX
+#define AT_FDCWD  (-2)
+#endif
+
 static_decl_vfs;
 
 struct vfs_fsp_data {
--- ./source4/torture/smb2/create.c_orig	2020-09-23 09:39:42 +0000
+++ ./source4/torture/smb2/create.c	2020-09-23 09:44:38 +0000
@@ -1898,7 +1898,7 @@
 	h1 = io.out.file.handle;
 
 	r = (struct smb2_read) {
-		.in.file.handle = h1,
+		.in.file = {.handle = h1},
 		.in.length = stream_size,
 		.in.offset = 0,
 	};
@@ -1961,7 +1961,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -1997,7 +1997,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2033,7 +2033,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2068,7 +2068,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tctx, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -2079,7 +2079,7 @@
 
 	sinfo = (union smb_setfileinfo) {
 		.basic_info.level = RAW_SFILEINFO_BASIC_INFORMATION,
-		.basic_info.in.file.handle = h1,
+		.basic_info.in.file = {.handle = h1},
 	};
 	unix_to_nt_time(&sinfo.basic_info.in.write_time, time(NULL));
 
@@ -2089,7 +2089,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tctx, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -2125,7 +2125,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2162,7 +2162,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2199,7 +2199,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2234,7 +2234,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tctx, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -2245,7 +2245,7 @@
 
 	sinfo = (union smb_setfileinfo) {
 		.basic_info.level = RAW_SFILEINFO_BASIC_INFORMATION,
-		.basic_info.in.file.handle = h1,
+		.basic_info.in.file = {.handle = h1},
 	};
 	unix_to_nt_time(&sinfo.basic_info.in.write_time, time(NULL));
 
@@ -2255,7 +2255,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tctx, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -2290,7 +2290,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2306,7 +2306,7 @@
 	 * didn't modify the base file metadata.
 	 */
 	f = (struct smb2_find) {
-		.in.file.handle = testdirh,
+		.in.file = {.handle = testdirh},
 		.in.pattern = "foo",
 		.in.max_response_size = 0x1000,
 		.in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO,
@@ -2377,7 +2377,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2414,7 +2414,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2451,7 +2451,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2488,7 +2488,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2525,7 +2525,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2560,7 +2560,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tctx, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -2571,7 +2571,7 @@
 
 	sinfo = (union smb_setfileinfo) {
 		.basic_info.level = RAW_SFILEINFO_BASIC_INFORMATION,
-		.basic_info.in.file.handle = h1,
+		.basic_info.in.file = {.handle = h1},
 	};
 	unix_to_nt_time(&sinfo.basic_info.in.write_time, time(NULL));
 
@@ -2581,7 +2581,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tctx, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -2617,7 +2617,7 @@
 	 */
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -2633,7 +2633,7 @@
 	 * didn't modify the base file metadata.
 	 */
 	f = (struct smb2_find) {
-		.in.file.handle = testdirh,
+		.in.file = {.handle = testdirh},
 		.in.pattern = "foo",
 		.in.max_response_size = 0x1000,
 		.in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO,
--- ./source4/torture/smb2/oplock.c_orig	2020-09-23 09:27:23 +0000
+++ ./source4/torture/smb2/oplock.c	2020-09-23 09:28:06 +0000
@@ -3959,7 +3959,7 @@
 		       "Did not get BATCH oplock\n");
 
 	closeio = (struct smb2_close) {
-		.in.file.handle = io.smb2.out.file.handle,
+		.in.file = {.handle = io.smb2.out.file.handle},
 	};
 	status = smb2_close(tree2, &closeio);
 	torture_assert_ntstatus_equal(
--- ./source4/torture/smb2/read.c_orig	2020-09-23 09:21:26 +0000
+++ ./source4/torture/smb2/read.c	2020-09-23 09:21:57 +0000
@@ -367,7 +367,7 @@
 		"torture_smb2_testfile_access failed\n");
 
 	r = (struct smb2_read) {
-		.in.file.handle = h,
+		.in.file = {.handle = h},
 		.in.length      = 1,
 		.in.offset      = 0,
 		.in.min_count   = 1,
--- ./source4/torture/smb2/timestamps.c_orig	2020-09-23 09:28:45 +0000
+++ ./source4/torture/smb2/timestamps.c	2020-09-23 09:39:03 +0000
@@ -74,7 +74,7 @@
 
 	si = (union smb_setfileinfo) {
 		.basic_info.level = RAW_SFILEINFO_BASIC_INFORMATION,
-		.basic_info.in.file.handle = handle,
+		.basic_info.in.file = {.handle = handle},
 	};
 
 	nttime = full_timespec_to_nt_time(&ts);
@@ -88,7 +88,7 @@
 
 	gi = (union smb_fileinfo) {
 		.generic.level = SMB_QFILEINFO_BASIC_INFORMATION,
-		.generic.in.file.handle = handle,
+		.generic.in.file = {.handle = handle},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &gi);
@@ -117,7 +117,7 @@
 				      "Wrong change time\n");
 
 	find = (struct smb2_find) {
-		.in.file.handle = testdirh,
+		.in.file = {.handle = testdirh},
 		.in.pattern = fname,
 		.in.max_response_size = 0x1000,
 		.in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO,
@@ -164,7 +164,7 @@
 
 	gi = (union smb_fileinfo) {
 		.generic.level = SMB_QFILEINFO_BASIC_INFORMATION,
-		.generic.in.file.handle = handle,
+		.generic.in.file = {.handle = handle},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &gi);
@@ -194,7 +194,7 @@
 
 	find = (struct smb2_find) {
 		.in.continue_flags = SMB2_CONTINUE_FLAG_RESTART,
-		.in.file.handle = testdirh,
+		.in.file = {.handle = testdirh},
 		.in.pattern = fname,
 		.in.max_response_size = 0x1000,
 		.in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO,
@@ -335,7 +335,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -364,7 +364,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -408,7 +408,7 @@
 	torture_comment(tctx, "Close file-handle 1, write-time should not be updated\n");
 
 	c = (struct smb2_close) {
-		.in.file.handle = h1,
+		.in.file = {.handle =  h1},
 		.in.flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION,
 	};
 
@@ -479,7 +479,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -494,7 +494,7 @@
 			"should flush pending writetime update\n");
 
 	f = (struct smb2_flush) {
-		.in.file.handle = h1,
+		.in.file = {.handle =  h1},
 	};
 
 	status = smb2_flush(tree, &f);
@@ -506,7 +506,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -521,7 +521,7 @@
 	torture_comment(tctx, "Close file-handle 1, write-time should not be updated\n");
 
 	c = (struct smb2_close) {
-		.in.file.handle = h1,
+		.in.file = {.handle =  h1},
 		.in.flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION,
 	};
 
@@ -584,7 +584,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -606,7 +606,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -747,7 +747,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -764,7 +764,7 @@
 	sleep(1);
 
 	c = (struct smb2_close) {
-		.in.file.handle = h1,
+		.in.file = {.handle =  h1},
 		.in.flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION,
 	};
 
@@ -835,7 +835,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -859,7 +859,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -876,7 +876,7 @@
 	send_close_time = full_timespec_to_nt_time(&now);
 
 	c = (struct smb2_close) {
-		.in.file.handle = h1,
+		.in.file = {.handle =  h1},
 		.in.flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION,
 	};
 
@@ -977,7 +977,7 @@
 
 	finfo1 = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h,
+		.generic.in.file = {.handle = h},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo1);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -988,7 +988,7 @@
 					"write failed\n");
 
 	cl = (struct smb2_close) {
-		.in.file.handle = h,
+		.in.file = {.handle =  h},
 		.in.flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION,
 	};
 
@@ -1020,7 +1020,7 @@
 
 	finfo1 = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION,
-		.generic.in.file.handle = h,
+		.generic.in.file = {.handle = h},
 	};
 	status = smb2_getinfo_file(tree, tree, &finfo1);
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
@@ -1033,7 +1033,7 @@
 					"write failed\n");
 
 	cl = (struct smb2_close) {
-		.in.file.handle = h,
+		.in.file = {.handle =  h},
 		.in.flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION,
 	};
 
--- ./source4/torture/vfs/fruit.c_orig	2020-09-23 09:42:59 +0000
+++ ./source4/torture/vfs/fruit.c	2020-09-23 09:49:10 +0000
@@ -2917,7 +2917,7 @@
 					"smb2_create failed\n");
 
 	find = (struct smb2_find) {
-		.in.file.handle = create.out.file.handle,
+		.in.file = {.handle = create.out.file.handle},
 		.in.pattern = "*",
 		.in.max_response_size = 0x1000,
 		.in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO,
@@ -3799,7 +3799,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.stream_info.level = RAW_FILEINFO_STREAM_INFORMATION,
-		.stream_info.in.file.handle = h,
+		.stream_info.in.file = {.handle = h},
 	};
 
 	status = smb2_getinfo_file(tree, tctx, &finfo);
@@ -4876,7 +4876,7 @@
 	torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
 					"torture_smb2_testfile failed\n");
 	r = (struct smb2_read) {
-		.in.file.handle = handle2,
+		.in.file = {.handle = handle2},
 		.in.length      = AFP_INFO_SIZE,
 	};
 
@@ -6347,7 +6347,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_STANDARD_INFORMATION,
-		.generic.in.file.handle = streamh,
+		.generic.in.file = {.handle = streamh},
 	};
 
 	/*
@@ -6401,7 +6401,7 @@
 	if (NT_STATUS_IS_OK(status)) {
 		finfo = (union smb_fileinfo) {
 			.generic.level = RAW_FILEINFO_STANDARD_INFORMATION,
-			.generic.in.file.handle = h1,
+			.generic.in.file = {.handle = h1},
 		};
 
 		/*
@@ -6619,7 +6619,7 @@
 
 	sfinfo = (union smb_setfileinfo) {
 		.end_of_file_info.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION,
-		.end_of_file_info.in.file.handle = streamh,
+		.end_of_file_info.in.file = {.handle = streamh},
 		.end_of_file_info.in.size = 0,
 	};
 	status = smb2_setinfo_file(tree, &sfinfo);
@@ -6656,7 +6656,7 @@
 
 	sfinfo = (union smb_setfileinfo) {
 		.disposition_info.level = RAW_SFILEINFO_DISPOSITION_INFORMATION,
-		.disposition_info.in.file.handle = streamh,
+		.disposition_info.in.file = {.handle = streamh},
 		.disposition_info.in.delete_on_close = true,
 	};
 	status = smb2_setinfo_file(tree, &sfinfo);
@@ -7105,7 +7105,7 @@
 	};
 	lck = (struct smb2_lock) {
 		.in.lock_count = 1,
-		.in.file.handle = h,
+		.in.file = {.handle = h},
 		.in.locks = &el,
 	};
 
@@ -7150,7 +7150,7 @@
 	{
 		struct smb2_close cl = {
 			.level = RAW_CLOSE_SMB2,
-			.in.file.handle = h,
+			.in.file = {.handle = h},
 		};
 		smb2_close(tree, &cl);
 	}
@@ -7364,7 +7364,7 @@
 					"smb2_create failed\n");
 
 	find = (struct smb2_find) {
-		.in.file.handle = create.out.file.handle,
+		.in.file = {.handle = create.out.file.handle},
 		.in.pattern = "*",
 		.in.max_response_size = 0x1000,
 		.in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO,
@@ -7440,7 +7440,7 @@
 					"smb2_create failed\n");
 
 	find = (struct smb2_find) {
-		.in.file.handle = create.out.file.handle,
+		.in.file = {.handle = create.out.file.handle},
 		.in.pattern = "*",
 		.in.max_response_size = 0x1000,
 		.in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO,
@@ -7695,7 +7695,7 @@
 
 	finfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_ALL_INFORMATION,
-		.generic.in.file.handle = h1,
+		.generic.in.file = {.handle = h1},
 	};
 
 	status = smb2_getinfo_file(tree2, tctx, &finfo);
--- ./source4/torture/smb2/replay.c_orig	2020-09-25 08:07:44 +0000
+++ ./source4/torture/smb2/replay.c	2020-09-23 09:20:48 +0000
@@ -147,14 +147,14 @@
 	CHECK_STATUS(status, NT_STATUS_OK);
 
 	f = (struct smb2_flush) {
-		.in.file.handle = h
+		.in.file = {.handle = h}
 	};
 	torture_comment(tctx, "Trying flush\n");
 	status = smb2_flush(tree, &f);
 	CHECK_STATUS(status, NT_STATUS_OK);
 
 	rd = (struct smb2_read) {
-		.in.file.handle = h,
+		.in.file = {.handle = h},
 		.in.length = 10,
 		.in.offset = 0,
 		.in.min_count = 1
@@ -173,7 +173,7 @@
 
 	qfinfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_POSITION_INFORMATION,
-		.generic.in.file.handle = h
+		.generic.in.file = {.handle = h}
 	};
 	torture_comment(tctx, "Trying getinfo\n");
 	status = smb2_getinfo_file(tree, tmp_ctx, &qfinfo);
@@ -182,7 +182,7 @@
 
 	ioctl = (union smb_ioctl) {
 		.smb2.level = RAW_IOCTL_SMB2,
-		.smb2.in.file.handle = h,
+		.smb2.in.file = {.handle = h},
 		.smb2.in.function = FSCTL_CREATE_OR_GET_OBJECT_ID,
 		.smb2.in.max_output_response = 64,
 		.smb2.in.flags = SMB2_IOCTL_FLAG_IS_FSCTL
@@ -195,7 +195,7 @@
 		.in.locks = el,
 		.in.lock_count = 0x0001,
 		.in.lock_sequence = 0x00000000,
-		.in.file.handle	= h
+		.in.file = {.handle = h}
 	};
 	el[0].reserved		= 0x00000000;
 	el[0].flags		= SMB2_LOCK_FLAG_EXCLUSIVE |
@@ -1504,7 +1504,7 @@
 				struct smb2_read rd;
 
 				rd = (struct smb2_read) {
-					.in.file.handle = handle,
+					.in.file = {.handle = handle},
 					.in.length = blob.length,
 					.in.offset = 0
 				};
@@ -1523,7 +1523,7 @@
 			union smb_ioctl ioctl;
 			ioctl = (union smb_ioctl) {
 				.smb2.level = RAW_IOCTL_SMB2,
-				.smb2.in.file.handle = handle,
+				.smb2.in.file = {.handle = handle},
 				.smb2.in.function = FSCTL_CREATE_OR_GET_OBJECT_ID,
 				.smb2.in.max_output_response = 64,
 				.smb2.in.flags = SMB2_IOCTL_FLAG_IS_FSCTL
@@ -1546,7 +1546,7 @@
 
 		qfinfo = (union smb_fileinfo) {
 			.generic.level = RAW_FILEINFO_POSITION_INFORMATION,
-			.generic.in.file.handle = handle
+			.generic.in.file = {.handle = handle}
 		};
 
 		torture_assert_ntstatus_ok_goto(tctx,
@@ -1882,7 +1882,7 @@
 	 * Perform a Read with incremented ChannelSequence
 	 */
 	rd = (struct smb2_read) {
-		.in.file.handle = *h1,
+		.in.file = {.handle = *h1},
 		.in.length = sizeof(buf),
 		.in.offset = 0
 	};
@@ -1923,7 +1923,7 @@
 	 * Performing a Read with stale ChannelSequence is allowed
 	 */
 	rd = (struct smb2_read) {
-		.in.file.handle = *h1,
+		.in.file = {.handle = *h1},
 		.in.length = ARRAY_SIZE(buf),
 		.in.offset = 0
 	};
@@ -1991,7 +1991,7 @@
 	 * Read back from File to verify what was written
 	 */
 	rd = (struct smb2_read) {
-		.in.file.handle = *h1,
+		.in.file = {.handle = *h1},
 		.in.length = ARRAY_SIZE(buf),
 		.in.offset = 0
 	};
@@ -2219,7 +2219,7 @@
 
 	qfinfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_POSITION_INFORMATION,
-		.generic.in.file.handle = *h
+		.generic.in.file = {.handle = *h}
 	};
 	torture_comment(tctx, "Trying getinfo\n");
 	status = smb2_getinfo_file(tree, mem_ctx, &qfinfo);
@@ -2333,7 +2333,7 @@
 
 	qfinfo = (union smb_fileinfo) {
 		.generic.level = RAW_FILEINFO_POSITION_INFORMATION,
-		.generic.in.file.handle = _dh
+		.generic.in.file = {.handle = _dh}
 	};
 
 	/*
--- ./source3/locking/brlock.c_orig	2020-09-25 08:08:32 +0000
+++ ./source3/locking/brlock.c	2020-09-23 08:26:00 +0000
@@ -1007,7 +1007,7 @@
 
 	lock = (struct lock_struct) {
 		.context.smblctx = smblctx,
-		.context.pid = pid,
+		.context = {.pid = pid},
 		.context.tid = br_lck->fsp->conn->cnum,
 		.start = start,
 		.size = size,
--- ./source4/torture/smb2/lock.c_orig	2020-09-25 08:08:59 +0000
+++ ./source4/torture/smb2/lock.c	2020-09-23 08:26:00 +0000
@@ -2905,12 +2905,12 @@
 	 */
 	el = (struct smb2_lock_element) {
 		.length = 100,
-		.offset = 100,
+		.offset =100,
 	};
 	lck = (struct smb2_lock) {
 		.in.locks = &el,
-		.in.lock_count	= 0x0001,
-		.in.file.handle	= h
+		.in.lock_count = 0x0001,
+		.in.file = {.handle = h}
 	};
 
 	torture_comment(torture, "Testing Lock (ignored) Replay detection:\n");
@@ -2932,7 +2932,7 @@
 	SIVAL(res_req, 4, 0);    /* reserved */
 	ioctl = (struct smb2_ioctl) {
 		.level = RAW_IOCTL_SMB2,
-		.in.file.handle = h,
+		.in.file = {.handle = h},
 		.in.function = FSCTL_LMR_REQ_RESILIENCY,
 		.in.max_output_response = 0,
 		.in.flags = SMB2_IOCTL_FLAG_IS_FSCTL,
--- ./source3/locking/locking.c_orig	2020-09-25 09:50:41 +0000
+++ ./source3/locking/locking.c	2020-09-25 09:51:18 +0000
@@ -578,7 +578,7 @@
 		.self = messaging_server_id(msg_ctx),
 		.orig_name_hash = orig_name_hash,
 		.new_name_hash = new_name_hash,
-		.msg.id = id,
+		.msg = {.id = id},
 		.msg.servicepath = servicepath,
 		.msg.base_name = smb_fname_dst->base_name,
 		.msg.stream_name = smb_fname_dst->stream_name,
--- ./source3/locking/share_mode_lock.c_orig	2020-09-25 09:33:40 +0000
+++ ./source3/locking/share_mode_lock.c	2020-09-25 09:37:07 +0000
@@ -1614,7 +1614,7 @@
 	struct share_mode_data *d = lck->data;
 	struct set_share_mode_state state = {
 		.status = NT_STATUS_OK,
-		.e.pid = messaging_server_id(fsp->conn->sconn->msg_ctx),
+		.e = {.pid = messaging_server_id(fsp->conn->sconn->msg_ctx)},
 		.e.share_access = share_access,
 		.e.private_options = fsp->fh->private_options,
 		.e.access_mask = access_mask,
--- ./source4/torture/smb2/acls.c_orig	2020-09-25 10:22:40 +0000
+++ ./source4/torture/smb2/acls.c	2020-09-23 09:26:31 +0000
@@ -2408,7 +2408,7 @@
 
 	gi = (union smb_fileinfo) {
 		.query_secdesc.level = RAW_FILEINFO_SEC_DESC,
-		.query_secdesc.in.file.handle = handle,
+		.query_secdesc.in.file = {.handle = handle},
 		.query_secdesc.in.secinfo_flags = SECINFO_DACL|SECINFO_OWNER,
 	};
 
@@ -2442,7 +2442,7 @@
 
 	si = (union smb_setfileinfo) {
 		.set_secdesc.level = RAW_SFILEINFO_SEC_DESC,
-		.set_secdesc.in.file.handle = handle,
+		.set_secdesc.in.file= {.handle = handle},
 		.set_secdesc.in.secinfo_flags = SECINFO_DACL,
 		.set_secdesc.in.sd = sd,
 	};
@@ -2544,7 +2544,7 @@
 
 	gi = (union smb_fileinfo) {
 		.query_secdesc.level = RAW_FILEINFO_SEC_DESC,
-		.query_secdesc.in.file.handle = handle,
+		.query_secdesc.in.file = {.handle = handle},
 		.query_secdesc.in.secinfo_flags = SECINFO_DACL|SECINFO_OWNER,
 	};
 
@@ -2578,7 +2578,7 @@
 
 	si = (union smb_setfileinfo) {
 		.set_secdesc.level = RAW_SFILEINFO_SEC_DESC,
-		.set_secdesc.in.file.handle = handle,
+		.set_secdesc.in.file = {.handle = handle},
 		.set_secdesc.in.secinfo_flags = SECINFO_DACL,
 		.set_secdesc.in.sd = sd,
 	};
@@ -2679,7 +2679,7 @@
 
 	gi = (union smb_fileinfo) {
 		.query_secdesc.level = RAW_FILEINFO_SEC_DESC,
-		.query_secdesc.in.file.handle = handle,
+		.query_secdesc.in.file = {.handle = handle},
 		.query_secdesc.in.secinfo_flags = SECINFO_DACL|SECINFO_OWNER,
 	};
 
@@ -2720,7 +2720,7 @@
 
 	si = (union smb_setfileinfo) {
 		.set_secdesc.level = RAW_SFILEINFO_SEC_DESC,
-		.set_secdesc.in.file.handle = handle,
+		.set_secdesc.in.file = {.handle = handle},
 		.set_secdesc.in.secinfo_flags = SECINFO_DACL,
 		.set_secdesc.in.sd = sd,
 	};
@@ -2820,7 +2820,7 @@
 
 	gi = (union smb_fileinfo) {
 		.query_secdesc.level = RAW_FILEINFO_SEC_DESC,
-		.query_secdesc.in.file.handle = handle,
+		.query_secdesc.in.file = {.handle = handle},
 		.query_secdesc.in.secinfo_flags = SECINFO_DACL|SECINFO_OWNER,
 	};
 
@@ -2855,7 +2855,7 @@
 
 	si = (union smb_setfileinfo) {
 		.set_secdesc.level = RAW_SFILEINFO_SEC_DESC,
-		.set_secdesc.in.file.handle = handle,
+		.set_secdesc.in.file = {.handle = handle},
 		.set_secdesc.in.secinfo_flags = SECINFO_DACL,
 		.set_secdesc.in.sd = sd,
 	};
@@ -2963,7 +2963,7 @@
 
 	gi = (union smb_fileinfo) {
 		.query_secdesc.level = RAW_FILEINFO_SEC_DESC,
-		.query_secdesc.in.file.handle = handle,
+		.query_secdesc.in.file = {.handle = handle},
 		.query_secdesc.in.secinfo_flags = SECINFO_DACL|SECINFO_OWNER,
 	};
 
@@ -2985,7 +2985,7 @@
 
 	si = (union smb_setfileinfo) {
 		.set_secdesc.level = RAW_SFILEINFO_SEC_DESC,
-		.set_secdesc.in.file.handle = handle,
+		.set_secdesc.in.file = {.handle = handle},
 		.set_secdesc.in.secinfo_flags = SECINFO_DACL,
 		.set_secdesc.in.sd = sd,
 	};
