From: Douglas Bagnall Date: Tue, 2 Jul 2024 23:50:43 +0000 (+1200) Subject: cmdline:burn: add a note about short option combinations X-Git-Tag: samba-4.19.8~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e35d6aeb4eb2a926dea0cf3f7e210553469deeb3;p=thirdparty%2Fsamba.git cmdline:burn: add a note about short option combinations BUG: https://bugzilla.samba.org/show_bug.cgi?id=15674 Signed-off-by: Douglas Bagnall Reviewed-by: Jo Sutton (cherry picked from commit 97be45f9ea3410392cd37eab5cfafd3ad00cfe57) --- diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c index 81f37774dca..3eabedfc1d8 100644 --- a/lib/cmdline/cmdline.c +++ b/lib/cmdline/cmdline.c @@ -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;