mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-14 12:20:00 +01:00
Reject unsupported --offset and --skip options for luksFormat and update man page.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@63 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
@@ -264,6 +264,12 @@ static int action_luksFormat(int arg)
|
||||
|
||||
int r = 0; char *msg = NULL;
|
||||
|
||||
/* Avoid overwriting possibly wrong part of device than user requested by rejecting these options */
|
||||
if (opt_offset || opt_skip) {
|
||||
fprintf(stderr,"Options --offset and --skip are not supported for luksFormat.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if(asprintf(&msg, _("This will overwrite data on %s irrevocably."), options.device) == -1) {
|
||||
fputs(_("memory allocation error in action_luksFormat"), stderr);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user