idl: Add smb3posix.idl
authorVolker Lendecke <vl@samba.org>
Wed, 27 Sep 2023 04:44:41 +0000 (06:44 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 4 Oct 2023 20:31:36 +0000 (20:31 +0000)
Let PIDL take care of encoding SMB2_FILE_POSIX_INFORMATION. This way
we also get parsing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
librpc/idl/smb3posix.idl [new file with mode: 0644]
librpc/idl/wscript_build
librpc/wscript_build
source4/librpc/wscript_build

diff --git a/librpc/idl/smb3posix.idl b/librpc/idl/smb3posix.idl
new file mode 100644 (file)
index 0000000..e759229
--- /dev/null
@@ -0,0 +1,36 @@
+#include "idl_types.h"
+
+/*
+   IDL for smb311 unix structures
+*/
+
+import "security.idl";
+
+[
+  version(0.0),
+  pointer_default(unique)
+]
+interface smb3posix
+{
+       typedef [public,flag(NDR_NOALIGN)] struct {
+               uint32 nlinks;
+               uint32 reparse_tag;
+               uint32 posix_perms;
+               dom_sid owner;
+               dom_sid group;
+       } smb3_posix_cc_info;
+
+       typedef [public,flag(NDR_NOALIGN)] struct {
+               NTTIME creation_time;
+               NTTIME last_access_time;
+               NTTIME last_write_time;
+               NTTIME change_time;
+               hyper end_of_file;
+               hyper allocation_size;
+               uint32 file_attributes;
+               hyper inode;
+               uint32 device;
+               uint32 reserved;
+               smb3_posix_cc_info cc;
+       } smb3_file_posix_information;
+}
index 95f1b340fbd5b3aa27939de24a017d190a97d8ae..1221ef829b99a8bf9400def5e7774c496c738e43 100644 (file)
@@ -141,6 +141,7 @@ bld.SAMBA_PIDL_LIST('PIDL',
                     server_id.idl
                     smb_acl.idl
                     xattr.idl
+                    smb3posix.idl
                     ''',
                     options='--header --ndr-parser --python',
                     output_dir='../gen_ndr')
index 3ba7ce23082814fc1386b7e495f80b7ca4f2f15a..4c0a3e0c6253699ea8be3e732fcac895fbd66efd 100644 (file)
@@ -387,6 +387,11 @@ bld.SAMBA_SUBSYSTEM('NDR_XATTR',
     public_deps='ndr NDR_SECURITY'
     )
 
+bld.SAMBA_SUBSYSTEM('NDR_SMB3POSIX',
+                    source='gen_ndr/ndr_smb3posix.c',
+                    public_deps='ndr',
+                    public_headers='gen_ndr/smb3posix.h')
+
 bld.SAMBA_SUBSYSTEM('NDR_SMB2_LEASE_STRUCT',
     source='gen_ndr/ndr_smb2_lease_struct.c',
     public_deps='ndr',
@@ -606,6 +611,7 @@ bld.SAMBA_LIBRARY('ndr-samba',
     deps='''NDR_DRSBLOBS NDR_DRSUAPI NDR_IDMAP NDR_NTLMSSP NDR_NEGOEX NDR_SCHANNEL NDR_MGMT
     NDR_DNSSERVER NDR_EPMAPPER NDR_XATTR NDR_UNIXINFO NDR_NAMED_PIPE_AUTH
     NDR_NTPRINTING NDR_FSRVP NDR_WITNESS NDR_MDSSVC NDR_OPEN_FILES NDR_SMBXSRV
+    NDR_SMB3POSIX
     NDR_KRB5CCACHE''',
     private_library=True,
     grouping_library=True
index 77997b7751c4e5d275a0bb696e84d166fe8a1125..0d20cbb9349c99a9ba6f0dfa9b20fca5a61de4cc 100644 (file)
@@ -470,6 +470,13 @@ bld.SAMBA_PYTHON('python_dcerpc_xattr',
         cflags_end=gen_cflags
         )
 
+bld.SAMBA_PYTHON('python_dcerpc_smb3posix',
+        source='../../librpc/gen_ndr/py_smb3posix.c',
+        deps='%s %s NDR_SMB3POSIX' % (pytalloc_util, pyrpc_util),
+        realname='samba/dcerpc/smb3posix.so',
+        cflags_end=gen_cflags
+        )
+
 bld.SAMBA_PYTHON('python_dcerpc_idmap',
         source='../../librpc/gen_ndr/py_idmap.c',
         deps='%s %s NDR_IDMAP' % (pytalloc_util, pyrpc_util),