summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mulder <dmulder@suse.com>2022-03-18 15:13:25 -0600
committerJeremy Allison <jra@samba.org>2022-04-07 17:37:30 +0000
commit7a8f77acb93904c898e09ed4ceb23dae00385fdd (patch)
tree07fd7975a6be06f8118d8f26eab07b6374a670b1
parent635bf8513bebf179165b06912a065f3c637693c4 (diff)
downloadsamba-7a8f77acb93904c898e09ed4ceb23dae00385fdd.tar.gz
smbd: Move smbXsrv_connection_dbg to smb2_process.c
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/smbd/process.c30
-rw-r--r--source3/smbd/smb2_process.c30
2 files changed, 30 insertions, 30 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 0786b35f604..24427968e77 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -3404,36 +3404,6 @@ static void smbd_tevent_trace_callback(enum tevent_trace_point point,
errno = 0;
}
-/**
- * Create a debug string for the connection
- *
- * This is allocated to talloc_tos() or a string constant
- * in certain corner cases. The returned string should
- * hence not be free'd directly but only via the talloc stack.
- */
-const char *smbXsrv_connection_dbg(const struct smbXsrv_connection *xconn)
-{
- const char *ret;
- char *addr;
- /*
- * TODO: this can be improved later
- * maybe including the client guid or more
- */
- addr = tsocket_address_string(xconn->remote_address, talloc_tos());
- if (addr == NULL) {
- return "<tsocket_address_string() failed>";
- }
-
- ret = talloc_asprintf(talloc_tos(), "ptr=%p,id=%llu,addr=%s",
- xconn, (unsigned long long)xconn->channel_id, addr);
- TALLOC_FREE(addr);
- if (ret == NULL) {
- return "<talloc_asprintf() failed>";
- }
-
- return ret;
-}
-
static int smbXsrv_connection_destructor(struct smbXsrv_connection *xconn)
{
DBG_DEBUG("xconn[%s]\n", smbXsrv_connection_dbg(xconn));
diff --git a/source3/smbd/smb2_process.c b/source3/smbd/smb2_process.c
index 01408f55173..29e4a622c6a 100644
--- a/source3/smbd/smb2_process.c
+++ b/source3/smbd/smb2_process.c
@@ -701,3 +701,33 @@ NTSTATUS smbXsrv_connection_init_tables(struct smbXsrv_connection *conn,
set_Protocol(protocol);
return NT_STATUS_OK;
}
+
+/**
+ * Create a debug string for the connection
+ *
+ * This is allocated to talloc_tos() or a string constant
+ * in certain corner cases. The returned string should
+ * hence not be free'd directly but only via the talloc stack.
+ */
+const char *smbXsrv_connection_dbg(const struct smbXsrv_connection *xconn)
+{
+ const char *ret;
+ char *addr;
+ /*
+ * TODO: this can be improved later
+ * maybe including the client guid or more
+ */
+ addr = tsocket_address_string(xconn->remote_address, talloc_tos());
+ if (addr == NULL) {
+ return "<tsocket_address_string() failed>";
+ }
+
+ ret = talloc_asprintf(talloc_tos(), "ptr=%p,id=%llu,addr=%s",
+ xconn, (unsigned long long)xconn->channel_id, addr);
+ TALLOC_FREE(addr);
+ if (ret == NULL) {
+ return "<talloc_asprintf() failed>";
+ }
+
+ return ret;
+}