[SCM] Samba Shared Repository - branch v4-11-test updated
Karolin Seeger
kseeger at samba.org
Fri Nov 8 13:53:03 UTC 2019
The branch, v4-11-test has been updated
via ce18ef9e545 lib/adouble: pass filesize to ad_unpack()
via c00a8959b6f lib/adouble: drop ad_data reallocate logic
via 1fa47717494 vfs_fruit: README.Coding fix: multi-line if expression
via d47b2cb8a22 vfs_fruit: fix a long line
via fb118393f39 torture: expand test "vfs.fruit.resource fork IO" to check size
via 8c5e4161fa4 s3:smbd: Fix sync dosmode fallback in async dosmode codepath
via eacdde195ac s3:smbd: Incomplete conversion of former parametric options
via 098ddd6fe4e s3: remove now unneeded call to cmdline_messaging_context()
via ac3cb59fd4f s3:dbwrap: initialize messaging before getting the ctdb connection
from b30b3073f9c libnet_join: add SPNs for additional-dns-hostnames entries
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-11-test
- Log -----------------------------------------------------------------
commit ce18ef9e54530a96d33a4ec842bd599a4a51a7b8
Author: Ralph Boehme <slow at samba.org>
Date: Thu Oct 24 17:15:18 2019 +0200
lib/adouble: pass filesize to ad_unpack()
ad_unpack() needs the filesize, not the capped IO size we're using in the caller
to read up to "size" bystem from the ._ AppleDouble file.
This fixes a regression introduced by bdc257a1cbac7e8c73a084b618ba642476807483
for bug 13968.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14171
RN: vfs_fruit returns capped resource fork length
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Wed Oct 30 14:52:34 UTC 2019 on sn-devel-184
(backported from commit f3df83a2c346d945487a27a9d258ee6331ea7dbb)
Autobuild-User(v4-11-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-11-test): Fri Nov 8 13:52:49 UTC 2019 on sn-devel-184
commit c00a8959b6ff474478a40469cd5ea367c7037be4
Author: Ralph Boehme <slow at samba.org>
Date: Fri Oct 25 15:21:32 2019 +0200
lib/adouble: drop ad_data reallocate logic
Simply set the buffer size to AD_XATTR_MAX_HDR_SIZE. When reading the
AppleDouble file, read up to AD_XATTR_MAX_HDR_SIZE from the file.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14171
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(backported from commit 9a3da6bebcdb924ca2027337544d79ac2088677e)
commit 1fa47717494f63413c1fe6a1e348605bdc2a17f3
Author: Ralph Boehme <slow at samba.org>
Date: Thu Oct 24 17:26:08 2019 +0200
vfs_fruit: README.Coding fix: multi-line if expression
Also remove a TAB.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14171
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(backported from commit baaaf59e948df625b01fa8b6317ab5c3babb4e8f)
commit d47b2cb8a224a7133d47ff0df78abe172480b144
Author: Ralph Boehme <slow at samba.org>
Date: Thu Oct 24 17:17:28 2019 +0200
vfs_fruit: fix a long line
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14171
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(backported from commit f0c8ac47a4608eabeae334d39885aab98198b753)
commit fb118393f39a2111b75180d035d3082334ccf8f3
Author: Ralph Boehme <slow at samba.org>
Date: Fri Oct 25 15:41:40 2019 +0200
torture: expand test "vfs.fruit.resource fork IO" to check size
Reveals a bug where the resource fork size is capped at 65454 bytes.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14171
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit b63069db9fb6efb33b7b917cd5b0ee06b0da9cdc)
commit 8c5e4161fa4e6cf0cfc8e1c45dc09e82de27685d
Author: Ralph Boehme <slow at samba.org>
Date: Mon Aug 5 11:11:14 2019 +0200
s3:smbd: Fix sync dosmode fallback in async dosmode codepath
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14070
RN: Fix sync dosmode fallback in async dosmode codepath
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue Aug 6 15:40:18 UTC 2019 on sn-devel-184
(cherry picked from commit 5d4aa6e867044e6b58b45acde32ac35e1d0a7765)
commit eacdde195ac595bce9b35febb13b9723851fbb41
Author: Ralph Boehme <slow at samba.org>
Date: Mon Aug 5 10:59:22 2019 +0200
s3:smbd: Incomplete conversion of former parametric options
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14069
RN: Incomplete conversion of former parametric options
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(backported from commit ea17bd5539eb0be7a446b99c8b6baa4aa1ab273f)
commit 098ddd6fe4e7d95cba6fa50749479f5243f671e9
Author: Ralph Boehme <slow at samba.org>
Date: Sat May 4 12:12:48 2019 +0200
s3: remove now unneeded call to cmdline_messaging_context()
This was only needed as dbwrap_open() had a bug where it asked for the ctdb
connection before initializing messaging. The previous commit fixed that so we
can now safely remove the calls to cmdline_messaging_context() from all tools
that don't use messaging.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13925
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Oct 24 09:33:47 UTC 2019 on sn-devel-184
(cherry picked from commit 9471508391fd3bcf199b1e94f8d9ee2b956e8f8e)
commit ac3cb59fd4f3736547979a780508c51106b84d8e
Author: Ralph Boehme <slow at samba.org>
Date: Sat May 4 12:12:04 2019 +0200
s3:dbwrap: initialize messaging before getting the ctdb connection
This is a better fix for bug #13465.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13925
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit ca95d7f41b683b4d7ac59ed6ee709d44abfe2019)
-----------------------------------------------------------------------
Summary of changes:
source3/lib/dbwrap/dbwrap_open.c | 8 +++++-
source3/lib/popt_common_cmdline.c | 7 -----
source3/modules/vfs_ceph.c | 2 +-
source3/modules/vfs_fruit.c | 57 ++++++++++++++++++++++-----------------
source3/modules/vfs_glusterfs.c | 2 +-
source3/modules/vfs_gpfs.c | 2 +-
source3/smbd/dosmode.c | 6 ++++-
source3/smbd/reply.c | 4 +--
source3/smbd/trans2.c | 4 +--
source3/utils/dbwrap_tool.c | 2 --
source3/utils/eventlogadm.c | 3 ---
source3/utils/ntlm_auth.c | 2 --
source3/utils/pdbedit.c | 2 --
source3/utils/sharesec.c | 1 -
source3/utils/smbget.c | 2 --
source3/utils/smbpasswd.c | 2 --
source3/utils/testparm.c | 2 --
source4/torture/vfs/fruit.c | 29 ++++++++++++++++++++
18 files changed, 80 insertions(+), 57 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index c8dfd9103a8..20084bca471 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -141,13 +141,19 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
struct messaging_context *msg_ctx;
struct ctdbd_connection *conn;
+ /*
+ * Initialize messaging before getting the ctdb
+ * connection, as the ctdb connection requires messaging
+ * to be initialized.
+ */
+ msg_ctx = global_messaging_context();
+
conn = messaging_ctdb_connection();
if (conn == NULL) {
DBG_WARNING("No ctdb connection\n");
errno = EIO;
return NULL;
}
- msg_ctx = global_messaging_context();
result = db_open_ctdb(mem_ctx, msg_ctx, base,
hash_size,
diff --git a/source3/lib/popt_common_cmdline.c b/source3/lib/popt_common_cmdline.c
index 79e34847f48..39a787510a3 100644
--- a/source3/lib/popt_common_cmdline.c
+++ b/source3/lib/popt_common_cmdline.c
@@ -102,15 +102,8 @@ static void popt_common_credentials_callback(poptContext con,
}
if (reason == POPT_CALLBACK_REASON_POST) {
- struct messaging_context *msg_ctx = NULL;
bool ok;
- msg_ctx = cmdline_messaging_context(get_dyn_CONFIGFILE());
- if (msg_ctx == NULL) {
- fprintf(stderr, "Unable to initialize "
- "messaging context\n");
- }
-
ok = lp_load_client(get_dyn_CONFIGFILE());
if (!ok) {
const char *pname = poptGetInvocationName(con);
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 1b293ddb1b0..28363f003c2 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -146,7 +146,7 @@ static int cephwrap_connect(struct vfs_handle_struct *handle, const char *servi
/*
* Unless we have an async implementation of getxattrat turn this off.
*/
- lp_do_parameter(SNUM(handle->conn), "smbd:async dosmode", "false");
+ lp_do_parameter(SNUM(handle->conn), "smbd async dosmode", "false");
return 0;
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 85c7af21d58..b8ede0cdfdb 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -1664,8 +1664,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle,
struct adouble *ad,
const struct smb_filename *smb_fname)
{
- char *p_ad = NULL;
- size_t size;
+ size_t to_read;
ssize_t len;
int ret;
bool ok;
@@ -1677,35 +1676,26 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle,
return -1;
}
- /*
- * AppleDouble file header content and size, two cases:
- *
- * - without xattrs it is exactly AD_DATASZ_DOT_UND (82) bytes large
- * - with embedded xattrs it can be larger, up to AD_XATTR_MAX_HDR_SIZE
- *
- * Read as much as we can up to AD_XATTR_MAX_HDR_SIZE.
- */
- size = ad->ad_fsp->fsp_name->st.st_ex_size;
- if (size > talloc_array_length(ad->ad_data)) {
- if (size > AD_XATTR_MAX_HDR_SIZE) {
- size = AD_XATTR_MAX_HDR_SIZE;
- }
- p_ad = talloc_realloc(ad, ad->ad_data, char, size);
- if (p_ad == NULL) {
- return -1;
- }
- ad->ad_data = p_ad;
+ to_read = ad->ad_fsp->fsp_name->st.st_ex_size;
+ if (to_read > AD_XATTR_MAX_HDR_SIZE) {
+ to_read = AD_XATTR_MAX_HDR_SIZE;
}
- len = SMB_VFS_NEXT_PREAD(handle, ad->ad_fsp, ad->ad_data, talloc_array_length(ad->ad_data), 0);
- if (len != talloc_array_length(ad->ad_data)) {
+ len = SMB_VFS_NEXT_PREAD(handle,
+ ad->ad_fsp,
+ ad->ad_data,
+ to_read,
+ 0);
+ if (len != to_read) {
DBG_NOTICE("%s %s: bad size: %zd\n",
smb_fname->base_name, strerror(errno), len);
return -1;
}
/* Now parse entries */
- ok = ad_unpack(ad, ADEID_NUM_DOT_UND, size);
+ ok = ad_unpack(ad,
+ ADEID_NUM_DOT_UND,
+ ad->ad_fsp->fsp_name->st.st_ex_size);
if (!ok) {
DBG_ERR("invalid AppleDouble resource %s\n",
smb_fname->base_name);
@@ -1715,7 +1705,8 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle,
if ((ad_getentryoff(ad, ADEID_FINDERI) != ADEDOFF_FINDERI_DOT_UND)
|| (ad_getentrylen(ad, ADEID_FINDERI) < ADEDLEN_FINDERI)
- || (ad_getentryoff(ad, ADEID_RFORK) < ADEDOFF_RFORK_DOT_UND)) {
+ || (ad_getentryoff(ad, ADEID_RFORK) < ADEDOFF_RFORK_DOT_UND))
+ {
DBG_ERR("invalid AppleDouble resource %s\n",
smb_fname->base_name);
errno = EINVAL;
@@ -1795,7 +1786,23 @@ static struct adouble *ad_alloc(TALLOC_CTX *ctx,
adsize = AD_DATASZ_XATTR;
break;
case ADOUBLE_RSRC:
- adsize = AD_DATASZ_DOT_UND;
+ /*
+ * AppleDouble ._ file case, optimize for fewer (but larger)
+ * IOs. Two cases:
+ *
+ * - without xattrs size of the header is exactly
+ * AD_DATASZ_DOT_UND (82) bytes
+ *
+ * - with embedded xattrs it can be larger, up to
+ * AD_XATTR_MAX_HDR_SIZE
+ *
+ * Larger headers are not supported, but this is a reasonable
+ * limit that is also employed by the macOS client.
+ *
+ * We used the largest possible size to be able to read the full
+ * header with one IO.
+ */
+ adsize = AD_XATTR_MAX_HDR_SIZE;
break;
default:
return NULL;
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index afb34b4b47c..8827bf018ab 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -367,7 +367,7 @@ static int vfs_gluster_connect(struct vfs_handle_struct *handle,
/*
* Unless we have an async implementation of getxattrat turn this off.
*/
- lp_do_parameter(SNUM(handle->conn), "smbd:async dosmode", "false");
+ lp_do_parameter(SNUM(handle->conn), "smbd async dosmode", "false");
done:
if (ret < 0) {
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index f0d5074d36b..22848496178 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -2195,7 +2195,7 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle,
* Unless we have an async implementation of get_dos_attributes turn
* this off.
*/
- lp_do_parameter(SNUM(handle->conn), "smbd:async dosmode", "false");
+ lp_do_parameter(SNUM(handle->conn), "smbd async dosmode", "false");
return 0;
}
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index d722c022fe9..bdcdda69ac8 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -917,7 +917,11 @@ static void dos_mode_at_vfs_get_dosmode_done(struct tevent_req *subreq)
return;
}
- smb_path = synthetic_smb_fname(state, path, NULL, NULL, 0);
+ smb_path = synthetic_smb_fname(state,
+ path,
+ NULL,
+ &state->smb_fname->st,
+ 0);
if (tevent_req_nomem(path, req)) {
return;
}
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 35d1ae772d5..65ac729c732 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1386,7 +1386,7 @@ void reply_getatr(struct smb_request *req)
const char *p;
NTSTATUS status;
TALLOC_CTX *ctx = talloc_tos();
- bool ask_sharemode = lp_parm_bool(SNUM(conn), "smbd", "search ask sharemode", true);
+ bool ask_sharemode = lp_smbd_search_ask_sharemode(SNUM(conn));
START_PROFILE(SMBgetatr);
@@ -1769,7 +1769,7 @@ void reply_search(struct smb_request *req)
bool mask_contains_wcard = False;
bool allow_long_path_components = (req->flags2 & FLAGS2_LONG_PATH_COMPONENTS) ? True : False;
TALLOC_CTX *ctx = talloc_tos();
- bool ask_sharemode = lp_parm_bool(SNUM(conn), "smbd", "search ask sharemode", true);
+ bool ask_sharemode = lp_smbd_search_ask_sharemode(SNUM(conn));
struct dptr_struct *dirptr = NULL;
struct smbXsrv_connection *xconn = req->xconn;
struct smbd_server_connection *sconn = req->sconn;
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 0539b35bb73..b0616f15ade 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -2710,7 +2710,7 @@ static void call_trans2findfirst(connection_struct *conn,
bool mask_contains_wcard = False;
struct ea_list *ea_list = NULL;
NTSTATUS ntstatus = NT_STATUS_OK;
- bool ask_sharemode = lp_parm_bool(SNUM(conn), "smbd", "search ask sharemode", true);
+ bool ask_sharemode = lp_smbd_search_ask_sharemode(SNUM(conn));
struct dptr_struct *dirptr = NULL;
struct smbd_server_connection *sconn = req->sconn;
uint32_t ucf_flags = UCF_SAVE_LCOMP | UCF_ALWAYS_ALLOW_WCARD_LCOMP |
@@ -3126,7 +3126,7 @@ static void call_trans2findnext(connection_struct *conn,
int space_remaining;
struct ea_list *ea_list = NULL;
NTSTATUS ntstatus = NT_STATUS_OK;
- bool ask_sharemode = lp_parm_bool(SNUM(conn), "smbd", "search ask sharemode", true);
+ bool ask_sharemode = lp_smbd_search_ask_sharemode(SNUM(conn));
TALLOC_CTX *ctx = talloc_tos();
struct dptr_struct *dirptr;
struct smbd_server_connection *sconn = req->sconn;
diff --git a/source3/utils/dbwrap_tool.c b/source3/utils/dbwrap_tool.c
index 2808a5d68bf..153a4459ee0 100644
--- a/source3/utils/dbwrap_tool.c
+++ b/source3/utils/dbwrap_tool.c
@@ -422,8 +422,6 @@ int main(int argc, const char **argv)
while (extra_argv[extra_argc]) extra_argc++;
}
- cmdline_messaging_context(get_dyn_CONFIGFILE());
-
lp_load_global(get_dyn_CONFIGFILE());
if ((extra_argc < 2) || (extra_argc > 5)) {
diff --git a/source3/utils/eventlogadm.c b/source3/utils/eventlogadm.c
index db874dfae8a..2770fffa48c 100644
--- a/source3/utils/eventlogadm.c
+++ b/source3/utils/eventlogadm.c
@@ -473,9 +473,6 @@ int main( int argc, char *argv[] )
exit( 1 );
}
- cmdline_messaging_context(configfile == NULL ?
- get_dyn_CONFIGFILE() : configfile);
-
if ( configfile == NULL ) {
lp_load_global(get_dyn_CONFIGFILE());
} else if (!lp_load_global(configfile)) {
diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c
index 2be641c891c..87f6554ae4f 100644
--- a/source3/utils/ntlm_auth.c
+++ b/source3/utils/ntlm_auth.c
@@ -2504,8 +2504,6 @@ enum {
poptFreeContext(pc);
- cmdline_messaging_context(get_dyn_CONFIGFILE());
-
if (!lp_load_global(get_dyn_CONFIGFILE())) {
d_fprintf(stderr, "ntlm_auth: error opening config file %s. Error was %s\n",
get_dyn_CONFIGFILE(), strerror(errno));
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index 74f8c3b0b2f..14edbaeceea 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -1128,8 +1128,6 @@ int main(int argc, const char **argv)
if (user_name == NULL)
user_name = poptGetArg(pc);
- cmdline_messaging_context(get_dyn_CONFIGFILE());
-
if (!lp_load_global(get_dyn_CONFIGFILE())) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n", get_dyn_CONFIGFILE());
exit(1);
diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c
index 2ea81b9adfa..10c347eaac3 100644
--- a/source3/utils/sharesec.c
+++ b/source3/utils/sharesec.c
@@ -501,7 +501,6 @@ int main(int argc, const char *argv[])
setlinebuf(stdout);
- cmdline_messaging_context(get_dyn_CONFIGFILE());
lp_load_with_registry_shares(get_dyn_CONFIGFILE());
/* check for initializing secrets.tdb first */
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index 58690be56e3..a948a336445 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -1003,8 +1003,6 @@ int main(int argc, char **argv)
popt_burn_cmdline_password(argc, argv);
- cmdline_messaging_context(get_dyn_CONFIGFILE());
-
if (smbc_init(get_auth_data, opt.debuglevel) < 0) {
fprintf(stderr, "Unable to initialize libsmbclient\n");
return 1;
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 8e2b9d7f80f..a6509abe5cb 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -197,8 +197,6 @@ static int process_options(int argc, char **argv, int local_flags)
usage();
}
- cmdline_messaging_context(configfile);
-
if (!lp_load_global(configfile)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n",
configfile);
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index efa58a6a417..9ba625da4bf 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -742,8 +742,6 @@ static void do_per_share_checks(int s)
goto done;
}
- cmdline_messaging_context(config_file);
-
fprintf(stderr,"Load smb config files from %s\n",config_file);
if (!lp_load_with_registry_shares(config_file)) {
diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c
index e3d8539595d..0dedb92579f 100644
--- a/source4/torture/vfs/fruit.c
+++ b/source4/torture/vfs/fruit.c
@@ -2397,6 +2397,35 @@ static bool test_write_atalk_rfork_io(struct torture_context *tctx,
fname, AFPRESOURCE_STREAM_NAME,
(off_t)64*1024*1024, 10, rfork_content);
+ /* Check size after write */
+
+ ZERO_STRUCT(io);
+ io.smb2.in.create_disposition = NTCREATEX_DISP_OPEN;
+ io.smb2.in.desired_access = SEC_FILE_READ_ATTRIBUTE |
+ SEC_FILE_WRITE_ATTRIBUTE;
+ io.smb2.in.fname = rfork;
+ status = smb2_create(tree, mem_ctx, &(io.smb2));
+ CHECK_STATUS(status, NT_STATUS_OK);
+ filehandle = io.smb2.out.file.handle;
+
+ torture_comment(tctx, "(%s) check resource fork size after write\n",
+ __location__);
+
+ ZERO_STRUCT(finfo);
+ finfo.generic.level = RAW_FILEINFO_ALL_INFORMATION;
+ finfo.generic.in.file.handle = filehandle;
+ status = smb2_getinfo_file(tree, mem_ctx, &finfo);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ if (finfo.all_info.out.size != 64*1024*1024 + 10) {
+ torture_result(tctx, TORTURE_FAIL,
+ "(%s) Incorrect resource fork size\n",
+ __location__);
+ ret = false;
+ smb2_util_close(tree, filehandle);
+ goto done;
+ }
+ smb2_util_close(tree, filehandle);
+
ret &= check_stream(tree, __location__, tctx, mem_ctx,
fname, AFPRESOURCE_STREAM_NAME,
(off_t)64*1024*1024, 10, 0, 10, rfork_content);
--
Samba Shared Repository
More information about the samba-cvs
mailing list