summaryrefslogtreecommitdiff
path: root/source4/libcli/smb2
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/smb2')
-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;
};