[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-586-g3f6cc82

Jeremy Allison jra at samba.org
Mon Dec 10 23:31:39 GMT 2007


The branch, v3-2-test has been updated
       via  3f6cc826378729c9157ea68e7cf5c7b584bbb585 (commit)
      from  cafde6c37259de587d3775a2d229abd253d2376d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 3f6cc826378729c9157ea68e7cf5c7b584bbb585
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Dec 10 15:31:05 2007 -0800

    Don't need an fstring here, we can talloc.
    Jeremy.

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

Summary of changes:
 source/include/smb.h |    2 +-
 source/smbd/ipc.c    |   17 ++++++++---------
 2 files changed, 9 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/smb.h b/source/include/smb.h
index 763f955..d58c124 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -563,7 +563,7 @@ struct trans_state {
 
 	uint8 cmd;		/* SMBtrans or SMBtrans2 */
 
-	fstring name;		/* for trans requests */
+	char *name;		/* for trans requests */
 	uint16 call;		/* for trans2 and nttrans requests */
 
 	bool close_on_completion;
diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c
index eed293d..f28016c 100644
--- a/source/smbd/ipc.c
+++ b/source/smbd/ipc.c
@@ -374,7 +374,7 @@ static void api_fd_reply(connection_struct *conn, uint16 vuid,
 
 static void named_pipe(connection_struct *conn, uint16 vuid,
 		       struct smb_request *req,
-		       char *name, uint16 *setup,
+		       const char *name, uint16 *setup,
 		       char *data, char *params,
 		       int suwcnt, int tdscnt,int tpscnt,
 		       int msrcnt, int mdrcnt, int mprcnt)
@@ -452,7 +452,7 @@ static void handle_trans(connection_struct *conn, struct smb_request *req,
 		reply_nterror(req, NT_STATUS_NOT_SUPPORTED);
 		return;
 	}
-	
+
 	name_offset += strlen("\\PIPE");
 
 	/* Win9x weirdness.  When talking to a unicode server Win9x
@@ -538,12 +538,11 @@ void reply_trans(connection_struct *conn, struct smb_request *req)
 	state->close_on_completion = BITSETW(req->inbuf+smb_vwv5,0);
 	state->one_way = BITSETW(req->inbuf+smb_vwv5,1);
 
-	memset(state->name, '\0',sizeof(state->name));
-	srvstr_pull_buf(req->inbuf, req->flags2, state->name,
-			smb_buf(req->inbuf), sizeof(state->name),
-			STR_TERMINATE);
-	
-	if ((dscnt > state->total_data) || (pscnt > state->total_param))
+	srvstr_pull_buf_talloc(state, req->inbuf, req->flags2, &state->name,
+			smb_buf(req->inbuf), STR_TERMINATE);
+
+	if ((dscnt > state->total_data) || (pscnt > state->total_param) ||
+			!state->name)
 		goto bad_param;
 
 	if (state->total_data)  {
@@ -557,7 +556,7 @@ void reply_trans(connection_struct *conn, struct smb_request *req)
 			reply_nterror(req, NT_STATUS_NO_MEMORY);
 			END_PROFILE(SMBtrans);
 			return;
-		} 
+		}
 		/* null-terminate the slack space */
 		memset(&state->data[state->total_data], 0, 100);
 		if ((dsoff+dscnt < dsoff) || (dsoff+dscnt < dscnt))


-- 
Samba Shared Repository


More information about the samba-cvs mailing list