From f3b240da5c209a51fa43de23e8ecfea2f32bbfd5 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 21 Jun 2024 09:21:43 +1200 Subject: [PATCH] cmdline:burn: '-U' does not imply secrets without '%' We return true from this function when a secret has been erased, and were accidentally treating as if it had secrets. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15671 Signed-off-by: Douglas Bagnall Reviewed-by: Jo Sutton --- lib/cmdline/cmdline.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c index 93d59d4f9d3..8d5dc36e42b 100644 --- a/lib/cmdline/cmdline.c +++ b/lib/cmdline/cmdline.c @@ -182,9 +182,11 @@ bool samba_cmdline_burn(int argc, char *argv[]) if (is_user) { q = strchr_m(p, '%'); - if (q != NULL) { - p = q; + if (q == NULL) { + /* -U without '%' has no secret */ + continue; } + p = q; } else { p += ulen; } -- 2.47.2