]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
cmdline:burn: '-U' does not imply secrets without '%'
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 20 Jun 2024 21:21:43 +0000 (09:21 +1200)
committerJule Anger <janger@samba.org>
Tue, 23 Jul 2024 07:32:13 +0000 (07:32 +0000)
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 <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit f3b240da5c209a51fa43de23e8ecfea2f32bbfd5)

lib/cmdline/cmdline.c

index db962146bd27502d5ff91af3ddd09577c12a9222..aaaff4469790f83a47d2d36ab24dca4a992db1f3 100644 (file)
@@ -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;
                        }