[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Tue Jul 12 02:54:02 MDT 2011


The branch, master has been updated
       via  8a234cb s3:libsmb: remove unused cli_oplock_handler()
       via  a6b1289 s4:libcli/raw: remove SMBkeepalive
       via  5812a52 s4:smb_server: s/SMBkeepalive/NBSSkeepalive
       via  142b4f5 s3:include: remove SMBkeepalive
       via  0633c0f s3:smbd: s/SMBkeepalive/NBSSkeepalive
       via  c07c412 s3:libsmb: s/SMBkeepalive/NBSSkeepalive
       via  a2d4197 s3:lib: s/SMBkeepalive/NBSSkeepalive
       via  86fb61a libcli/smb: add NBSS message types
      from  7b73b6f s3:libsmb: remove unused cli->privileges

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


- Log -----------------------------------------------------------------
commit 8a234cbe1589439497608d35f35768c6841750c9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 12 09:20:02 2011 +0200

    s3:libsmb: remove unused cli_oplock_handler()
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Tue Jul 12 10:53:52 CEST 2011 on sn-devel-104

commit a6b128912b60f79258a41131f942e19d6292f9a3
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 12 08:57:34 2011 +0200

    s4:libcli/raw: remove SMBkeepalive
    
    metze

commit 5812a5218dd5b6c9833e4a64e33efdf0e7f78a03
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 12 08:56:53 2011 +0200

    s4:smb_server: s/SMBkeepalive/NBSSkeepalive
    
    metze

commit 142b4f5b3710c044d039eda63973619450034dfb
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 12 08:57:14 2011 +0200

    s3:include: remove SMBkeepalive
    
    metze

commit 0633c0f6003a21de0417143c6fb7ec5dd207397a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 12 08:55:58 2011 +0200

    s3:smbd: s/SMBkeepalive/NBSSkeepalive
    
    metze

commit c07c4123d92646769bb176699490d66ebacc8473
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 12 08:55:26 2011 +0200

    s3:libsmb: s/SMBkeepalive/NBSSkeepalive
    
    metze

commit a2d419759017270e52dec18782140706dcda5e39
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 12 08:53:30 2011 +0200

    s3:lib: s/SMBkeepalive/NBSSkeepalive
    
    metze

commit 86fb61a4aaefc088fa70931bf04304ba6b882161
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 12 08:42:30 2011 +0200

    libcli/smb: add NBSS message types
    
    metze

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

Summary of changes:
 libcli/smb/smb_constants.h     |   10 ++++++++
 source3/include/client.h       |    3 --
 source3/include/smb.h          |    1 -
 source3/lib/util_sock.c        |    4 +-
 source3/libsmb/clientgen.c     |    1 -
 source3/libsmb/clioplock.c     |   47 ----------------------------------------
 source3/libsmb/proto.h         |    3 --
 source3/libsmb/read_smb.c      |    2 +-
 source3/smbd/process.c         |    4 +-
 source3/smbd/reply.c           |   20 ++++++++--------
 source4/libcli/raw/smb.h       |    1 -
 source4/smb_server/smb/reply.c |    6 ++--
 12 files changed, 28 insertions(+), 74 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/smb/smb_constants.h b/libcli/smb/smb_constants.h
index 0dd79e8..f833b25 100644
--- a/libcli/smb/smb_constants.h
+++ b/libcli/smb/smb_constants.h
@@ -22,6 +22,16 @@
 #ifndef _SMB_CONSTANTS_H
 #define _SMB_CONSTANTS_H
 
+/*
+ * Netbios over TCP (rfc 1002)
+ */
+#define NBSSmessage     0x00   /* session message */
+#define NBSSrequest     0x81   /* session request */
+#define NBSSpositive    0x82   /* positiv session response */
+#define NBSSnegative    0x83   /* negativ session response */
+#define NBSSretarget    0x84   /* retarget session response */
+#define NBSSkeepalive   0x85   /* keepalive */
+
 /* protocol types. It assumes that higher protocols include lower protocols
    as subsets. */
 enum protocol_types {
diff --git a/source3/include/client.h b/source3/include/client.h
index b5b9bfc..dfd457b 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -124,9 +124,6 @@ struct cli_state {
 	bool use_oplocks; /* should we use oplocks? */
 	bool use_level_II_oplocks; /* should we use level II oplocks? */
 
-	/* a oplock break request handler */
-	NTSTATUS (*oplock_handler)(struct cli_state *cli, uint16_t fnum, unsigned char level);
-
 	bool force_dos_errors;
 	bool case_sensitive; /* False by default. */
 
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 11664b3..8ba8780 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -808,7 +808,6 @@ struct connections_data {
 #define SMBffirst        0x82   /* find first */
 #define SMBfunique       0x83   /* find unique */
 #define SMBfclose        0x84   /* find close */
-#define SMBkeepalive     0x85   /* keepalive */
 #define SMBinvalid       0xFE   /* invalid command */
 
 /* Extended 2.0 protocol */
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index da84d76..ebdd2c7 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -300,7 +300,7 @@ bool send_keepalive(int client)
 {
 	unsigned char buf[4];
 
-	buf[0] = SMBkeepalive;
+	buf[0] = NBSSkeepalive;
 	buf[1] = buf[2] = buf[3] = 0;
 
 	return(write_data(client,(char *)buf,4) == 4);
@@ -330,7 +330,7 @@ NTSTATUS read_smb_length_return_keepalive(int fd, char *inbuf,
 	*len = smb_len(inbuf);
 	msg_type = CVAL(inbuf,0);
 
-	if (msg_type == SMBkeepalive) {
+	if (msg_type == NBSSkeepalive) {
 		DEBUG(5,("Got keepalive packet\n"));
 	}
 
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index bcb1215..d6c7d64 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -191,7 +191,6 @@ struct cli_state *cli_initialise_ex(int signing_state)
 	cli->protocol = PROTOCOL_NT1;
 	cli->timeout = 20000; /* Timeout is in milliseconds. */
 	cli->max_xmit = CLI_BUFFER_SIZE+4;
-	cli->oplock_handler = cli_oplock_ack;
 	cli->case_sensitive = false;
 
 	cli->use_spnego = lp_client_use_spnego();
diff --git a/source3/libsmb/clioplock.c b/source3/libsmb/clioplock.c
index da55f97..f164ed5 100644
--- a/source3/libsmb/clioplock.c
+++ b/source3/libsmb/clioplock.c
@@ -83,50 +83,3 @@ NTSTATUS cli_oplock_ack_recv(struct tevent_req *req)
 	return tevent_req_simple_recv_ntstatus(req);
 }
 
-NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level)
-{
-	TALLOC_CTX *frame = talloc_stackframe();
-	struct event_context *ev;
-	struct tevent_req *req;
-	NTSTATUS status = NT_STATUS_OK;
-
-	if (cli_has_async_calls(cli)) {
-		/*
-		 * Can't use sync call while an async call is in flight
-		 */
-		status = NT_STATUS_INVALID_PARAMETER;
-		goto fail;
-	}
-
-	ev = event_context_init(frame);
-	if (ev == NULL) {
-		status = NT_STATUS_NO_MEMORY;
-		goto fail;
-	}
-
-	req = cli_oplock_ack_send(frame, ev, cli, fnum, level);
-	if (req == NULL) {
-		status = NT_STATUS_NO_MEMORY;
-		goto fail;
-	}
-
-	if (!tevent_req_poll(req, ev)) {
-		status = map_nt_error_from_unix(errno);
-		goto fail;
-	}
-
-	status = cli_oplock_ack_recv(req);
- fail:
-	TALLOC_FREE(frame);
-	return status;
-}
-
-/****************************************************************************
-set the oplock handler for a connection
-****************************************************************************/
-
-void cli_oplock_handler(struct cli_state *cli, 
-			NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char))
-{
-	cli->oplock_handler = handler;
-}
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 66ab6e6..0029db1 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -687,9 +687,6 @@ struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx,
 				       struct cli_state *cli,
 				       uint16_t fnum, uint8_t level);
 NTSTATUS cli_oplock_ack_recv(struct tevent_req *req);
-NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level);
-void cli_oplock_handler(struct cli_state *cli,
-			NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char));
 
 /* The following definitions come from libsmb/cliprint.c  */
 
diff --git a/source3/libsmb/read_smb.c b/source3/libsmb/read_smb.c
index f530633..ecedcfb 100644
--- a/source3/libsmb/read_smb.c
+++ b/source3/libsmb/read_smb.c
@@ -84,7 +84,7 @@ static void read_smb_done(struct tevent_req *subreq)
 		return;
 	}
 
