mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-21 18:50:50 +01:00
nvmecontrol: Accept -a {1,2,3,4} for sanitize command for nvme-cli compat
Linux's `nvme sanititze -a` takes a number, not a string. Accept 1-4 for compatibility so vendor's recepies are easier to implmement. Sponsored by: Netflix
This commit is contained in:
parent
d5507f9e43
commit
a233cb6914
@ -572,6 +572,16 @@ A failed sanitize operation can only be exited if it was
|
||||
run in the unrestricted completion mode, as provided by the
|
||||
.Fl U
|
||||
argument.
|
||||
.It 1, 2, 3, 4
|
||||
nvme-cli compatible
|
||||
.Fl a
|
||||
values for
|
||||
.Dq exitfailure ,
|
||||
.Dq block ,
|
||||
.Dq overwrite ,
|
||||
and
|
||||
.Dq crypto
|
||||
respectively.
|
||||
.El
|
||||
.It Fl c Ar passes
|
||||
The number of passes when performing an
|
||||
|
@ -130,8 +130,11 @@ sanitize(const struct cmd *f, int argc, char *argv[])
|
||||
sanact = 3;
|
||||
else if (strcmp(opt.sanact, "crypto") == 0)
|
||||
sanact = 4;
|
||||
else if ((sanact = (int)strtol(opt.sanact, NULL, 10) != 0)
|
||||
&& (sanact >= 1 && sanact <= 4))
|
||||
; /* compat with nvme sanitize -a number */
|
||||
else {
|
||||
fprintf(stderr, "Incorrect Sanitize Action value\n");
|
||||
fprintf(stderr, "Incorrect Sanitize Action value: %s\n", opt.sanact);
|
||||
arg_help(argc, argv, f);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user