]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
cmdline:burn: add a note about short option combinations
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 2 Jul 2024 23:50:43 +0000 (11:50 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 3 Jul 2024 01:35:31 +0000 (01:35 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15674

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
lib/cmdline/cmdline.c

index 730aaa53a8eea1ce22b559d8779b18b117958898..0f453b6c8be31e8cd2fbbc3280db935931af5946 100644 (file)
@@ -236,6 +236,22 @@ bool samba_cmdline_burn(int argc, char *argv[])
                }
 
                if (strncmp(p, "-U", 2) == 0) {
+                       /*
+                        * Note: this won't catch combinations of
+                        * short options like
+                        * `samba-tool -NUAdministrator%...`, which is
+                        * not possible in general outside of the
+                        * actual parser (consider for example
+                        * `-NHUroot%password`, which parses as
+                        * `-N -H 'Uroot%password'`). We don't know
+                        * here which short options might take
+                        * arguments.
+                        *
+                        * This is an argument for embedding redaction
+                        * inside the parser (e.g. by adding a flag to
+                        * the option definitions), but we decided not
+                        * to do that in order to share cmdline_burn().
+                        */
                        ulen = 2;
                        found = true;
                        is_user = true;