-	if (CVAL(state->buf, 0) == SMBkeepalive) {
+	if (CVAL(state->buf, 0) == NBSSkeepalive) {
 		subreq = read_packet_send(state, state->ev, state->fd, 4,
 					  read_smb_more, NULL);
 		if (tevent_req_nomem(subreq, req)) {
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index d3957fe..7854861 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1592,7 +1592,7 @@ static void process_smb(struct smbd_server_connection *sconn,
 	DEBUG(3, ("Transaction %d of length %d (%u toread)\n",
 		  sconn->trans_num, (int)nread, (unsigned int)unread_bytes));
 
-	if (msg_type != 0) {
+	if (msg_type != NBSSmessage) {
 		/*
 		 * NetBIOS session request, keepalive, etc.
 		 */
@@ -2501,7 +2501,7 @@ static bool smbd_echo_reply(uint8_t *inbuf, size_t inbuf_len,
 	char *outbuf;
 	bool ok;
 
-	if ((inbuf_len == 4) && (CVAL(inbuf, 0) == SMBkeepalive)) {
+	if ((inbuf_len == 4) && (CVAL(inbuf, 0) == NBSSkeepalive)) {
 		DEBUG(10, ("Got netbios keepalive\n"));
 		/*
 		 * Just swallow it
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 2f37b61..25e1aaf 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -519,7 +519,7 @@ void reply_special(struct smbd_server_connection *sconn, char *inbuf, size_t inb
 	smb_setlen(outbuf,0);
 
 	switch (msg_type) {
-	case 0x81: /* session request */
+	case NBSSrequest: /* session request */
 	{
 		/* inbuf_size is guarenteed to be at least 4. */
 		fstring name1,name2;
@@ -532,7 +532,7 @@ void reply_special(struct smbd_server_connection *sconn, char *inbuf, size_t inb
 			exit_server_cleanly("multiple session request not permitted");
 		}
 
-		SCVAL(outbuf,0,0x82);
+		SCVAL(outbuf,0,NBSSpositive);
 		SCVAL(outbuf,3,0);
 
 		/* inbuf_size is guaranteed to be at least 4. */
@@ -614,17 +614,17 @@ void reply_special(struct smbd_server_connection *sconn, char *inbuf, size_t inb
 
 	case 0x89: /* session keepalive request 
 		      (some old clients produce this?) */
-		SCVAL(outbuf,0,SMBkeepalive);
+		SCVAL(outbuf,0,NBSSkeepalive);
 		SCVAL(outbuf,3,0);
 		break;
 
-	case 0x82: /* positive session response */
-	case 0x83: /* negative session response */
-	case 0x84: /* retarget session response */
+	case NBSSpositive: /* positive session response */
+	case NBSSnegative: /* negative session response */
+	case NBSSretarget: /* retarget session response */
 		DEBUG(0,("Unexpected session response\n"));
 		break;
 
-	case SMBkeepalive: /* session keepalive */
+	case NBSSkeepalive: /* session keepalive */
 	default:
 		return;
 	}
@@ -3880,9 +3880,9 @@ void error_to_writebrawerr(struct smb_request *req)
 static NTSTATUS read_smb_length(int fd, char *inbuf, unsigned int timeout,
 				size_t *len)
 {
-	uint8_t msgtype = SMBkeepalive;
+	uint8_t msgtype = NBSSkeepalive;
 
-	while (msgtype == SMBkeepalive) {
+	while (msgtype == NBSSkeepalive) {
 		NTSTATUS status;
 
 		status = read_smb_length_return_keepalive(fd, inbuf, timeout,
@@ -4136,7 +4136,7 @@ void reply_writebraw(struct smb_request *req)
 #if RABBIT_PELLET_FIX
 		/*
 		 * Fix for "rabbit pellet" mode, trigger an early TCP ack by
-		 * sending a SMBkeepalive. Thanks to DaveCB at Sun for this.
+		 * sending a NBSSkeepalive. Thanks to DaveCB at Sun for this.
 		 * JRA.
 		 */
 		if (!send_keepalive(req->sconn->sock)) {
diff --git a/source4/libcli/raw/smb.h b/source4/libcli/raw/smb.h
index c165840..ee22ae0 100644
--- a/source4/libcli/raw/smb.h
+++ b/source4/libcli/raw/smb.h
@@ -321,7 +321,6 @@
 #define SMBffirst        0x82   /* find first */
 #define SMBfunique       0x83   /* find unique */
 #define SMBfclose        0x84   /* find close */
-#define SMBkeepalive     0x85   /* keepalive */
 #define SMBinvalid       0xFE   /* invalid command */
 
 /* Extended 2.0 protocol */
diff --git a/source4/smb_server/smb/reply.c b/source4/smb_server/smb/reply.c
index ff27094..74f093f 100644
--- a/source4/smb_server/smb/reply.c
+++ b/source4/smb_server/smb/reply.c
@@ -2333,7 +2333,7 @@ void smbsrv_reply_special(struct smbsrv_request *req)
 	SIVAL(buf, 0, 0);
 	
 	switch (msg_type) {
-	case 0x81: /* session request */
+	case NBSSrequest: /* session request */
 		if (req->smb_conn->negotiate.done_nbt_session) {
 			DEBUG(0,("Warning: ignoring secondary session request\n"));
 			return;
@@ -2353,14 +2353,14 @@ void smbsrv_reply_special(struct smbsrv_request *req)
 		
 	case 0x89: /* session keepalive request 
 		      (some old clients produce this?) */
-		SCVAL(buf, 0, SMBkeepalive);
+		SCVAL(buf, 0, NBSSkeepalive);
 		SCVAL(buf, 3, 0);
 		req->out.buffer = buf;
 		req->out.size = 4;
 		smbsrv_send_reply_nosign(req);
 		return;
 		
-	case SMBkeepalive: 
+	case NBSSkeepalive:
 		/* session keepalive - swallow it */
 		talloc_free(req);
 		return;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list