s3: debug: smb2: Create a new DBGC_SMB2 debug class and mark all smbd/smb2_*.c files...
authorJeremy Allison <jra@samba.org>
Wed, 21 Mar 2018 19:01:05 +0000 (12:01 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 22 Mar 2018 21:03:26 +0000 (22:03 +0100)
Will allow easier smb2-specific debugging.

https://bugzilla.samba.org/show_bug.cgi?id=13347

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
(cherry picked from commit 8dabcf8948c2e514b489169c34673e093519b583)

24 files changed:
lib/util/debug.c
lib/util/debug.h
source3/smbd/smb2_break.c
source3/smbd/smb2_close.c
source3/smbd/smb2_create.c
source3/smbd/smb2_flush.c
source3/smbd/smb2_getinfo.c
source3/smbd/smb2_glue.c
source3/smbd/smb2_ioctl.c
source3/smbd/smb2_ioctl_dfs.c
source3/smbd/smb2_ioctl_filesys.c
source3/smbd/smb2_ioctl_named_pipe.c
source3/smbd/smb2_ioctl_network_fs.c
source3/smbd/smb2_keepalive.c
source3/smbd/smb2_lock.c
source3/smbd/smb2_negprot.c
source3/smbd/smb2_notify.c
source3/smbd/smb2_query_directory.c
source3/smbd/smb2_read.c
source3/smbd/smb2_server.c
source3/smbd/smb2_sesssetup.c
source3/smbd/smb2_setinfo.c
source3/smbd/smb2_tcon.c
source3/smbd/smb2_write.c

index 8b28002501f4de86152f8d84c40fd2e65c7827f8..50676b8f74c4282a978bafb125a53660d2d272d8 100644 (file)
@@ -541,6 +541,7 @@ static const char *default_classname_table[] = {
        [DBGC_AUTH_AUDIT_JSON] = "auth_json_audit",
        [DBGC_KERBEROS] =       "kerberos",
        [DBGC_DRS_REPL] =       "drs_repl",
+       [DBGC_SMB2] =           "smb2",
 };
 
 /*
index e82553aaf71b788c30295efc318962b7240f48f2..47280da1a78968d72c2c4d7f2f4aaeba764be7ed 100644 (file)
@@ -93,6 +93,7 @@ bool dbghdr( int level, const char *location, const char *func);
 #define DBGC_AUTH_AUDIT_JSON   25
 #define DBGC_KERBEROS           26
 #define DBGC_DRS_REPL           27
+#define DBGC_SMB2               28
 
 /* So you can define DBGC_CLASS before including debug.h */
 #ifndef DBGC_CLASS
index 4c5d62e73d68bacc599f029928781db8168408ea..86529ed2e1f8f27b952025012f05ef6917aa9dd6 100644 (file)
@@ -26,6 +26,9 @@
 #include "../lib/util/tevent_ntstatus.h"
 #include "locking/leases_db.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static NTSTATUS smbd_smb2_request_process_lease_break(
        struct smbd_smb2_request *req);
 
index 5830228ed6faa26802b5c34807fd6369ebde75da..992b52929ec419000bd0f02d239407f52d0d6e4d 100644 (file)
@@ -25,6 +25,9 @@
 #include "../lib/util/tevent_ntstatus.h"
 #include "lib/tevent_wait.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static struct tevent_req *smbd_smb2_close_send(TALLOC_CTX *mem_ctx,
                                               struct tevent_context *ev,
                                               struct smbd_smb2_request *smb2req,
