[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Mon Oct 3 21:06:01 UTC 2022


The branch, master has been updated
       via  a91fa70ad56 tevent: Fix flag clearing
       via  3804161dca1 libsmb: Fix the smbclient readlink command
       via  f471b2c70ed libsmb: Remove unused cli_smb2_set_reparse_point_fnum_send/recv
       via  3d2d066c13a libsmb: Convert cli_symlink to cli_fsctl
       via  091ce9c50d6 libsmb: Remove unused cli_smb2_get_reparse_point_fnum_send/recv
       via  aaacbd0f2a9 libsmb: Convert cli_readlink() to cli_fsctl_send/recv
       via  dccc060bc9c libsmb: Add cli_fsctl_send/recv
       via  50b13868d4f libsmb: Add cli_smb2_fsctl_send/recv
       via  4388ba47ea2 libsmb: Centralize the SMB2 protocol check
       via  36bd73e836f smbXcli: Align smb2cli_req_create() with tevent_req conventions
       via  25bb94e00e2 python: whitespace fixes
       via  4b3bfbaf0f2 torture3: Align integer types
       via  d257c760a53 vfs: Fix a typo
      from  318da783e9d s3: smbtorture3: Add new SMB2-DFS-SHARE-NON-DFS-PATH test.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a91fa70ad568bbca34dc9d09e098686b8482d0ed
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Fri Apr 29 12:20:06 2022 +1200

    tevent: Fix flag clearing
    
    We presumably meant to clear this bit, rather than clearing all bits
    other than it.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Mon Oct  3 21:05:31 UTC 2022 on sn-devel-184

commit 3804161dca1d23ab44b2c22bdf199bf640fd6cb5
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 29 15:41:30 2022 +0200

    libsmb: Fix the smbclient readlink command
    
    We use cli_smb2_qpathinfo_basic() for cli_resolve_path() before
    calling cli_readlink(). This fails as it never tries with
    FILE_OPEN_REPARSE_POINT, so we never get to the point where we
    actually can issue the FSCTL_GET_REPARSE_POINT.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit f471b2c70ed67507a7a6abe70321089617565426
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 29 12:49:10 2022 +0200

    libsmb: Remove unused cli_smb2_set_reparse_point_fnum_send/recv
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3d2d066c13a5fda4aea4089d3dc78b4828717494
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 29 12:47:45 2022 +0200

    libsmb: Convert cli_symlink to cli_fsctl
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 091ce9c50d6951cfe6bfdbd3cb6461a373ae56dd
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 29 12:41:54 2022 +0200

    libsmb: Remove unused cli_smb2_get_reparse_point_fnum_send/recv
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit aaacbd0f2a95245863fa90bcd0fdbed68f590c7a
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 29 12:40:45 2022 +0200

    libsmb: Convert cli_readlink() to cli_fsctl_send/recv
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit dccc060bc9caba6f3be1a65e213e322ccdfefd94
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 29 12:22:10 2022 +0200

    libsmb: Add cli_fsctl_send/recv
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 50b13868d4fce15cd2348ac9dea1bca3f049e4ad
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 29 12:21:53 2022 +0200

    libsmb: Add cli_smb2_fsctl_send/recv
    
    Slightly refactor the symlink operations later based on this
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 4388ba47ea25213d364402da7ddcd032845d2ad3
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 29 11:08:12 2022 +0200

    libsmb: Centralize the SMB2 protocol check
    
    Instead of checking protocol correctness in every highlevel routine,
    we should rely on the lowerlevel one in smbXcli_base.c to give the
    INVALID_PARAMETER error return when running on SMB1
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 36bd73e836f733068bdc9bb5df704f825fac7d2e
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 29 11:00:41 2022 +0200

    smbXcli: Align smb2cli_req_create() with tevent_req conventions
    
    We don't return NULL if tevent_req_create() succeeded, and elsewhere
    in this function we already pass tevent_req_nterror or
    tevent_req_nomem (via set_endtime).
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 25bb94e00e2b82b8637814399241c382212bc180
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Sep 20 16:21:44 2022 +0200

    python: whitespace fixes
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 4b3bfbaf0f2179bc6a8172dbec62128c0db74dbc
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 29 10:45:19 2022 +0200

    torture3: Align integer types
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d257c760a53246857afa223b528a8066a00c8940
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Sep 22 10:46:56 2022 +0200

    vfs: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/tevent/tevent_port.c       |   4 +-
 libcli/smb/smbXcli_base.c      |  11 +-
 python/pyglue.c                |   9 +-
 source3/libsmb/cli_smb2_fnum.c | 367 ++++++++---------------------------------
 source3/libsmb/cli_smb2_fnum.h |  25 ++-
 source3/libsmb/clifile.c       | 121 ++++++++++++++
 source3/libsmb/clirap.h        |  12 ++
 source3/libsmb/clisymlink.c    |  97 +++--------
 source3/modules/vfs_default.c  |   2 +-
 source3/torture/denytest.c     |   5 +-
 source4/param/pyparam.c        |  22 +--
 11 files changed, 267 insertions(+), 408 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tevent/tevent_port.c b/lib/tevent/tevent_port.c
index ccb65a711b2..defa84cfc21 100644
--- a/lib/tevent/tevent_port.c
+++ b/lib/tevent/tevent_port.c
@@ -220,7 +220,7 @@ static int port_check_reopen(struct port_event_context *port_ev)
 
 	port_ev->pid = pid;
 	for (fde=port_ev->ev->fd_events;fde;fde=fde->next) {
-		fde->additional_flags &= PORT_ADDITIONAL_FD_FLAG_HAS_ASSOCIATION;
+		fde->additional_flags &= ~PORT_ADDITIONAL_FD_FLAG_HAS_ASSOCIATION;
 		if (port_update_event(port_ev, fde) != 0) {
 			return -1;
 		}
@@ -670,7 +670,7 @@ static int port_event_fd_destructor(struct tevent_fd *fde)
 		fde->additional_data = NULL;
 		mpx_fde->additional_data = NULL;
 
-		fde->additional_flags &= PORT_ADDITIONAL_FD_FLAG_HAS_ASSOCIATION;
+		fde->additional_flags &= ~PORT_ADDITIONAL_FD_FLAG_HAS_ASSOCIATION;
 	}
 
 	(void)port_check_reopen(port_ev);
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 47f385349c4..aaf2d405a94 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -2997,6 +2997,7 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
 	bool use_channel_sequence = conn->smb2.force_channel_sequence;
 	uint16_t channel_sequence = 0;
 	bool use_replay_flag = false;
+	enum protocol_types proto = smbXcli_conn_protocol(conn);
 
 	req = tevent_req_create(mem_ctx, &state,
 				struct smbXcli_req_state);
@@ -3004,6 +3005,11 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
+	if ((proto > PROTOCOL_NONE) && (proto < PROTOCOL_SMB2_02)) {
+		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+		return req;
+	}
+
 	state->ev = ev;
 	state->conn = conn;
 	state->session = session;
@@ -3081,9 +3087,8 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
 	}
 
 	state->smb2.recv_iov = talloc_zero_array(state, struct iovec, 3);
