[lvm-devel] LVM2/tools lvchange.c

jbrassow at sourceware.org jbrassow at sourceware.org
Thu Dec 1 00:04:21 UTC 2011


CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow at sourceware.org	2011-12-01 00:04:21

Modified files:
	tools          : lvchange.c 

Log message:
	Do not allow users to change permissions on RAID sub-LVs.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.136&r2=1.137

--- LVM2/tools/lvchange.c	2011/11/18 19:22:49	1.136
+++ LVM2/tools/lvchange.c	2011/12/01 00:04:21	1.137
@@ -43,6 +43,14 @@
 		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",




More information about the lvm-devel mailing list