index c4fe2477bad8231764aa348cfc5059151de70ac3..26df7180acb44c7206c80191181f79bb0939e37e 100644 (file)
@@ -29,6 +29,9 @@
 #include "../lib/util/tevent_ntstatus.h"
 #include "messages.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 int map_smb2_oplock_levels_to_samba(uint8_t in_oplock_level)
 {
        switch(in_oplock_level) {
index 51584ca876f059f7e64f51346ccad829fcd4abd4..d1ab3a09839ece55471c63230ce87f8fde6be774 100644 (file)
@@ -24,6 +24,9 @@
 #include "../libcli/smb/smb_common.h"
 #include "../lib/util/tevent_ntstatus.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static struct tevent_req *smbd_smb2_flush_send(TALLOC_CTX *mem_ctx,
                                               struct tevent_context *ev,
                                               struct smbd_smb2_request *smb2req,
index 7f44868bade163e302910134d3f326a0df8ae949..694e9f83b754d501c2e1a1e92c29631f60cf4e19 100644 (file)
@@ -26,6 +26,9 @@
 #include "trans2.h"
 #include "../lib/util/tevent_ntstatus.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
                                                 struct tevent_context *ev,
                                                 struct smbd_smb2_request *smb2req,
index bf2ea5a913814750a578b90940bbd784cdb70e49..6a73ec050e246139cc688f3ac323916168394457 100644 (file)
@@ -23,6 +23,9 @@
 #include "smbd/globals.h"
 #include "../libcli/smb/smb_common.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req)
 {
        struct smb_request *smbreq;
index 993682ffdbbfc081e7002a648af0fe8c86ce075b..be70e3a091285e44407394d67a023b7b34787efa 100644 (file)
@@ -27,6 +27,9 @@
 #include "smb2_ioctl_private.h"
 #include "librpc/gen_ndr/ioctl.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static struct tevent_req *smbd_smb2_ioctl_send(TALLOC_CTX *mem_ctx,
                                               struct tevent_context *ev,
                                               struct smbd_smb2_request *smb2req,
index f4dd189f355ce5c1b52c1991abe0e052e111ffe3..72893ca4237407de326e8ed107c9ca8c7b8a7143 100644 (file)
@@ -26,6 +26,9 @@
 #include "include/ntioctl.h"
 #include "smb2_ioctl_private.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static NTSTATUS fsctl_dfs_get_refers(TALLOC_CTX *mem_ctx,
                                     struct tevent_context *ev,
                                     struct connection_struct *conn,
index 79c50219643c497cc003a4efc1572ce28cfd1ab6..8a9c8c64ec9ddbca4623251555f4792d76aa6e44 100644 (file)
@@ -31,6 +31,9 @@
 #include "librpc/gen_ndr/ndr_ioctl.h"
 #include "smb2_ioctl_private.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 /*
  * XXX this may reduce dup_extents->byte_count so that it's less than the
  * target file size.
index 13c4982d64076559abb297730a57325314b5162b..f9e3dec049c087eebbbc7d3ce452cb6e95205189 100644 (file)
@@ -27,6 +27,9 @@
 #include "include/ntioctl.h"
 #include "smb2_ioctl_private.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static void smbd_smb2_ioctl_pipe_write_done(struct tevent_req *subreq);
 static void smbd_smb2_ioctl_pipe_read_done(struct tevent_req *subreq);
 
index 4006ccf3162ec216e70852ded1fe06fecf228f44..c0d175609ec7e9359208ab19cfa917f2546a0857 100644 (file)
@@ -31,6 +31,9 @@
 #include "smb2_ioctl_private.h"
 #include "../lib/tsocket/tsocket.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static void copychunk_pack_limits(struct srv_copychunk_rsp *cc_rsp)
 {
        cc_rsp->chunks_written = COPYCHUNK_MAX_CHUNKS;
index b16ff6bd98366fc885e9e144ab58e545fb4bc822..fac567c1ce9dac20926d26cbede2ba39f3acc944 100644 (file)
@@ -23,6 +23,9 @@
 #include "smbd/globals.h"
 #include "../libcli/smb/smb_common.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 NTSTATUS smbd_smb2_request_process_keepalive(struct smbd_smb2_request *req)
 {
        DATA_BLOB outbody;
index 45b833cbca6f2068ccf5928a2321504dc28b3133..a05470e52e4a923dd162afbb8a3a9e85eeacaeec 100644 (file)
@@ -26,6 +26,9 @@
 #include "../lib/util/tevent_ntstatus.h"
 #include "messages.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 struct smbd_smb2_lock_element {
        uint64_t offset;
        uint64_t length;
index d9ccdbeea8ec7e2bc803c2f9d3b84a97f26cc9c6..8712cf7c9ae7c52ebd5557122e32ad6865f0b45d 100644 (file)
@@ -27,6 +27,9 @@
 #include "../librpc/ndr/libndr.h"
 #include "../libcli/smb/smb_signing.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 extern fstring remote_proto;
 
 /*
index 573635b89d10f40af04fa56662391fbe7e963900..242415625567f070e83d6ea66ecb0bbfeec3a5ac 100644 (file)
@@ -25,6 +25,9 @@
 #include "../libcli/smb/smb_common.h"
 #include "../lib/util/tevent_ntstatus.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 struct smbd_smb2_notify_state {
        struct smbd_smb2_request *smb2req;
        struct smb_request *smbreq;
index 888473853d41801735b36b0784c979221930b867..700f43e31262928e362e7a3003bb2641a1118bb9 100644 (file)
@@ -26,6 +26,9 @@
 #include "../lib/util/tevent_ntstatus.h"
 #include "system/filesys.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
                                              struct tevent_context *ev,
                                              struct smbd_smb2_request *smb2req,
index 273c56cf35261b37d9ba61c19f6755a3c800eb32..a7d2496bc6f30e4a7f425fa9fe9a0d53116f1b66 100644 (file)
@@ -28,6 +28,9 @@
 #include "rpc_server/srv_pipe_hnd.h"
 #include "lib/util/sys_rw_data.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static struct tevent_req *smbd_smb2_read_send(TALLOC_CTX *mem_ctx,
                                              struct tevent_context *ev,
                                              struct smbd_smb2_request *smb2req,
index a731880e98e7e5ec5af89ad48cf126829b6d4256..c44f9cda8507d7bc446f65de087902fa42dee2a5 100644 (file)
@@ -32,6 +32,9 @@
 #include "auth.h"
 #include "lib/crypto/sha512.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static void smbd_smb2_connection_handler(struct tevent_context *ev,
                                         struct tevent_fd *fde,
                                         uint16_t flags,
index eda538f17f663c15446c21979e37d809f750fcb5..5e1e8b4ec57956e4e805d5b3ade90cd18e7978ac 100644 (file)
@@ -33,6 +33,9 @@
 #include "lib/crypto/aes_ccm_128.h"
 #include "lib/crypto/aes_gcm_128.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static struct tevent_req *smbd_smb2_session_setup_wrap_send(TALLOC_CTX *mem_ctx,
                                        struct tevent_context *ev,
                                        struct smbd_smb2_request *smb2req,
index db00ba0f672ca8beb6af0ddf1b2227587c4f1819..ceab15ac8fd49b38f14a06794763b92283f65ea0 100644 (file)
@@ -29,6 +29,9 @@
 #include "source3/lib/dbwrap/dbwrap_watch.h"
 #include "messages.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static struct tevent_req *smbd_smb2_setinfo_send(TALLOC_CTX *mem_ctx,
                                                 struct tevent_context *ev,
                                                 struct smbd_smb2_request *smb2req,
index 914eb87aa8c2ec6d66c8cf23f57cbf977236489a..07e01cddd46365675246575c63eaa1de3f515bc0 100644 (file)
@@ -27,6 +27,9 @@
 #include "lib/param/loadparm.h"
 #include "../lib/util/tevent_ntstatus.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static struct tevent_req *smbd_smb2_tree_connect_send(TALLOC_CTX *mem_ctx,
                                        struct tevent_context *ev,
                                        struct smbd_smb2_request *smb2req,
index 5657c6618d2e43ba8d4f86420d0fd848acba6f90..ee95bd317aefff1ad614b446ec6e179ab4918f07 100644 (file)
@@ -25,6 +25,9 @@
 #include "../lib/util/tevent_ntstatus.h"
 #include "rpc_server/srv_pipe_hnd.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_SMB2
+
 static struct tevent_req *smbd_smb2_write_send(TALLOC_CTX *mem_ctx,
                                               struct tevent_context *ev,
                                               struct smbd_smb2_request *smb2req,