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:
Milan Broz
2009-07-11 07:09:05 +00:00
parent c0d99e98e4
commit 0bc3ffae8b
3 changed files with 16 additions and 9 deletions

View File

@@ -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 {