[SCM] Samba Shared Repository - branch master updated

Uri Simchoni uri at samba.org
Wed Jun 22 08:34:03 UTC 2016


The branch, master has been updated
       via  c0704d9 s3: libsmb: Correctly trim a trailing \ character in cli_smb2_create_fnum_send() when passing a pathname to SMB2 create.
      from  e29d8f1 libnet: ignore realm setting for domain security joins to AD domains if 'winbind rpc only = true'

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


- Log -----------------------------------------------------------------
commit c0704d99ce43a5497a29bfc53331159e4f978441
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jun 21 15:49:27 2016 -0700

    s3: libsmb: Correctly trim a trailing \\ character in cli_smb2_create_fnum_send() when passing a pathname to SMB2 create.
    
    We already trim any leading \\ characters in this function, so this is the simplest place
    to clean the pathname.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11986
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    
    Autobuild-User(master): Uri Simchoni <uri at samba.org>
    Autobuild-Date(master): Wed Jun 22 10:33:29 CEST 2016 on sn-devel-144

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

Summary of changes:
 source3/libsmb/cli_smb2_fnum.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index a17d918..c5b1434 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -176,6 +176,7 @@ struct tevent_req *cli_smb2_create_fnum_send(TALLOC_CTX *mem_ctx,
 {
 	struct tevent_req *req, *subreq;
 	struct cli_smb2_create_fnum_state *state;
+	size_t fname_len = 0;
 
 	req = tevent_req_create(mem_ctx, &state,
 				struct cli_smb2_create_fnum_state);
@@ -199,6 +200,17 @@ struct tevent_req *cli_smb2_create_fnum_send(TALLOC_CTX *mem_ctx,
 		fname++;
 	}
 
+	/* Or end in a '\' */
+	fname_len = strlen(fname);
+	if (fname_len > 0 && fname[fname_len-1] == '\\') {
+		char *new_fname = talloc_strdup(state, fname);
+		if (tevent_req_nomem(new_fname, req)) {
+			return tevent_req_post(req, ev);
+		}
+		new_fname[fname_len-1] = '\0';
+		fname = new_fname;
+	}
+
 	subreq = smb2cli_create_send(state, ev,
 				     cli->conn,
 				     cli->timeout,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list