-	if (state->smb2.recv_iov == NULL) {
-		TALLOC_FREE(req);
-		return NULL;
+	if (tevent_req_nomem(state->smb2.recv_iov, req)) {
+		return req;
 	}
 
 	flags |= additional_flags;
diff --git a/python/pyglue.c b/python/pyglue.c
index 60592874ae6..64be7389b70 100644
--- a/python/pyglue.c
+++ b/python/pyglue.c
@@ -1,18 +1,18 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    Copyright (C) Jelmer Vernooij <jelmer at samba.org> 2007
    Copyright (C) Matthias Dieter Wallnöfer          2009
-   
+
    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 <http://www.gnu.org/licenses/>.
 */
@@ -569,4 +569,3 @@ MODULE_INIT_FUNC(_glue)
 
 	return m;
 }
-
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 9076dbd8b90..c7d5ac70dcd 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -234,11 +234,6 @@ struct tevent_req *cli_smb2_create_fnum_send(
 	}
 	state->cli = cli;
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return tevent_req_post(req, ev);
-	}
-
 	if (cli->backup_intent) {
 		create_options |= FILE_OPEN_FOR_BACKUP_INTENT;
 	}
@@ -486,11 +481,6 @@ struct tevent_req *cli_smb2_close_fnum_send(TALLOC_CTX *mem_ctx,
 	state->cli = cli;
 	state->fnum = fnum;
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return tevent_req_post(req, ev);
-	}
-
 	status = map_fnum_to_smb2_handle(cli, fnum, &state->ph);
 	if (tevent_req_nterror(req, status)) {
 		return tevent_req_post(req, ev);
@@ -710,11 +700,6 @@ struct tevent_req *cli_smb2_delete_on_close_send(TALLOC_CTX *mem_ctx,
 	}
 	state->cli = cli;
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return tevent_req_post(req, ev);
-	}
-
 	/*
 	 * setinfo on the handle with info_type SMB2_SETINFO_FILE (1),
 	 * level 13 (SMB_FILE_DISPOSITION_INFORMATION - 1000).
@@ -912,11 +897,6 @@ struct tevent_req *cli_smb2_rmdir_send(
 	state->dname = dname;
 	state->in_cblobs = in_cblobs;
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return tevent_req_post(req, ev);
-	}
-
 	subreq = cli_smb2_create_fnum_send(
 		state,
 		state->ev,
@@ -1087,11 +1067,6 @@ struct tevent_req *cli_smb2_unlink_send(
 	state->fname = fname;
 	state->in_cblobs = in_cblobs;
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return tevent_req_post(req, ev);
-	}
-
 	subreq = cli_smb2_create_fnum_send(
 		state,		/* mem_ctx */
 		state->ev,	/* tevent_context */
