]> sourceware.org Git - lvm2.git/commitdiff
Do not allow users to change permissions on RAID sub-LVs.
authorJonathan Earl Brassow <jbrassow@redhat.com>
Thu, 1 Dec 2011 00:04:21 +0000 (00:04 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Thu, 1 Dec 2011 00:04:21 +0000 (00:04 +0000)
tools/lvchange.c

index 2a99c455b050934c55094f40c59c8d3955027e2f..ac7617793e18be7afd884bfbd2a8af3fe3afae36 100644 (file)
@@ -43,6 +43,14 @@ static int lvchange_permission(struct cmd_context *cmd,
                return 0;
        }
 
+       /* Not allowed to change permissions on RAID sub-LVs directly */
+       if ((lv->status & RAID_META) || (lv->status & RAID_IMAGE)) {
+               log_error("Cannot change permissions of RAID %s \"%s\"",
+                         (lv->status & RAID_IMAGE) ? "image" :
+                         "metadata area", lv->name);
+               return 0;
+       }
+
        if (lv_access & LVM_WRITE) {
                lv->status |= LVM_WRITE;
                log_verbose("Setting logical volume \"%s\" read/write",
This page took 0.033066 seconds and 5 git commands to generate.