From: Volker Lendecke Date: Mon, 15 Sep 2025 00:04:03 +0000 (-0700) Subject: smbd: Modernize DEBUGs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82fc3d29cffddbe776ff0723d4753b30b4838897;p=thirdparty%2Fsamba.git smbd: Modernize DEBUGs Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c index b47ef613de6..8f99911df40 100644 --- a/source3/modules/nfs4_acls.c +++ b/source3/modules/nfs4_acls.c @@ -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; } diff --git a/source3/smbd/smb1_nttrans.c b/source3/smbd/smb1_nttrans.c index 3539a9f8f03..2b95c84bd25 100644 --- a/source3/smbd/smb1_nttrans.c +++ b/source3/smbd/smb1_nttrans.c @@ -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: { diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c index 253507f4c14..f2fa62f4e9d 100644 --- a/source3/smbd/smb1_trans2.c +++ b/source3/smbd/smb1_trans2.c @@ -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); diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index 8d52e31c4f5..48860a95966 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -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);