@@ -1357,11 +1332,6 @@ struct tevent_req *cli_smb2_list_send(
 	state->cli = cli;
 	state->status = NT_STATUS_OK;
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return tevent_req_post(req, ev);
-	}
-
 	ok = windows_parent_dirname(state, pathname, &parent, &state->mask);
 	if (!ok) {
 		tevent_req_oom(req);
@@ -1598,10 +1568,6 @@ NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		return NT_STATUS_INVALID_PARAMETER;
-	}
-
 	/* SMB2 is pickier about pathnames. Ensure it doesn't
 	   end in a '\' */
 	if (namelen > 0 && name[namelen-1] == '\\') {
@@ -1648,6 +1614,24 @@ NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
 			NULL);
 	}
 
+	if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK)) {
+		/* Maybe a reparse point ? */
+		status = cli_smb2_create_fnum(cli,
+			name,
+			0,			/* create_flags */
+			SMB2_IMPERSONATION_IMPERSONATION,
+			FILE_READ_ATTRIBUTES,		/* desired_access */
+			0, /* file attributes */
+			FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access */
+			FILE_OPEN,		/* create_disposition */
+			FILE_OPEN_REPARSE_POINT, /* create_options */
+			NULL,
+			&fnum,
+			&cr,
+			NULL,
+			NULL);
+	}
+
 	if (!NT_STATUS_IS_OK(status)) {
 		return status;
 	}
