From: Douglas Bagnall Date: Thu, 20 Jun 2024 21:21:43 +0000 (+1200) Subject: cmdline:burn: '-U' does not imply secrets without '%' X-Git-Tag: samba-4.19.8~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efd989ac3e0730b54a6812ee8426da7ea4cbc581;p=thirdparty%2Fsamba.git 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 (cherry picked from commit f3b240da5c209a51fa43de23e8ecfea2f32bbfd5) --- diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c index db962146bd2..aaaff446979 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; }