]> sourceware.org Git - lvm2.git/commitdiff
vgchange: require confirmation with -c and no VGs
authorAlasdair G Kergon <agk@redhat.com>
Tue, 13 Aug 2013 17:20:11 +0000 (18:20 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Tue, 13 Aug 2013 17:20:11 +0000 (18:20 +0100)
Too many people have been running 'vgchange -cy' by mistake
so add a confirmation prompt.  Use --yes to bypass this.

WHATS_NEW
tools/vgchange.c

index b1f379bb940759c7b1a9df6f6520b0cf8f3bb8dd..49360b2ff46015db2f6b052da2ccab9568cb5de4 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.101 - 
 ===================================
+  Require confirmation for vgchange -c when no VGs listed explicitly.
   Also skip /var and /var/log by default in blkdeactivate when unmounting.
   Add support for bind mounts in blkdeactivate.
   Add blkdeactivate -v/--verbose for debug output from external tools used.
index d41ef49a7687b19187eb6c0b0b582494f51d2464..4087fab5715c3cd571fbea24db363681fdb91b06 100644 (file)
@@ -623,6 +623,12 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
                return ECMD_PROCESSED;
        }
 
+       if (arg_count(cmd, clustered_ARG) && !argc && !arg_count(cmd, yes_ARG) &&
+           (yes_no_prompt("Change clustered property of all volumes groups? [y/n]: ") == 'n')) {
+               log_error("No volume groups changed.");
+               return ECMD_FAILED;
+       }
+
        if (!update || !update_partial_unsafe)
                cmd->handles_missing_pvs = 1;
 
This page took 0.045329 seconds and 5 git commands to generate.