]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smb: Modernize a few DEBUGs
authorVolker Lendecke <vl@samba.org>
Tue, 11 Nov 2025 06:20:20 +0000 (07:20 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 7 Jan 2026 09:57:40 +0000 (09:57 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/lib/sysquotas.c
source3/smbd/dfree.c
source3/smbd/smb1_trans2.c

index bdf88bf3ff0835c907bccf4532933b2ff5d611bb..1d0e77c4980dbfbc8eab0eb549bd5c5f8bf56770 100644 (file)
@@ -380,16 +380,20 @@ static int command_get_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t
                        TALLOC_FREE(lines);
                        lines = NULL;
 
-                       DEBUG (3, ("Parsed output of get_quota, ...\n"));
-
-                       DEBUGADD (5,(
-                               "qflags:%"PRIu32" curblocks:%"PRIu64" softlimit:%"PRIu64" hardlimit:%"PRIu64"\n"
-                               "curinodes:%"PRIu64" isoftlimit:%"PRIu64" ihardlimit:%"PRIu64" bsize:%"PRIu64"\n",
-                               dp->qflags,dp->curblocks,
-                               dp->softlimit,dp->hardlimit,
-                               dp->curinodes,
-                               dp->isoftlimit,dp->ihardlimit,
-                               dp->bsize));
+                       DBG_INFO("Parsed output of get_quota, ...\n"
+                                "qflags:%" PRIu32 " curblocks:%" PRIu64
+                                " softlimit:%" PRIu64 " hardlimit:%" PRIu64
+                                "\n"
+                                "curinodes:%" PRIu64 " isoftlimit:%" PRIu64
+                                " ihardlimit:%" PRIu64 " bsize:%" PRIu64 "\n",
+                                dp->qflags,
+                                dp->curblocks,
+                                dp->softlimit,
+                                dp->hardlimit,
+                                dp->curinodes,
+                                dp->isoftlimit,
+                                dp->ihardlimit,
+                                dp->bsize);
                        return 0;
                }
 
index b5ade95177c5e3f60e2d71b1bda796074b61449e..cdfeedfaddc1de12a8d87a0489c729228a627aaa 100644 (file)
@@ -98,7 +98,7 @@ static uint64_t sys_disk_free(connection_struct *conn,
                if (lines != NULL) {
                        char *line = lines[0];
 
-                       DEBUG (3, ("Read input from dfree, \"%s\"\n", line));
+                       DBG_NOTICE("Read input from dfree, \"%s\"\n", line);
 
                        *dsize = STR_TO_SMB_BIG_UINT(line, &p);
                        while (p && *p && isspace(*p))
@@ -112,8 +112,10 @@ static uint64_t sys_disk_free(connection_struct *conn,
                        else
                                *bsize = 1024;
                        TALLOC_FREE(lines);
-                       DEBUG (3, ("Parsed output of dfree, dsize=%u, dfree=%u, bsize=%u\n",
-                               (unsigned int)*dsize, (unsigned int)*dfree, (unsigned int)*bsize));
+
+                       DBG_NOTICE("Parsed output of dfree, dsize=%"PRIu64", "
+                                  "dfree=%"PRIu64", bsize=%"PRIu64"\n",
+                                  *dsize, *dfree, *bsize);
 
                        if (!*dsize)
                                *dsize = 2048;
@@ -149,7 +151,9 @@ static uint64_t sys_disk_free(connection_struct *conn,
 
        /* FIXME : Any reason for this assumption ? */
        if (*bsize < 256) {
-               DEBUG(5,("disk_free:Warning: bsize == %d < 256 . Changing to assumed correct bsize = 512\n",(int)*bsize));
+               DBG_INFO("Warning: bsize == %"PRIu64" < 256 . "
+                        "Changing to assumed correct bsize = 512\n",
+                        *bsize);
                *bsize = 512;
        }
 
index 0fd72e6c724433e9324e04a1abe1bef7d0622bca..8843e0dd3fdb3b1e1a1f22d94c629c5dd3566367 100644 (file)
@@ -1651,15 +1651,15 @@ static void call_trans2qfsinfo(connection_struct *conn,
 
        if (ENCRYPTION_REQUIRED(conn) && !req->encrypted) {
                if (info_level != SMB_QUERY_CIFS_UNIX_INFO) {
-                       DEBUG(0,("call_trans2qfsinfo: encryption required "
-                               "and info level 0x%x sent.\n",
-                               (unsigned int)info_level));
+                       DBG_WARNING("encryption required "
+                                   "and info level 0x%" PRIx16 " sent.\n",
+                                   info_level);
                        reply_nterror(req, NT_STATUS_ACCESS_DENIED);
                        return;
                }
        }
 
-       DEBUG(3,("call_trans2qfsinfo: level = %d\n", info_level));
+       DBG_NOTICE("level = %" PRIu16 "\n", info_level);
 
        status = smbd_do_qfsinfo(req->xconn, conn, req,
                                 info_level,
@@ -1677,8 +1677,9 @@ static void call_trans2qfsinfo(connection_struct *conn,
        send_trans2_replies(conn, req, NT_STATUS_OK, params, 0, *ppdata, data_len,
                            max_data_bytes);
 
-       DEBUG( 4, ( "%s info_level = %d\n",
-                   smb_fn_name(req->cmd), info_level) );
+       DBG_NOTICE("%s info_level = %" PRIu16 "\n",
+                  smb_fn_name(req->cmd),
+                  info_level);
 
        return;
 }