lib/cmdline: Also burn the --password2 parameter if given
authorAndrew Bartlett <abartlet@samba.org>
Fri, 21 Jul 2023 02:35:20 +0000 (14:35 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 21 Jul 2023 05:23:32 +0000 (05:23 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15289

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/cmdline/cmdline.c

index 9ee2d2af954eb7108b83907f6c4dcd48a4e7db6e..dba6292b3185fecdcaa13cfb8927446b3b7a8034 100644 (file)
@@ -150,6 +150,10 @@ bool samba_cmdline_burn(int argc, char *argv[])
                        return false;
                }
 
+               /*
+                * Take care that this list must be in longest-match
+                * first order
+                */
                if (strncmp(p, "-U", 2) == 0) {
                        ulen = 2;
                        found = true;
@@ -158,6 +162,9 @@ bool samba_cmdline_burn(int argc, char *argv[])
                        ulen = 6;
                        found = true;
                        is_user = true;
+               } else if (strncmp(p, "--password2", 11) == 0) {
+                       ulen = 11;
+                       found = true;
                } else if (strncmp(p, "--password", 10) == 0) {
                        ulen = 10;
                        found = true;