[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Thu Jun 4 18:37:07 UTC 2020
The branch, master has been updated
via 6f1db2d19e7 libsmb: Remove unused cli_smb2_qfileinfo_basic()
via f619c611d51 libsmb: Use cli_qfileinfo_basic() in cli_smb2_qpathinfo2()
via 8a3556d0cf9 torture3: Fix a debug message
via cedbe17c99b libsmb: Remove unused cli_smb2_getattrE()
via ba8ba8830da libsmb: Use cli_qfileinfo_basic() in cli_smb2_getatr()
via ee40012f6ed pylibsmb: Use cli_qfileinfo_basic_send() in py_smb_filesize()
via 34e2881b0aa libsmb: Make qfileinfo_basic available for smb2 in async mode
via 068c7f4d67e libsmb: Remove unused sync version of cli_getattrE()
via 29866ad7b26 libsmb: Remove cli_getattrE() fallback from cli_qfileinfo_basic() users
via 1a14d8cf7ec libsmb: Use SMBgetattrE in cli_qfileinfo_basic_send() if necessary
via c90d3df41b5 net: Align integer types, move variable closer to its use
via b56cc5bf09e net: Copy hires timestamps in net_copy_fileattr()
via bc7fc08f173 torture3: Use cli_qfileinfo_basic() in run_posix_append()
via 4d1a84b39e6 libsmb: Add async cli_qfileinfo_basic
via f607172e7ae s3: client. Move to all 32-bit attributes in smbclient.
via c7e3a003967 s3: torture: Add simple tests to samba3.base.attr to check INVALID_PARAMETER returned on SMB1 out-of-range attribute use.
via 199a7343eea s3: libsmb: cli_setatr() and async version. Don't allow attribtes > 16 bits on an old protocol send.
via 7c3f3add325 s3: libsmb: cli_unlink() and async version. Don't allow attribtes > 16 bits on an old protocol send.
via 2eb1a7f1e78 s3: libsmb: Change cli_unlink() and async version to take a uint32_t attribute.
via 98d5efd3fd6 s3: libsmb: Change cli_setfileinfo_ext() and async version to take a uint32_t attr.
via 39b42f04d6a s3: libsmb: Change cli_setpathinfo_ext() to take 32-bit attributes.
via 8ad8a8f7ae5 s3: libsmb: Change cli_setatr() and async version to use 32-bit attributes.
via fe3879b3c92 s3: libsmb: Make cli_list_trans() and cli_list take a 32-bit attribute.
via 8ae2851ebc9 s3: libsmb: Make cli_list_old() take 32-bit attribute.
via 2d6b1ef790d s3: libsmb: Change cli_smb2_setatr() to use 32-bit attributes.
via 30b3475f4ae s3: Fix dfs-reparse testing code to use 32-bit attributes. Change variable names mode -> attr.
via 83493d47a69 s3: libsmb: Change cli_qpathinfo1() and async version to return a 32-bit attribute.
via e527ccd29c1 s3: libsmb: Change cli_qpathinfo3() to return a 32-bit attribute.
via 3849ceaa699 s3: libsmb: Change cli_qpathinfo2() and async versions to return a 32-bit attribute.
via ad5d5d94a3f s3: libsmb: Change cli_getatr() and async versions to return a 32-bit attribute.
via 2f1fbb678b7 s3: libsmb: Rename uint16_t attr -> sattr (short attributes).
via e2726bed8d9 s3: libsmb: Change cli_getattrE() and async versions to return a 32-bit attribute.
via b34107f98ca s3: libsmb: Change cli_qfileinfo_basic() to return 32-bit attributes.
via d29884e7787 s3: libsmb: Change cli_smb2_qpathinfo2() to return a 32 bit attribute.
via 808d873c0f4 s3: libsmb: Fix cli_smb2_getatr() to return a 32 bit attribute.
via 9305039f5f3 s3: libsmb: Change cli_smb2_getattrE() to return 32 bit attributes.
via 054ff63a249 s3: libsmb: Change cli_smb2_qfileinfo_basic() and all users to return a uint32_t attribute.
via bac7442a6e8 s3: smbclient: Rename mode parameter to attr.
via 62389689918 s3: libsmb: clifile.c: Rename all uint16_t *attr parameters to uint16_t *pattr.
via 60758ca42e3 s3: libsmb: clirap. Rename all mode/ *mode parameters to attr and pattr.
via 97fa1bc9b5e s3: libsmb: cli_smb2_qfileinfo_basic()/cli_smb2_qpathinfo2(). Rename a parameter from mode -> pattr.
via 8db68d7417e s3: libsmb: Change size of finfo->attr to uint32_t.
via a5f5cbc25ee s3: libsmb: SMBC_chmod_ctx(), rename mode -> attr when setting attributes.
via ab59d5b5965 s3: libsmb: Internally rename to use the name attr instead of mode for attributes.
via 14894dce29d s3: libsmb: Internally rename to use the name attr instead of mode for attributes.
via 8db0ba666ab s3: libsmb: In struct file_info rename mode -> attr.
via 469aaaea076 examples: clifuse: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.
from 887b09f1755 Update SECURITY.md to point to security releases
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 6f1db2d19e751e726f029b9df3bdee558a0b5c24
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 4 15:29:48 2020 +0200
libsmb: Remove unused cli_smb2_qfileinfo_basic()
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Jun 4 18:36:17 UTC 2020 on sn-devel-184
commit f619c611d51ae958eea54fb420bdda4075920244
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 4 15:26:31 2020 +0200
libsmb: Use cli_qfileinfo_basic() in cli_smb2_qpathinfo2()
Last user of cli_smb2_qfileinfo_basic().
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 8a3556d0cf9e2c229df1417a5c39d8d222c4de5f
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 4 15:25:14 2020 +0200
torture3: Fix a debug message
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit cedbe17c99b0fba7f378d6903cb3aed0177ce8e7
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 4 15:23:45 2020 +0200
libsmb: Remove unused cli_smb2_getattrE()
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit ba8ba8830daa30e3e592f91e2c7cb7d3ac304927
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 4 15:22:04 2020 +0200
libsmb: Use cli_qfileinfo_basic() in cli_smb2_getatr()
This was the only remaining user of cli_smb2_getattrE(), and as
cli_qfileinfo_basic() now does all protocols, we can get rid of
cli_smb2_getattrE().
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit ee40012f6edd0eee0bf2c5f318dc8cebb75eb5df
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 4 15:16:26 2020 +0200
pylibsmb: Use cli_qfileinfo_basic_send() in py_smb_filesize()
This now does all protocols asynchronously
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 34e2881b0aae585b95170933002b1df76bb77f41
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 4 15:11:24 2020 +0200
libsmb: Make qfileinfo_basic available for smb2 in async mode
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 068c7f4d67e72e3ee1ba3eb4016ab2f568ba3f2b
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 4 08:45:37 2020 +0200
libsmb: Remove unused sync version of cli_getattrE()
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 29866ad7b26a456ba39aeb171f2025b7ac04a945
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 4 08:43:49 2020 +0200
libsmb: Remove cli_getattrE() fallback from cli_qfileinfo_basic() users
cli_qfileinfo_basic() now takes care of this centrally
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 1a14d8cf7ecac2ff335339739092fa85d654ad41
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jun 4 08:38:31 2020 +0200
libsmb: Use SMBgetattrE in cli_qfileinfo_basic_send() if necessary
This is a behaviour change: Before this patch, independent of the actual
protocol we tried to do the trans2 getinfo call. All the remaining callers just
do a direct fallback to SMBgetattrE when that fails without even looking at the
error code. Here we deterministically decide after the negotiated protocol
which flavour to use without a fallback.
It *might* be relevant for very old embedded systems that we don't know, but if
we break something we can easily fix it.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit c90d3df41b536c09b6e147cef9ce30099d4455d4
Author: Volker Lendecke <vl at samba.org>
Date: Tue Jun 2 15:44:12 2020 +0200
net: Align integer types, move variable closer to its use
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit b56cc5bf09ec09e5d6059bbab7d2f0d3d6f02e99
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jun 3 17:56:53 2020 +0200
net: Copy hires timestamps in net_copy_fileattr()
In this routine we're using cli_ntcreate, so I would assume the hires
timestamp calls to be available. My goal is to reduce the use of the
second-resolution calls and potentially push their fallback use into
clifile.c.
Only tested manually.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit bc7fc08f17388cd731e3fc25510a0fead7ca589f
Author: Volker Lendecke <vl at samba.org>
Date: Thu May 28 18:56:22 2020 +0200
torture3: Use cli_qfileinfo_basic() in run_posix_append()
Only Samba does the SMB1 posix extensions, and we do the "advanced"
trans-based call.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 4d1a84b39e6ac4031c806c729a36203394eca249
Author: Volker Lendecke <vl at samba.org>
Date: Thu May 28 18:24:17 2020 +0200
libsmb: Add async cli_qfileinfo_basic
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit f607172e7aeae050fe92ab9b58b30557cdf18fe8
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 14:25:50 2020 -0700
s3: client. Move to all 32-bit attributes in smbclient.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit c7e3a003967ba50e2eeb311fd5e8ac5f641064c4
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 21:23:21 2020 -0700
s3: torture: Add simple tests to samba3.base.attr to check INVALID_PARAMETER returned on SMB1 out-of-range attribute use.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 199a7343eea93eee6682a188d43523b9a325ec33
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 21:11:25 2020 -0700
s3: libsmb: cli_setatr() and async version. Don't allow attribtes > 16 bits on an old protocol send.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 7c3f3add3250e4ec9c9a39aefc1932b6172b04b3
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 21:07:33 2020 -0700
s3: libsmb: cli_unlink() and async version. Don't allow attribtes > 16 bits on an old protocol send.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 2eb1a7f1e781bbd4b5e83ef4d69114f1c8ea4077
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 21:03:39 2020 -0700
s3: libsmb: Change cli_unlink() and async version to take a uint32_t attribute.
Fix the callers.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 98d5efd3fd67bc48a74705ae7eaee971d63bd7aa
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 20:58:06 2020 -0700
s3: libsmb: Change cli_setfileinfo_ext() and async version to take a uint32_t attr.
Fix all callers.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 39b42f04d6ae828a1814273a0d6b24dbb143db10
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 20:48:23 2020 -0700
s3: libsmb: Change cli_setpathinfo_ext() to take 32-bit attributes.
Fix the callers. Note the special casing of mapping (uint16)-1 -> (uint32_t)-1
in SMBC_setatr() where we can't change the ABI.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 8ad8a8f7ae5b727126d64587cbd859e2c27055d3
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 14:12:38 2020 -0700
s3: libsmb: Change cli_setatr() and async version to use 32-bit attributes.
Fix the callers. Only sets 16 bits on the wire for this level.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit fe3879b3c92b0c82c469bb00d916e3840eb7b8e9
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 14:07:21 2020 -0700
s3: libsmb: Make cli_list_trans() and cli_list take a 32-bit attribute.
All sub-functions take 32-bits, and all callers now are
compatible with 32-bit attributes.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 8ae2851ebc91df7dded6be6a726bc809e86cc511
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:56:37 2020 -0700
s3: libsmb: Make cli_list_old() take 32-bit attribute.
Only uses 16 on the wire. No change needed in callers.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 2d6b1ef790d0e594050e0a02c48dd0faf3693c3b
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:50:57 2020 -0700
s3: libsmb: Change cli_smb2_setatr() to use 32-bit attributes.
The SMB_SET_FILE_BASIC_INFO info level this uses in SMB2
sets 32-bit attributes, so don't use SSVAL, use SIVAL.
No change needed in callers as implicit casts work fine.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 30b3475f4aeed3da8795690ed2fd1d67a59f1de7
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:44:55 2020 -0700
s3: Fix dfs-reparse testing code to use 32-bit attributes. Change variable names mode -> attr.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 83493d47a69286af531f5adb4c3d9526f5350f70
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:42:58 2020 -0700
s3: libsmb: Change cli_qpathinfo1() and async version to return a 32-bit attribute.
Only used in torture.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit e527ccd29c11c0597a4c04b636186d485deadfd5
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:36:05 2020 -0700
s3: libsmb: Change cli_qpathinfo3() to return a 32-bit attribute.
Fix all callers.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 3849ceaa699e0be16cb3c84955eeb39ecdad682e
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:28:04 2020 -0700
s3: libsmb: Change cli_qpathinfo2() and async versions to return a 32-bit attribute.
Fix all callers.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit ad5d5d94a3ff185e61ec1ca7d405aa2845653992
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:15:17 2020 -0700
s3: libsmb: Change cli_getatr() and async versions to return a 32-bit attribute.
Fix all callers.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 2f1fbb678b7cdd77cbd7d8c68df0b71752b07e46
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:09:43 2020 -0700
s3: libsmb: Rename uint16_t attr -> sattr (short attributes).
This will make it easier to add 32-bit attr value later.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit e2726bed8d9e020174401503124c7a2ae309866e
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:00:56 2020 -0700
s3: libsmb: Change cli_getattrE() and async versions to return a 32-bit attribute.
Fix all callers.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit b34107f98cae1807b0dcacab9788d14e98c4f95d
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 12:54:10 2020 -0700
s3: libsmb: Change cli_qfileinfo_basic() to return 32-bit attributes.
Fix all callers.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit d29884e778733786e572811380349589f5e9afc0
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 12:17:30 2020 -0700
s3: libsmb: Change cli_smb2_qpathinfo2() to return a 32 bit attribute.
Fix all callers. All libsmb SMB2 calls now return 32 bit attributes.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 808d873c0f429ac70e7071fa92c63d5751af0fc4
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 12:13:33 2020 -0700
s3: libsmb: Fix cli_smb2_getatr() to return a 32 bit attribute.
Fix all callers.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 9305039f5f300c4d43c92bac976661304e42ab4b
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 12:07:05 2020 -0700
s3: libsmb: Change cli_smb2_getattrE() to return 32 bit attributes.
Fix all callers.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 054ff63a249c304b452fc555951a5276a0946489
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 11:57:39 2020 -0700
s3: libsmb: Change cli_smb2_qfileinfo_basic() and all users to return a uint32_t attribute.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit bac7442a6e8d40e6ef84af5207e0b5fef7fe3fe9
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:32:55 2020 -0700
s3: smbclient: Rename mode parameter to attr.
This is a DOS attribute, not a UNIX mode.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 62389689918c6cbddaea2c0f095112131becd3fd
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 12:03:38 2020 -0700
s3: libsmb: clifile.c: Rename all uint16_t *attr parameters to uint16_t *pattr.
Will make it easier to move to 32 bit attributes later.
No logic changes, just a rename.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 60758ca42e3ce945e9471318b739ffa8bcefc01b
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 11:01:36 2020 -0700
s3: libsmb: clirap. Rename all mode/ *mode parameters to attr and pattr.
They are attributes, not unix modes.
Once they have the right name, we can start moving all uses to uint32_t.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 97fa1bc9b5e393299d21614773c4c0599e742f09
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 10:52:49 2020 -0700
s3: libsmb: cli_smb2_qfileinfo_basic()/cli_smb2_qpathinfo2(). Rename a parameter from mode -> pattr.
Also rename attr pointers to pattr.
They are pointers to attributes.
Only parameter name changes, no logic changes.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 8db68d7417eb33b2954ad4d43846208d19034c28
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 10:48:10 2020 -0700
s3: libsmb: Change size of finfo->attr to uint32_t.
That's what modern servers return.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit a5f5cbc25ee63ba5a0204dc23b249b4479d35de5
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 21:15:43 2020 -0700
s3: libsmb: SMBC_chmod_ctx(), rename mode -> attr when setting attributes.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit ab59d5b5965b84b1964c571919b740e693bd1022
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 13:07:41 2020 -0700
s3: libsmb: Internally rename to use the name attr instead of mode for attributes.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 14894dce29d532b1a3281d7f71f04ac49b48b7e0
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 12:46:26 2020 -0700
s3: libsmb: Internally rename to use the name attr instead of mode for attributes.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 8db0ba666ab10fa8f5a2de1778ee197b083ce29e
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 10:41:27 2020 -0700
s3: libsmb: In struct file_info rename mode -> attr.
Cleanup. It's never been a UNIX mode, always a DOS attribute field.
Make that explicit.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 469aaaea076679f296ed4eca276e7b1c76a1395b
Author: Jeremy Allison <jra at samba.org>
Date: Wed Jun 3 10:29:24 2020 -0700
examples: clifuse: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.
Cast to a uint16_t for now after pulling the information
as finfo->mode is currently only 16 bits.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
-----------------------------------------------------------------------
Summary of changes:
examples/fuse/clifuse.c | 6 +-
libgpo/gpo_filesync.c | 2 +-
source3/client/client.c | 109 +++++----
source3/client/client_proto.h | 4 +-
source3/client/clitar.c | 6 +-
source3/include/client.h | 2 +-
source3/libsmb/cli_smb2_fnum.c | 193 +++-------------
source3/libsmb/cli_smb2_fnum.h | 24 +-
source3/libsmb/clifile.c | 111 +++-------
source3/libsmb/clilist.c | 25 +--
source3/libsmb/clirap.c | 366 +++++++++++++++++++++++++------
source3/libsmb/clirap.h | 47 ++--
source3/libsmb/libsmb_dir.c | 18 +-
source3/libsmb/libsmb_file.c | 47 ++--
source3/libsmb/libsmb_stat.c | 34 ++-
source3/libsmb/proto.h | 29 +--
source3/libsmb/pylibsmb.c | 32 +--
source3/torture/nbio.c | 2 +-
source3/torture/test_posix_append.c | 6 +-
source3/torture/test_readdir_timestamp.c | 2 +-
source3/torture/test_smb2.c | 2 +-
source3/torture/torture.c | 53 +++--
source3/utils/net_rpc.c | 2 +-
source3/utils/net_rpc_printer.c | 50 +++--
24 files changed, 612 insertions(+), 560 deletions(-)
Changeset truncated at 500 lines:
diff --git a/examples/fuse/clifuse.c b/examples/fuse/clifuse.c
index 954c412f09c..f75a9f5a2d7 100644
--- a/examples/fuse/clifuse.c
+++ b/examples/fuse/clifuse.c
@@ -496,7 +496,7 @@ static NTSTATUS parse_finfo_id_both_directory_info(uint8_t *dir_data,
finfo->mtime_ts = interpret_long_date((const char *)dir_data + 24);
finfo->ctime_ts = interpret_long_date((const char *)dir_data + 32);
finfo->size = IVAL2_TO_SMB_BIG_UINT(dir_data + 40, 0);
- finfo->mode = CVAL(dir_data + 56, 0);
+ finfo->attr = IVAL(dir_data + 56, 0);
namelen = IVAL(dir_data + 60,0);
if (namelen > (dir_data_length - 104)) {
return NT_STATUS_INFO_LENGTH_MISMATCH;
@@ -572,10 +572,10 @@ static void cli_smb2_listdir_done(struct tevent_req *subreq)
return;
}
- ok = dir_check_ftype(finfo->mode, state->attribute);
+ ok = dir_check_ftype(finfo->attr, state->attribute);
DEBUG(10, ("%s: dir_check_ftype(%u,%u) returned %u\n",
- __func__, (unsigned)finfo->mode,
+ __func__, (unsigned)finfo->attr,
(unsigned)state->attribute, (unsigned)ok));
if (ok) {
diff --git a/libgpo/gpo_filesync.c b/libgpo/gpo_filesync.c
index b19a9e746bf..28637619226 100644
--- a/libgpo/gpo_filesync.c
+++ b/libgpo/gpo_filesync.c
@@ -155,7 +155,7 @@ static NTSTATUS gpo_sync_func(const char *mnt,
DEBUG(5,("gpo_sync_func: got mask: [%s], name: [%s]\n",
mask, info->name));
- if (info->mode & FILE_ATTRIBUTE_DIRECTORY) {
+ if (info->attr & FILE_ATTRIBUTE_DIRECTORY) {
DEBUG(3,("got dir: [%s]\n", info->name));
diff --git a/source3/client/client.c b/source3/client/client.c
index 2a95911f54d..bcf4762699d 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -537,7 +537,7 @@ static bool do_this_one(struct file_info *finfo)
return false;
}
- if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) {
+ if (finfo->attr & FILE_ATTRIBUTE_DIRECTORY) {
return true;
}
@@ -552,7 +552,7 @@ static bool do_this_one(struct file_info *finfo)
return false;
}
- if ((archive_level==1 || archive_level==2) && !(finfo->mode & FILE_ATTRIBUTE_ARCHIVE)) {
+ if ((archive_level==1 || archive_level==2) && !(finfo->attr & FILE_ATTRIBUTE_ARCHIVE)) {
DEBUG(3,("archive %s failed\n", finfo->name));
return false;
}
@@ -579,7 +579,7 @@ static NTSTATUS display_finfo(struct cli_state *cli_state, struct file_info *fin
if (!showacls) {
d_printf(" %-30s%7.7s %8.0f %s",
finfo->name,
- attrib_string(talloc_tos(), finfo->mode),
+ attrib_string(talloc_tos(), finfo->attr),
(double)finfo->size,
time_to_asc(t));
dir_total += finfo->size;
@@ -601,7 +601,7 @@ static NTSTATUS display_finfo(struct cli_state *cli_state, struct file_info *fin
}
/* print file meta date header */
d_printf( "FILENAME:%s\n", finfo->name);
- d_printf( "MODE:%s\n", attrib_string(talloc_tos(), finfo->mode));
+ d_printf( "MODE:%s\n", attrib_string(talloc_tos(), finfo->attr));
d_printf( "SIZE:%.0f\n", (double)finfo->size);
d_printf( "MTIME:%s", time_to_asc(t));
status = cli_ntcreate(
@@ -793,7 +793,7 @@ static NTSTATUS do_list_helper(const char *mntpoint, struct file_info *f,
*dir_end = '\0';
}
- if (f->mode & FILE_ATTRIBUTE_DIRECTORY) {
+ if (f->attr & FILE_ATTRIBUTE_DIRECTORY) {
if (do_list_dirs && do_this_one(f)) {
status = do_list_fn(cli_state, f, dir);
if (!NT_STATUS_IS_OK(status)) {
@@ -854,7 +854,7 @@ static NTSTATUS do_list_helper(const char *mntpoint, struct file_info *f,
****************************************************************************/
NTSTATUS do_list(const char *mask,
- uint16_t attribute,
+ uint32_t attribute,
NTSTATUS (*fn)(struct cli_state *cli_state, struct file_info *,
const char *dir),
bool rec,
@@ -971,7 +971,7 @@ NTSTATUS do_list(const char *mask,
static int cmd_dir(void)
{
TALLOC_CTX *ctx = talloc_tos();
- uint16_t attribute = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
+ uint32_t attribute = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
char *mask = NULL;
char *buf = NULL;
int rc = 1;
@@ -1026,7 +1026,7 @@ static int cmd_dir(void)
static int cmd_du(void)
{
TALLOC_CTX *ctx = talloc_tos();
- uint16_t attribute = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
+ uint32_t attribute = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
char *mask = NULL;
char *buf = NULL;
NTSTATUS status;
@@ -1121,7 +1121,7 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
uint16_t fnum;
bool newhandle = false;
struct timespec tp_start;
- uint16_t attr;
+ uint32_t attr;
off_t size;
off_t start = 0;
off_t nread = 0;
@@ -1186,15 +1186,11 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
status = cli_qfileinfo_basic(targetcli, fnum, &attr, &size, NULL, NULL,
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
- status = cli_getattrE(targetcli, fnum, &attr, &size, NULL, NULL,
- NULL);
- if(!NT_STATUS_IS_OK(status)) {
- d_printf("getattrib: %s\n", nt_errstr(status));
- if (newhandle) {
- close(handle);
- }
- return 1;
+ d_printf("getattrib: %s\n", nt_errstr(status));
+ if (newhandle) {
+ close(handle);
}
+ return 1;
}
DEBUG(1,("getting file %s of size %.0f as %s ",
@@ -1223,7 +1219,7 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
}
if (archive_level >= 2 && (attr & FILE_ATTRIBUTE_ARCHIVE)) {
- cli_setatr(cli, rname, attr & ~(uint16_t)FILE_ATTRIBUTE_ARCHIVE, 0);
+ cli_setatr(cli, rname, attr & ~(uint32_t)FILE_ATTRIBUTE_ARCHIVE, 0);
}
{
@@ -1308,7 +1304,7 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo,
return NT_STATUS_UNSUCCESSFUL;
}
- if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) {
+ if (finfo->attr & FILE_ATTRIBUTE_DIRECTORY) {
if (asprintf(&quest,
"Get directory %s? ",finfo->name) < 0) {
return NT_STATUS_NO_MEMORY;
@@ -1326,7 +1322,7 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo,
}
SAFE_FREE(quest);
- if (!(finfo->mode & FILE_ATTRIBUTE_DIRECTORY)) {
+ if (!(finfo->attr & FILE_ATTRIBUTE_DIRECTORY)) {
rname = talloc_asprintf(ctx,
"%s%s",
client_get_cur_dir(),
@@ -1496,7 +1492,7 @@ static int cmd_more(void)
static int cmd_mget(void)
{
TALLOC_CTX *ctx = talloc_tos();
- uint16_t attribute = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
+ uint32_t attribute = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
char *mget_mask = NULL;
char *buf = NULL;
NTSTATUS status = NT_STATUS_OK;
@@ -1727,49 +1723,49 @@ static int cmd_altname(void)
return 0;
}
-static char *attr_str(TALLOC_CTX *mem_ctx, uint16_t mode)
+static char *attr_str(TALLOC_CTX *mem_ctx, uint32_t attr)
{
char *attrs = talloc_zero_array(mem_ctx, char, 17);
int i = 0;
- if (!(mode & FILE_ATTRIBUTE_NORMAL)) {
- if (mode & FILE_ATTRIBUTE_ENCRYPTED) {
+ if (!(attr & FILE_ATTRIBUTE_NORMAL)) {
+ if (attr & FILE_ATTRIBUTE_ENCRYPTED) {
attrs[i++] = 'E';
}
- if (mode & FILE_ATTRIBUTE_NONINDEXED) {
+ if (attr & FILE_ATTRIBUTE_NONINDEXED) {
attrs[i++] = 'N';
}
- if (mode & FILE_ATTRIBUTE_OFFLINE) {
+ if (attr & FILE_ATTRIBUTE_OFFLINE) {
attrs[i++] = 'O';
}
- if (mode & FILE_ATTRIBUTE_COMPRESSED) {
+ if (attr & FILE_ATTRIBUTE_COMPRESSED) {
attrs[i++] = 'C';
}
- if (mode & FILE_ATTRIBUTE_REPARSE_POINT) {
+ if (attr & FILE_ATTRIBUTE_REPARSE_POINT) {
attrs[i++] = 'r';
}
- if (mode & FILE_ATTRIBUTE_SPARSE) {
+ if (attr & FILE_ATTRIBUTE_SPARSE) {
attrs[i++] = 's';
}
- if (mode & FILE_ATTRIBUTE_TEMPORARY) {
+ if (attr & FILE_ATTRIBUTE_TEMPORARY) {
attrs[i++] = 'T';
}
- if (mode & FILE_ATTRIBUTE_NORMAL) {
+ if (attr & FILE_ATTRIBUTE_NORMAL) {
attrs[i++] = 'N';
}
- if (mode & FILE_ATTRIBUTE_READONLY) {
+ if (attr & FILE_ATTRIBUTE_READONLY) {
attrs[i++] = 'R';
}
- if (mode & FILE_ATTRIBUTE_HIDDEN) {
+ if (attr & FILE_ATTRIBUTE_HIDDEN) {
attrs[i++] = 'H';
}
- if (mode & FILE_ATTRIBUTE_SYSTEM) {
+ if (attr & FILE_ATTRIBUTE_SYSTEM) {
attrs[i++] = 'S';
}
- if (mode & FILE_ATTRIBUTE_DIRECTORY) {
+ if (attr & FILE_ATTRIBUTE_DIRECTORY) {
attrs[i++] = 'D';
}
- if (mode & FILE_ATTRIBUTE_ARCHIVE) {
+ if (attr & FILE_ATTRIBUTE_ARCHIVE) {
attrs[i++] = 'A';
}
}
@@ -1785,7 +1781,7 @@ static int do_allinfo(const char *name)
fstring altname;
struct timespec b_time, a_time, m_time, c_time;
off_t size;
- uint16_t mode;
+ uint32_t attr;
NTTIME tmp;
uint16_t fnum;
unsigned int num_streams;
@@ -1813,7 +1809,7 @@ static int do_allinfo(const char *name)
d_printf("altname: %s\n", altname);
status = cli_qpathinfo3(cli, name, &b_time, &a_time, &m_time, &c_time,
- &size, &mode, NULL);
+ &size, &attr, NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("%s getting pathinfo for %s\n", nt_errstr(status),
name);
@@ -1832,7 +1828,7 @@ static int do_allinfo(const char *name)
tmp = full_timespec_to_nt_time(&c_time);
d_printf("change_time: %s\n", nt_time_string(talloc_tos(), tmp));
- d_printf("attributes: %s (%x)\n", attr_str(talloc_tos(), mode), mode);
+ d_printf("attributes: %s (%x)\n", attr_str(talloc_tos(), attr), attr);
status = cli_qpathinfo_streams(cli, name, talloc_tos(), &num_streams,
&streams);
@@ -1847,7 +1843,7 @@ static int do_allinfo(const char *name)
(unsigned long long)streams[i].size);
}
- if (mode & FILE_ATTRIBUTE_REPARSE_POINT) {
+ if (attr & FILE_ATTRIBUTE_REPARSE_POINT) {
char *subst, *print;
uint32_t flags;
@@ -1994,11 +1990,7 @@ static int do_put(const char *rname, const char *lname, bool reput)
if (!NT_STATUS_IS_OK(status = cli_qfileinfo_basic(
targetcli, fnum, NULL,
&start, NULL, NULL,
- NULL, NULL, NULL)) &&
- !NT_STATUS_IS_OK(status = cli_getattrE(
- targetcli, fnum, NULL,
- &start, NULL, NULL,
- NULL))) {
+ NULL, NULL, NULL))) {
d_printf("getattrib: %s\n", nt_errstr(status));
return 1;
}
@@ -2511,7 +2503,7 @@ static NTSTATUS do_del(struct cli_state *cli_state, struct file_info *finfo,
return NT_STATUS_NO_MEMORY;
}
- if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) {
+ if (finfo->attr & FILE_ATTRIBUTE_DIRECTORY) {
TALLOC_FREE(mask);
return NT_STATUS_OK;
}
@@ -2535,7 +2527,7 @@ static int cmd_del(void)
char *mask = NULL;
char *buf = NULL;
NTSTATUS status = NT_STATUS_OK;
- uint16_t attribute = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
+ uint32_t attribute = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
if (recurse) {
attribute |= FILE_ATTRIBUTE_DIRECTORY;
@@ -2641,7 +2633,7 @@ static NTSTATUS do_deltree_list(struct cli_state *cli_state,
return NT_STATUS_NO_MEMORY;
}
- if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) {
+ if (finfo->attr & FILE_ATTRIBUTE_DIRECTORY) {
dt->isdir = true;
}
@@ -2656,7 +2648,7 @@ static int cmd_deltree(void)
NTSTATUS status = NT_STATUS_OK;
struct file_list *deltree_list_norecurse = NULL;
struct file_list *deltree_list_iter = NULL;
- uint16_t attribute = FILE_ATTRIBUTE_SYSTEM |
+ uint32_t attribute = FILE_ATTRIBUTE_SYSTEM |
FILE_ATTRIBUTE_HIDDEN |
FILE_ATTRIBUTE_DIRECTORY;
bool ok;
@@ -2755,7 +2747,7 @@ static int cmd_wdel(void)
TALLOC_CTX *ctx = talloc_tos();
char *mask = NULL;
char *buf = NULL;
- uint16_t attribute;
+ uint32_t attribute;
struct cli_state *targetcli;
char *targetname = NULL;
NTSTATUS status;
@@ -2765,7 +2757,7 @@ static int cmd_wdel(void)
return 1;
}
- attribute = (uint16_t)strtol(buf, (char **)NULL, 16);
+ attribute = (uint32_t)strtol(buf, (char **)NULL, 16);
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("wdel 0x<attrib> <wcard>\n");
@@ -5282,7 +5274,8 @@ static int cmd_utimes(void)
timespec_string_buf(×[3], false, &tbuf[3])));
status = cli_setpathinfo_ext(
- cli, fname, times[0], times[1], times[2], times[3], -1);
+ cli, fname, times[0], times[1], times[2], times[3],
+ (uint32_t)-1);
if (!NT_STATUS_IS_OK(status)) {
d_printf("cli_setpathinfo_ext failed: %s\n",
nt_errstr(status));
@@ -5302,10 +5295,10 @@ out:
*
* Update the file attributes with the one provided.
*/
-int set_remote_attr(const char *filename, uint16_t new_attr, int mode)
+int set_remote_attr(const char *filename, uint32_t new_attr, int mode)
{
extern struct cli_state *cli;
- uint16_t old_attr;
+ uint32_t old_attr;
NTSTATUS status;
status = cli_getatr(cli, filename, &old_attr, NULL, NULL);
@@ -5339,7 +5332,7 @@ int cmd_setmode(void)
{
char *buf;
char *fname = NULL;
- uint16_t attr[2] = {0};
+ uint32_t attr[2] = {0};
int mode = ATTR_SET;
int err = 0;
bool ok;
@@ -5771,7 +5764,7 @@ static NTSTATUS completion_remote_filter(const char *mnt,
return NT_STATUS_OK;
}
- if ((info->dirmask[0] == 0) && !(f->mode & FILE_ATTRIBUTE_DIRECTORY))
+ if ((info->dirmask[0] == 0) && !(f->attr & FILE_ATTRIBUTE_DIRECTORY))
info->matches[info->count] = SMB_STRDUP(f->name);
else {
TALLOC_CTX *ctx = talloc_stackframe();
@@ -5787,7 +5780,7 @@ static NTSTATUS completion_remote_filter(const char *mnt,
TALLOC_FREE(ctx);
return NT_STATUS_NO_MEMORY;
}
- if (f->mode & FILE_ATTRIBUTE_DIRECTORY) {
+ if (f->attr & FILE_ATTRIBUTE_DIRECTORY) {
tmp = talloc_asprintf_append(tmp, "%s",
CLI_DIRSEP_STR);
}
@@ -5801,7 +5794,7 @@ static NTSTATUS completion_remote_filter(const char *mnt,
if (info->matches[info->count] == NULL) {
return NT_STATUS_OK;
}
- if (f->mode & FILE_ATTRIBUTE_DIRECTORY) {
+ if (f->attr & FILE_ATTRIBUTE_DIRECTORY) {
smb_readline_ca_char(0);
}
if (info->count == 1) {
diff --git a/source3/client/client_proto.h b/source3/client/client_proto.h
index 38f13aa0adc..0c83ba9d731 100644
--- a/source3/client/client_proto.h
+++ b/source3/client/client_proto.h
@@ -37,12 +37,12 @@ const char *client_get_cur_dir(void);
const char *client_set_cur_dir(const char *newdir);
char *client_clean_name(TALLOC_CTX *ctx, const char *name);
NTSTATUS do_list(const char *mask,
- uint16_t attribute,
+ uint32_t attribute,
NTSTATUS (*fn)(struct cli_state *cli_state, struct file_info *,
const char *dir),
bool rec,
bool dirs);
-int set_remote_attr(const char *filename, uint16_t new_attr, int mode);
+int set_remote_attr(const char *filename, uint32_t new_attr, int mode);
int cmd_iosize(void);
/* The following definitions come from client/dnsbrowse.c */
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 76596067f2d..3fe3622aba6 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -861,7 +861,7 @@ static NTSTATUS get_file_callback(struct cli_state *cli,
goto out;
}
- isdir = finfo->mode & FILE_ATTRIBUTE_DIRECTORY;
+ isdir = finfo->attr & FILE_ATTRIBUTE_DIRECTORY;
if (isdir) {
old_dir = talloc_strdup(ctx, initial_dir);
new_dir = talloc_asprintf(ctx, "%s\\", remote_name);
@@ -938,7 +938,7 @@ static int tar_get_file(struct tar *t,
uint64_t off = 0;
uint16_t remote_fd = (uint16_t)-1;
int err = 0, r;
- const bool isdir = finfo->mode & FILE_ATTRIBUTE_DIRECTORY;
+ const bool isdir = finfo->attr & FILE_ATTRIBUTE_DIRECTORY;
TALLOC_CTX *ctx = talloc_new(NULL);
if (ctx == NULL) {
@@ -1459,7 +1459,7 @@ static NTSTATUS tar_create_skip_path(struct tar *t,
bool *_skip)
{
/* syntaxic sugar */
- const mode_t mode = finfo->mode;
+ const mode_t mode = finfo->attr;
const bool isdir = mode & FILE_ATTRIBUTE_DIRECTORY;
const bool exclude = t->mode.selection == TAR_EXCLUDE;
bool in = true;
diff --git a/source3/include/client.h b/source3/include/client.h
index fdb5d7da830..6a3b1b02ff3 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -100,7 +100,7 @@ struct cli_state {
struct file_info {
uint64_t size;
uint64_t allocated_size;
- uint16_t mode;
+ uint32_t attr;
uid_t uid;
gid_t gid;
uint64_t ino;
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 46a4ae95977..e5d6e6b7fbd 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -1199,8 +1199,7 @@ static NTSTATUS parse_finfo_id_both_directory_info(const uint8_t *dir_data,
finfo->ctime_ts = interpret_long_date((const char *)dir_data + 32);
finfo->size = IVAL2_TO_SMB_BIG_UINT(dir_data + 40, 0);
finfo->allocated_size = IVAL2_TO_SMB_BIG_UINT(dir_data + 48, 0);
- /* NB. We need to enlarge finfo->mode to be 32-bits. */
- finfo->mode = (uint16_t)IVAL(dir_data + 56, 0);
+ finfo->attr = IVAL(dir_data + 56, 0);
finfo->ino = IVAL2_TO_SMB_BIG_UINT(dir_data + 96, 0);
namelen = IVAL(dir_data + 60,0);
if (namelen > (dir_data_length - 104)) {
@@ -1286,7 +1285,7 @@ static bool windows_parent_dirname(TALLOC_CTX *mem_ctx,
NTSTATUS cli_smb2_list(struct cli_state *cli,
const char *pathname,
- uint16_t attribute,
+ uint32_t attribute,
NTSTATUS (*fn)(const char *,
struct file_info *,
const char *,
@@ -1419,8 +1418,7 @@ NTSTATUS cli_smb2_list(struct cli_state *cli,
goto fail;
}
- if (dir_check_ftype((uint32_t)finfo->mode,
- (uint32_t)attribute)) {
+ if (dir_check_ftype(finfo->attr, attribute)) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list