]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Modernize a few DEBUGs
authorVolker Lendecke <vl@samba.org>
Tue, 14 May 2024 14:20:03 +0000 (16:20 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 15 May 2024 16:51:39 +0000 (16:51 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/locking.c
source3/smbd/close.c

index fa1c85afe919488d807e83ee7dae37bbb1d1f7e2..25735a3083dd186690730e0d19f7cda5b281b501 100644 (file)
@@ -158,12 +158,14 @@ bool strict_lock_check_default(files_struct *fsp, struct lock_struct *plock)
                TALLOC_FREE(br_lck);
        }
 
-       DEBUG(10, ("strict_lock_default: flavour = %s brl start=%ju "
-                  "len=%ju %s for fnum %ju file %s\n",
-                  lock_flav_name(plock->lock_flav),
-                  (uintmax_t)plock->start, (uintmax_t)plock->size,
-                  ret ? "unlocked" : "locked",
-                  (uintmax_t)plock->fnum, fsp_str_dbg(fsp)));
+       DBG_DEBUG("flavour = %s brl start=%" PRIu64 " "
+                 "len=%" PRIu64 " %s for fnum %" PRIu64 " file %s\n",
+                 lock_flav_name(plock->lock_flav),
+                 plock->start,
+                 plock->size,
+                 ret ? "unlocked" : "locked",
+                 plock->fnum,
+                 fsp_str_dbg(fsp));
 
        return ret;
 }
@@ -583,8 +585,9 @@ bool rename_share_filename(struct messaging_context *msg_ctx,
        NTSTATUS status;
        bool ok;
 
-       DEBUG(10, ("rename_share_filename: servicepath %s newname %s\n",
-                  servicepath, smb_fname_dst->base_name));
+       DBG_DEBUG("servicepath %s newname %s\n",
+                 servicepath,
+                 smb_fname_dst->base_name);
 
        status = share_mode_lock_access_private_data(lck, &d);
        if (!NT_STATUS_IS_OK(status)) {
index 90c28158322cab59ae72c9347ad5809e1a9f4005..5cb2bb6f17c2dcba5147fdb42187f1edefaffce8 100644 (file)
@@ -473,8 +473,8 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
         */
        lck_state.cleanup_fn = close_share_mode_lock_cleanup;
 
-       DEBUG(5,("close_remove_share_mode: file %s. Delete on close was set "
-                "- deleting file.\n", fsp_str_dbg(fsp)));
+       DBG_INFO("%s. Delete on close was set - deleting file.\n",
+                fsp_str_dbg(fsp));
 
        /*
         * Don't try to update the write time when we delete the file
@@ -486,10 +486,9 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
        {
                /* Become the user who requested the delete. */
 
-               DEBUG(5,("close_remove_share_mode: file %s. "
-                       "Change user to uid %u\n",
-                       fsp_str_dbg(fsp),
-                       (unsigned int)lck_state.del_token->uid));
+               DBG_INFO("file %s. Change user to uid %u\n",
+                        fsp_str_dbg(fsp),
+                        (unsigned int)lck_state.del_token->uid);
 
                if (!push_sec_ctx()) {
                        smb_panic("close_remove_share_mode: file %s. failed to push "
@@ -510,9 +509,10 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
 
        tmp_status = vfs_stat_fsp(fsp);
        if (!NT_STATUS_IS_OK(tmp_status)) {
-               DEBUG(5,("close_remove_share_mode: file %s. Delete on close "
+               DBG_INFO("file %s. Delete on close "
                         "was set and stat failed with error %s\n",
-                        fsp_str_dbg(fsp), nt_errstr(tmp_status)));
+                        fsp_str_dbg(fsp),
+                        nt_errstr(tmp_status));
                /*
                 * Don't save the errno here, we ignore this error
                 */
@@ -523,14 +523,13 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
 
        if (!file_id_equal(&fsp->file_id, &id)) {
                struct file_id_buf ftmp1, ftmp2;
-               DEBUG(5,("close_remove_share_mode: file %s. Delete on close "
+               DBG_INFO("file %s. Delete on close "
                         "was set and dev and/or inode does not match\n",
-                        fsp_str_dbg(fsp)));
-               DEBUG(5,("close_remove_share_mode: file %s. stored file_id %s, "
-                        "stat file_id %s\n",
+                        fsp_str_dbg(fsp));
+               DBG_INFO("file %s. stored file_id %s, stat file_id %s\n",
                         fsp_str_dbg(fsp),
                         file_id_str_buf(fsp->file_id, &ftmp1),
-                        file_id_str_buf(id, &ftmp2)));
+                        file_id_str_buf(id, &ftmp2));
                /*
                 * Don't save the errno here, we ignore this error
                 */
@@ -588,9 +587,10 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
                 * zero.
                 */
 
-               DEBUG(5,("close_remove_share_mode: file %s. Delete on close "
+               DBG_INFO("file %s. Delete on close "
                         "was set and unlink failed with error %s\n",
-                        fsp_str_dbg(fsp), strerror(errno)));
+                        fsp_str_dbg(fsp),
+                        strerror(errno));
 
                status = map_nt_error_from_unix(errno);
        }