The Samba-Bugzilla – Attachment 18580 Details for
Bug 15737
Changes from DEBUGC/DEBUGADDC to talloc_asprintf ignoring debug level - performance drops
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch v3
15737_patch_v3.txt (text/plain), 2.89 KB, created by
Douglas Bagnall
on 2025-02-20 22:00:01 UTC
(
hide
)
Description:
patch v3
Filename:
MIME Type:
Creator:
Douglas Bagnall
Created:
2025-02-20 22:00:01 UTC
Size:
2.89 KB
patch
obsolete
>From 5ae1aed7e7f05f7e46da93207c2d4a3046f0e47f Mon Sep 17 00:00:00 2001 >From: Volker Lendecke <vl@samba.org> >Date: Mon, 14 Oct 2024 13:29:21 +0200 >Subject: [PATCH 1/2] libcli: avoid work in security token debug no-op > >When the debug level is too low to print, we don't need to allocate >the strings. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=15737 > >Signed-off-by: Volker Lendecke <vl@samba.org> >Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >--- > libcli/security/security_token.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > >diff --git a/libcli/security/security_token.c b/libcli/security/security_token.c >index 0218eed1722..a79f5925ea2 100644 >--- a/libcli/security/security_token.c >+++ b/libcli/security/security_token.c >@@ -80,17 +80,22 @@ struct security_token *security_token_duplicate(TALLOC_CTX *mem_ctx, const struc > ****************************************************************************/ > void security_token_debug(int dbg_class, int dbg_lev, const struct security_token *token) > { >- TALLOC_CTX *frame = talloc_stackframe(); >+ TALLOC_CTX *frame = NULL; > char *sids = NULL; > char *privs = NULL; > uint32_t i; > >- if (!token) { >- DEBUGC(dbg_class, dbg_lev, ("Security token: (NULL)\n")); >- TALLOC_FREE(frame); >+ if (!CHECK_DEBUGLVLC(dbg_class, dbg_lev)) { > return; > } > >+ if (!token) { >+ DEBUGC(dbg_class, dbg_lev, ("Security token: (NULL)\n")); >+ return; >+ } >+ >+ frame = talloc_stackframe(); >+ > sids = talloc_asprintf(frame, > "Security token SIDs (%" PRIu32 "):\n", > token->num_sids); >-- >2.43.0 > > >From 16b48cd828247ef8c61c8647eed92b8c4ddd7939 Mon Sep 17 00:00:00 2001 >From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Date: Fri, 21 Feb 2025 10:51:33 +1300 >Subject: [PATCH 2/2] smbd: avoid work in unix token debug no-op > >When the debug level is too low to print, we don't need to allocate >the strings. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=15737 > >Signed-off-by: Volker Lendecke <vl@samba.org> >Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Pair-programmed-with: Volker Lendecke <vl@samba.org> >--- > source3/auth/token_util.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c >index 023ad7cbb02..4dd8036616b 100644 >--- a/source3/auth/token_util.c >+++ b/source3/auth/token_util.c >@@ -888,10 +888,16 @@ NTSTATUS finalize_local_nt_token(struct security_token *result, > void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid, > int n_groups, gid_t *groups) > { >- TALLOC_CTX *frame = talloc_stackframe(); >+ TALLOC_CTX *frame = NULL; > char *s = NULL; > int i; > >+ if (!CHECK_DEBUGLVLC(dbg_class, dbg_lev)) { >+ return; >+ } >+ >+ frame = talloc_stackframe(); >+ > s = talloc_asprintf(frame, > "UNIX token of user %ld\n", > (long int)uid); >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15737
:
18475
|
18477
| 18580