@@ -2047,11 +2031,6 @@ NTSTATUS cli_smb2_qpathinfo_alt_name(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	status = get_fnum_from_path(cli,
 				name,
 				FILE_READ_ATTRIBUTES,
@@ -2148,11 +2127,6 @@ NTSTATUS cli_smb2_getatr(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	status = get_fnum_from_path(cli,
 				name,
 				FILE_READ_ATTRIBUTES,
@@ -2219,11 +2193,6 @@ NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	status = get_fnum_from_path(cli,
 					name,
 					FILE_READ_ATTRIBUTES,
@@ -2280,11 +2249,6 @@ NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	status = get_fnum_from_path(cli,
 				name,
 				FILE_READ_ATTRIBUTES,
@@ -2359,11 +2323,6 @@ NTSTATUS cli_smb2_setpathinfo(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	status = get_fnum_from_path(cli,
 				name,
 				FILE_WRITE_ATTRIBUTES,
@@ -2475,10 +2434,6 @@ NTSTATUS cli_smb2_setattrE(struct cli_state *cli,
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		return NT_STATUS_INVALID_PARAMETER;
-	}
-
 	/* setinfo on the handle with info_type SMB2_SETINFO_FILE (1),
 	   level 4 (SMB_FILE_BASIC_INFORMATION - 1000). */
 
@@ -2533,11 +2488,6 @@ NTSTATUS cli_smb2_dskattr(struct cli_state *cli, const char *path,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	/* First open the top level directory. */
 	status = cli_smb2_create_fnum(cli,
 			path,
@@ -2636,11 +2586,6 @@ NTSTATUS cli_smb2_get_fs_full_size_info(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	/* First open the top level directory. */
 	status =
 	    cli_smb2_create_fnum(cli, "", 0,		   /* create_flags */
@@ -2722,11 +2667,6 @@ NTSTATUS cli_smb2_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr)
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	/* First open the top level directory. */
 	status =
 	    cli_smb2_create_fnum(cli, "", 0,		   /* create_flags */
@@ -2807,11 +2747,6 @@ NTSTATUS cli_smb2_get_fs_volume_info(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	/* First open the top level directory. */
 	status =
 	    cli_smb2_create_fnum(cli, "", 0,		   /* create_flags */
@@ -2937,11 +2872,6 @@ struct tevent_req *cli_smb2_query_mxac_send(TALLOC_CTX *mem_ctx,
 		.fname = fname,
 	};
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return tevent_req_post(req, ev);
-	}
-
 	status = smb2_create_blob_add(state,
 				      &state->in_cblobs,
 				      SMB2_CREATE_TAG_MXAC,
@@ -3361,11 +3291,6 @@ NTSTATUS cli_smb2_set_ea_fnum(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	/* Marshall the SMB2 EA data. */
 	if (ea_len > 0xFFFF) {
 		status = NT_STATUS_INVALID_PARAMETER;
@@ -3441,11 +3366,6 @@ NTSTATUS cli_smb2_set_ea_path(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	status = get_fnum_from_path(cli,
 				name,
 				FILE_WRITE_EA,
@@ -3505,11 +3425,6 @@ NTSTATUS cli_smb2_get_ea_list_path(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	status = get_fnum_from_path(cli,
 				name,
 				FILE_READ_EA,
@@ -3606,11 +3521,6 @@ NTSTATUS cli_smb2_get_user_quota(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	sid_len = ndr_size_dom_sid(&pqt->sid, 0);
 
 	query.return_single = 1;
@@ -3711,11 +3621,6 @@ NTSTATUS cli_smb2_list_user_quota_step(struct cli_state *cli,
 		goto cleanup;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto cleanup;
-	}
-
 	info.restart_scan = first ? 1 : 0;
 
 	err = ndr_push_struct_blob(
@@ -3784,11 +3689,6 @@ NTSTATUS cli_smb2_get_fs_quota_info(struct cli_state *cli,
 		goto cleanup;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto cleanup;
-	}
-
 	status = cli_smb2_query_info_fnum(
 		cli,
 		quota_fnum,
@@ -3835,11 +3735,6 @@ NTSTATUS cli_smb2_set_user_quota(struct cli_state *cli,
 		goto cleanup;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto cleanup;
-	}
-
 	status = build_user_quota_buffer(qtl, 0, talloc_tos(), &inbuf, NULL);
 	if (!NT_STATUS_IS_OK(status)) {
 		goto cleanup;
@@ -3877,11 +3772,6 @@ NTSTATUS cli_smb2_set_fs_quota_info(struct cli_state *cli,
 		goto cleanup;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto cleanup;
-	}
-
 	status = build_fs_quota_buffer(talloc_tos(), pqt, &inbuf, 0);
 	if (!NT_STATUS_IS_OK(status)) {
 		goto cleanup;
@@ -4578,11 +4468,6 @@ static struct tevent_req *cli_smb2_shadow_copy_data_fnum_send(
 		return NULL;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return tevent_req_post(req, ev);
-	}
-
 	state->cli = cli;
 	state->fnum = fnum;
 
@@ -4795,11 +4680,6 @@ NTSTATUS cli_smb2_ftruncate(struct cli_state *cli,
 		goto fail;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
 	SBVAL(buf, 0, newsize);
 
 	/* setinfo on the handle with info_type SMB2_SETINFO_FILE (1),
@@ -4850,11 +4730,6 @@ struct tevent_req *cli_smb2_notify_send(
 		return NULL;
 	}
 
-	if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
-		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return tevent_req_post(req, ev);
-	}
-
 	status = map_fnum_to_smb2_handle(cli, fnum, &ph);
 	if (tevent_req_nterror(req, status)) {
 		return tevent_req_post(req, ev);
@@ -5025,197 +4900,95 @@ fail:
 	return status;
 }
 
-struct cli_smb2_set_reparse_point_fnum_state {
-	struct cli_state *cli;
-	uint16_t fnum;
-	struct smb2_hnd *ph;
-	DATA_BLOB input_buffer;
+struct cli_smb2_fsctl_state {
+	DATA_BLOB out;
 };
 
-static void cli_smb2_set_reparse_point_fnum_done(struct tevent_req *subreq);
+static void cli_smb2_fsctl_done(struct tevent_req *subreq);
 
-struct tevent_req *cli_smb2_set_reparse_point_fnum_send(
-				TALLOC_CTX *mem_ctx,
-				struct tevent_context *ev,
-				struct cli_state *cli,
-				uint16_t fnum,
-				DATA_BLOB in_buf)
+struct tevent_req *cli_smb2_fsctl_send(
+	TALLOC_CTX *mem_ctx,
+	struct tevent_context *ev,
+	struct cli_state *cli,
+	uint16_t fnum,
+	uint32_t ctl_code,
+	const DATA_BLOB *in,
+	uint32_t max_out)
 {
-	struct tevent_req *req, *subreq;
-	struct cli_smb2_set_reparse_point_fnum_state *state = NULL;
+	struct tevent_req *req = NULL, *subreq = NULL;
+	struct cli_smb2_fsctl_state *state = NULL;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list