]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Modernize DEBUGs
authorVolker Lendecke <vl@samba.org>
Mon, 15 Sep 2025 00:04:03 +0000 (17:04 -0700)
committerRalph Boehme <slow@samba.org>
Tue, 21 Oct 2025 17:33:29 +0000 (17:33 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/nfs4_acls.c
source3/smbd/smb1_nttrans.c
source3/smbd/smb1_trans2.c
source3/smbd/smb2_trans2.c

index b47ef613de6c3a2e8dfce4d2992c4b1fd69ed4f7..8f99911df40efb8defbaf9c75abbbedb1d96a05c 100644 (file)
@@ -326,7 +326,7 @@ struct SMB4ACL_T *smb_create_smb4acl(TALLOC_CTX *mem_ctx)
        theacl = talloc_zero(mem_ctx, struct SMB4ACL_T);
        if (theacl==NULL)
        {
-               DEBUG(0, ("TALLOC_SIZE failed\n"));
+               DBG_ERR("talloc_zero failed\n");
                errno = ENOMEM;
                return NULL;
        }
index 3539a9f8f03ab2ba4ee2742572c3f0208ba04ec3..2b95c84bd25614a8ad9662c3eaa009ecf98e2cc9 100644 (file)
@@ -1551,9 +1551,10 @@ void reply_ntrename(struct smb_request *req)
                }
        }
 
-       DEBUG(3,("reply_ntrename: %s -> %s\n",
-                smb_fname_str_dbg(smb_fname_old),
-                smb_fname_str_dbg(smb_fname_new)));
+       DBG_NOTICE("%s -> %s, type=%" PRIx16 "\n",
+                  smb_fname_str_dbg(smb_fname_old),
+                  smb_fname_str_dbg(smb_fname_new),
+                  rename_type);
 
        switch(rename_type) {
        case RENAME_FLAG_RENAME: {
index 253507f4c14318c4dfa1183af4fa8da99d93aae5..f2fa62f4e9d358a5f3e88fcaa302a68a80f64f99 100644 (file)
@@ -3743,8 +3743,9 @@ static NTSTATUS smb_set_file_unix_hlink(connection_struct *conn,
                return status;
        }
 
-       DEBUG(10,("smb_set_file_unix_hlink: SMB_SET_FILE_UNIX_LINK doing hard link %s -> %s\n",
-               smb_fname_str_dbg(smb_fname_new), oldname));
+       DBG_DEBUG("SMB_SET_FILE_UNIX_LINK doing hard link %s -> %s\n",
+                 smb_fname_str_dbg(smb_fname_new),
+                 oldname);
 
        if (ucf_flags & UCF_GMT_PATHNAME) {
                extract_snapshot_token(oldname, &old_twrp);
index 8d52e31c4f5573fe0950a995803b1417c9db71e6..48860a95966326ceee5a3cf8e7735cd8986fc5b4 100644 (file)
@@ -3769,8 +3769,9 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
                }
        }
 
-       DEBUG(10,("hardlink_internals: doing hard link %s -> %s\n",
-                 smb_fname_old->base_name, smb_fname_new->base_name));
+       DBG_DEBUG("doing hard link %s -> %s\n",
+                 smb_fname_old->base_name,
+                 smb_fname_new->base_name);
 
        ret = SMB_VFS_LINKAT(conn,
                        parent_fname_old->fsp,
@@ -3781,9 +3782,10 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
 
        if (ret != 0) {
                status = map_nt_error_from_unix(errno);
-               DEBUG(3,("hardlink_internals: Error %s hard link %s -> %s\n",
-                        nt_errstr(status), smb_fname_old->base_name,
-                        smb_fname_new->base_name));
+               DBG_NOTICE("Error %s hard link %s -> %s\n",
+                          nt_errstr(status),
+                          smb_fname_old->base_name,
+                          smb_fname_new->base_name);
                goto out;
        }
 
@@ -4504,8 +4506,10 @@ static NTSTATUS smb2_file_link_information(connection_struct *conn,
        }
 
        DBG_DEBUG("SMB_FILE_LINK_INFORMATION (%s) %s -> %s\n",
-                 fsp_fnum_dbg(fsp), fsp_str_dbg(fsp),
+                 fsp_fnum_dbg(fsp),
+                 fsp_str_dbg(fsp),
                  smb_fname_str_dbg(smb_fname_dst));
+
        status = hardlink_internals(ctx,
                                conn,
                                req,
@@ -4573,8 +4577,7 @@ static NTSTATUS smb_file_link_information(connection_struct *conn,
                return status;
        }
 
-       DEBUG(10,("smb_file_link_information: got name |%s|\n",
-                               newname));
+       DBG_DEBUG("got name |%s|\n", newname);
 
        if (ucf_flags & UCF_GMT_PATHNAME) {
                extract_snapshot_token(newname, &dst_twrp);
@@ -4598,10 +4601,11 @@ static NTSTATUS smb_file_link_information(connection_struct *conn,
                return NT_STATUS_NOT_SUPPORTED;
        }
 
-       DEBUG(10,("smb_file_link_information: "
-                 "SMB_FILE_LINK_INFORMATION (%s) %s -> %s\n",
-                 fsp_fnum_dbg(fsp), fsp_str_dbg(fsp),
-                 smb_fname_str_dbg(smb_fname_dst)));
+       DBG_DEBUG("SMB_FILE_LINK_INFORMATION (%s) %s -> %s\n",
+                 fsp_fnum_dbg(fsp),
+                 fsp_str_dbg(fsp),
+                 smb_fname_str_dbg(smb_fname_dst));
+
        status = hardlink_internals(ctx,
                                conn,
                                req,
@@ -5073,10 +5077,11 @@ NTSTATUS smbd_do_setfilepathinfo(connection_struct *conn,
 
        *ret_data_size = 0;
 
-       DEBUG(3,("smbd_do_setfilepathinfo: %s (%s) info_level=%d "
-                "totdata=%d\n", smb_fname_str_dbg(smb_fname),
-                fsp_fnum_dbg(fsp),
-                info_level, total_data));
+       DBG_NOTICE("%s (%s) info_level=%d totdata=%d\n",
+                  smb_fname_str_dbg(smb_fname),
+                  fsp_fnum_dbg(fsp),
+                  info_level,
+                  total_data);
 
        SMB_ASSERT(fsp != NULL);