]> 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)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 3 Jul 2024 01:35:31 +0000 (01:35 +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>
lib/cmdline/cmdline.c

index 93d59d4f9d34ff93c891e9e91fd0a02ea2e2c959..8d5dc36e42b0404e12e1322addf25987a56c7d86 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;
                        }