summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorSteven Danneman <steven.danneman@isilon.com>2009-11-18 16:35:16 -0800
committerSteven Danneman <steven.danneman@isilon.com>2009-11-25 12:55:47 -0800
commit65a611ec7299ba992d16dff69da47b1b8e16241d (patch)
tree9c890834c3ae965daf6d0ee3e545080016d38338 /source4
parent95108f1c60aaa0407aa4eb8c9a567e90302253c6 (diff)
downloadsamba-65a611ec7299ba992d16dff69da47b1b8e16241d.tar.gz
samba-65a611ec7299ba992d16dff69da47b1b8e16241d.tar.bz2
samba-65a611ec7299ba992d16dff69da47b1b8e16241d.zip
s4/libcli: Initialize client PID for SMB2 connections
Set the SMB pid to the Unix pid of the client process.
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/smb2/request.c1
-rw-r--r--source4/libcli/smb2/session.c4
-rw-r--r--source4/libcli/smb2/smb2.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index 5d09a5083a..358d13363f 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -175,6 +175,7 @@ struct smb2_request *smb2_request_init_tree(struct smb2_tree *tree, uint16_t opc
if (req == NULL) return NULL;
SBVAL(req->out.hdr, SMB2_HDR_SESSION_ID, tree->session->uid);
+ SIVAL(req->out.hdr, SMB2_HDR_PID, tree->session->pid);
SIVAL(req->out.hdr, SMB2_HDR_TID, tree->tid);
req->session = tree->session;
req->tree = tree;
diff --git a/source4/libcli/smb2/session.c b/source4/libcli/smb2/session.c
index 9db32c4dfc..12479623e7 100644
--- a/source4/libcli/smb2/session.c
+++ b/source4/libcli/smb2/session.c
@@ -26,6 +26,8 @@
#include "libcli/composite/composite.h"
#include "auth/gensec/gensec.h"
+#include <unistd.h>
+
/**
initialise a smb2_session structure
*/
@@ -46,6 +48,8 @@ struct smb2_session *smb2_session_init(struct smb2_transport *transport,
session->transport = talloc_reference(session, transport);
}
+ session->pid = getpid();
+
/* prepare a gensec context for later use */
status = gensec_client_start(session, &session->gensec,
session->transport->socket->event.ctx,
diff --git a/source4/libcli/smb2/smb2.h b/source4/libcli/smb2/smb2.h
index fdd2d6f6fc..ba626fbe06 100644
--- a/source4/libcli/smb2/smb2.h
+++ b/source4/libcli/smb2/smb2.h
@@ -145,6 +145,7 @@ struct smb2_session {
struct smb2_transport *transport;
struct gensec_security *gensec;
uint64_t uid;
+ uint32_t pid;
DATA_BLOB session_key;
bool signing_active;
};