mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
[9.18] fix: usr: Restore values when dig prints command line
Options of the form `[+-]option=<value>` failed to display the value on the printed command line. This has been fixed. Closes #4993 Backport of MR !9653 Merge branch 'backport-4993-dig-restore-command-line-values-9.18' into 'bind-9.18' See merge request isc-projects/bind9!9667
This commit is contained in:
commit
002141af2e
1 changed files with 13 additions and 3 deletions
|
|
@ -1480,9 +1480,12 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
|||
"specified");
|
||||
goto exit_or_usage;
|
||||
}
|
||||
extra = strtok_r(NULL, "\0",
|
||||
extra = strtok_r(NULL, "",
|
||||
&last);
|
||||
save_opt(lookup, code, extra);
|
||||
if (extra != NULL) {
|
||||
extra[-1] = ':';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
goto invalid_option;
|
||||
|
|
@ -2206,6 +2209,9 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
|||
fprintf(stderr, "Invalid option: +%s\n", option);
|
||||
usage();
|
||||
}
|
||||
if (value != NULL) {
|
||||
value[-1] = '=';
|
||||
}
|
||||
return (lookup);
|
||||
|
||||
#if !TARGET_OS_IPHONE
|
||||
|
|
@ -2467,8 +2473,8 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
* secret */
|
||||
usage();
|
||||
}
|
||||
if ((ptr3 = strtok_r(NULL, ":", &last)) != NULL) { /* secret or
|
||||
* NULL */
|
||||
if ((ptr3 = strtok_r(NULL, "", &last)) != NULL) { /* secret or
|
||||
* NULL */
|
||||
parse_hmac(ptr);
|
||||
ptr = ptr2;
|
||||
ptr2 = ptr3;
|
||||
|
|
@ -2479,6 +2485,10 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
/* XXXONDREJ: FIXME */
|
||||
strlcpy(keynametext, ptr, sizeof(keynametext));
|
||||
strlcpy(keysecret, ptr2, sizeof(keysecret));
|
||||
if (ptr3 != NULL) {
|
||||
ptr[-1] = ':';
|
||||
}
|
||||
ptr2[-1] = ':';
|
||||
return (value_from_next);
|
||||
case 'x':
|
||||
if (*need_clone) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue