]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Modernize DEBUGs
authorVolker Lendecke <vl@samba.org>
Sat, 23 Nov 2024 13:01:18 +0000 (14:01 +0100)
committerMartin Schwenke <martins@samba.org>
Mon, 2 Dec 2024 04:53:33 +0000 (04:53 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/smbd/dir.c
source3/smbd/file_access.c
source3/smbd/smb2_trans2.c

index 451e21b62af38dca5b1cb5e85ab497f82a608e74..8ec2b8b4ea392d1fba4a647280067c2751e8c5c0 100644 (file)
@@ -211,7 +211,7 @@ NTSTATUS dptr_create(connection_struct *conn,
        DBG_INFO("dir=%s\n", fsp_str_dbg(fsp));
 
        if (sconn == NULL) {
-               DEBUG(0,("dptr_create: called with fake connection_struct\n"));
+               DBG_ERR("called with fake connection_struct\n");
                return NT_STATUS_INTERNAL_ERROR;
        }
 
@@ -221,9 +221,8 @@ NTSTATUS dptr_create(connection_struct *conn,
 
        status = check_any_access_fsp(fsp, SEC_DIR_LIST);
        if (!NT_STATUS_IS_OK(status)) {
-               DBG_INFO("dptr_create: directory %s "
-                       "not open for LIST access\n",
-                       fsp_str_dbg(fsp));
+               DBG_INFO("directory %s not open for LIST access\n",
+                        fsp_str_dbg(fsp));
                return status;
        }
        status = OpenDir_fsp(NULL, conn, fsp, wcard, attr, &dir_hnd);
@@ -233,7 +232,7 @@ NTSTATUS dptr_create(connection_struct *conn,
 
        dptr = talloc_zero(NULL, struct dptr_struct);
        if(!dptr) {
-               DEBUG(0,("talloc fail in dptr_create.\n"));
+               DBG_ERR("talloc failed\n");
                TALLOC_FREE(dir_hnd);
                return NT_STATUS_NO_MEMORY;
        }
index 9928eb997507d175a1853560b75af024e979e1d0..e177ed4bf9fb30563f040442ce9531343909f6fe 100644 (file)
@@ -103,10 +103,9 @@ bool can_delete_file_in_directory(connection_struct *conn,
                if ((get_current_uid(conn) !=
                        smb_fname_parent->st.st_ex_uid) &&
                    (get_current_uid(conn) != smb_fname->st.st_ex_uid)) {
-                       DEBUG(10,("can_delete_file_in_directory: not "
-                                 "owner of file %s or directory %s\n",
+                       DBG_DEBUG("not owner of file %s or directory %s\n",
                                  smb_fname_str_dbg(smb_fname),
-                                 smb_fname_str_dbg(smb_fname_parent)));
+                                 smb_fname_str_dbg(smb_fname_parent));
                        ret = false;
                        goto out;
                }
index 125a8b4831ffe1a5d77237a36f4d39706ce5a6be..b6f2e23cd8d15b88c8e361a476722de5fe67c74f 100644 (file)
@@ -4248,9 +4248,9 @@ static NTSTATUS smb_file_position_information(connection_struct *conn,
 
        position_information = PULL_LE_U64(pdata, 0);
 
-       DEBUG(10,("smb_file_position_information: Set file position "
-                 "information for file %s to %.0f\n", fsp_str_dbg(fsp),
-                 (double)position_information));
+       DBG_DEBUG("Set file position information for file %s to %" PRIu64 "\n",
+                 fsp_str_dbg(fsp),
+                 position_information);
        fh_set_position_information(fsp->fh, position_information);
        return NT_STATUS_OK;
 }
@@ -4675,8 +4675,7 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
                return status;
        }
 
-       DEBUG(10,("smb_file_rename_information: got name |%s|\n",
-                               newname));
+       DBG_DEBUG("got name |%s|\n", newname);
 
        /* Check the new name has no '/' characters. */
        if (strchr_m(newname, '/')) {
@@ -4783,10 +4782,10 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
        }
 
        if (fsp != NULL && fsp->fsp_flags.is_fsa) {
-               DEBUG(10,("smb_file_rename_information: "
-                         "SMB_FILE_RENAME_INFORMATION (%s) %s -> %s\n",
-                         fsp_fnum_dbg(fsp), fsp_str_dbg(fsp),
-                         smb_fname_str_dbg(smb_fname_dst)));
+               DBG_DEBUG("SMB_FILE_RENAME_INFORMATION (%s) %s -> %s\n",
+                         fsp_fnum_dbg(fsp),
+                         fsp_str_dbg(fsp),
+                         smb_fname_str_dbg(smb_fname_dst));
 
                /*
                 * If no pathnames are open below this directory,
@@ -4805,10 +4804,9 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
                                        0,
                                        overwrite);
        } else {
-               DEBUG(10,("smb_file_rename_information: "
-                         "SMB_FILE_RENAME_INFORMATION %s -> %s\n",
+               DBG_DEBUG("SMB_FILE_RENAME_INFORMATION %s -> %s\n",
                          smb_fname_str_dbg(smb_fname_src),
-                         smb_fname_str_dbg(smb_fname_dst)));
+                         smb_fname_str_dbg(smb_fname_dst));
                status = rename_internals(ctx,
                                        conn,
                                        req,
@@ -4914,8 +4912,7 @@ static NTSTATUS smb_set_info_standard(connection_struct *conn,
        /* write time */
        ft.mtime = time_t_to_full_timespec(srv_make_unix_date2(pdata+8));
 
-       DEBUG(10,("smb_set_info_standard: file %s\n",
-               smb_fname_str_dbg(smb_fname)));
+       DBG_DEBUG("file %s\n", smb_fname_str_dbg(smb_fname));
 
        status = check_any_access_fsp(fsp, FILE_WRITE_ATTRIBUTES);
        if (!NT_STATUS_IS_OK(status)) {
@@ -4957,17 +4954,17 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
        }
 
        allocation_size = PULL_LE_U64(pdata, 0);
-       DEBUG(10,("smb_set_file_allocation_info: Set file allocation info for "
-                 "file %s to %.0f\n", smb_fname_str_dbg(smb_fname),
-                 (double)allocation_size));
+       DBG_DEBUG("Set file allocation info for file %s to %" PRIu64 "\n",
+                 smb_fname_str_dbg(smb_fname),
+                 allocation_size);
 
        if (allocation_size) {
                allocation_size = smb_roundup(conn, allocation_size);
        }
 
-       DEBUG(10,("smb_set_file_allocation_info: file %s : setting new "
-                 "allocation size to %.0f\n", smb_fname_str_dbg(smb_fname),
-                 (double)allocation_size));
+       DBG_DEBUG("file %s : setting new allocation size to %" PRIu64 "\n",
+                 smb_fname_str_dbg(smb_fname),
+                 allocation_size);
 
        if (!fsp->fsp_flags.is_pathref && (fsp_get_io_fd(fsp) != -1)) {
                /* Open file handle. */