From 771db939ad31ca99873c8ac22314556905d898cc Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Mon, 31 Aug 2009 17:03:10 +0000 Subject: [PATCH] * Replace not safe option --non-exclusive with --disable-uuid. (just formal change, code already contains the change) Signed-off-by: Milan Broz git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@101 36d66b0a-2a48-0410-832c-cd162a569da5 --- ChangeLog | 1 + man/cryptsetup.8 | 3 +++ src/cryptsetup.c | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2854b41..dd6fe96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ * Implement old API calls using new functions. * Remove old API code helper functions. * Add --master-key-file option for luksFormat and luksAddKey. + * Replace not safe option --non-exclusive with --disable-uuid. 2009-08-17 Milan Broz * Fix PBKDF2 speed calculation for large passhrases. diff --git a/man/cryptsetup.8 b/man/cryptsetup.8 index fcac832..30b9f54 100644 --- a/man/cryptsetup.8 +++ b/man/cryptsetup.8 @@ -134,6 +134,9 @@ This option is only relevant for \fIcreate\fR action. .B "\-\-readonly" set up a read-only mapping. .TP +.B "\-\-disable-uuid" +Activate device without UUID. Useful for \fIluksOpen\fR to activate cloned LUKS device or its snapshot. +.TP .B "\-\-iter-time, \-i" The number of milliseconds to spend with PBKDF2 password processing. This option is only relevant to the LUKS operations as \fIluksFormat\fR or \fIluksAddKey\fR. .TP diff --git a/src/cryptsetup.c b/src/cryptsetup.c index 12c7e5f..253a420 100644 --- a/src/cryptsetup.c +++ b/src/cryptsetup.c @@ -34,7 +34,7 @@ static int opt_version_mode = 0; static int opt_timeout = 0; static int opt_tries = 3; static int opt_align_payload = 0; -static int opt_non_exclusive = 0; +static int opt_disable_uuid = 0; static const char **action_argv; static int action_argc; @@ -371,7 +371,7 @@ static int action_luksOpen(int arg) if (opt_readonly) options.flags |= CRYPT_FLAG_READONLY; - if (opt_non_exclusive) + if (opt_disable_uuid) /* Abuse old flag */ options.flags |= CRYPT_FLAG_NON_EXCLUSIVE_ACCESS; return crypt_luksOpen(&options); } @@ -598,7 +598,7 @@ int main(int argc, char **argv) { "timeout", 't', POPT_ARG_INT, &opt_timeout, 0, N_("Timeout for interactive passphrase prompt (in seconds)"), N_("secs") }, { "tries", 'T', POPT_ARG_INT, &opt_tries, 0, N_("How often the input of the passphrase canbe retried"), NULL }, { "align-payload", '\0', POPT_ARG_INT, &opt_align_payload, 0, N_("Align payload at sector boundaries - for luksFormat"), N_("SECTORS") }, - { "non-exclusive", '\0', POPT_ARG_NONE, &opt_non_exclusive, 0, N_("Allows non-exclusive access for luksOpen, WARNING see manpage."), NULL }, + { "disable-uuid", '\0', POPT_ARG_NONE, &opt_disable_uuid, 0, N_("Do not set UUID for device luksOpen."), NULL }, POPT_TABLEEND }; poptContext popt_context; -- 2.7.4