From: Volker Lendecke Date: Tue, 11 Nov 2025 06:20:20 +0000 (+0100) Subject: smb: Modernize a few DEBUGs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8302d6ef6ddfff9bbbf19f47d3a360287028b20e;p=thirdparty%2Fsamba.git smb: Modernize a few DEBUGs Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c index bdf88bf3ff0..1d0e77c4980 100644 --- a/source3/lib/sysquotas.c +++ b/source3/lib/sysquotas.c @@ -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; } diff --git a/source3/smbd/dfree.c b/source3/smbd/dfree.c index b5ade95177c..cdfeedfaddc 100644 --- a/source3/smbd/dfree.c +++ b/source3/smbd/dfree.c @@ -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; } diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c index 0fd72e6c724..8843e0dd3fd 100644 --- a/source3/smbd/smb1_trans2.c +++ b/source3/smbd/smb1_trans2.c @@ -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; }