Skip to contentSkip to conversation

master - toollib: validate also name

PATCH Zdenek Kabelac 1 participant 1 message Oct 6, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4e9fbb4b96ad4beed5dd004f221cdbfb874e1094
Commit:        4e9fbb4b96ad4beed5dd004f221cdbfb874e1094
Parent:        68bf974769ff2491f90620d15fd76c42244190a1
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Tue Sep 30 21:45:10 2014 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Oct 6 15:18:05 2014 +0200

toollib: validate also name

In validate_lvname_param() call also validate_name().

---
 tools/toollib.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
tools/toollib.c +6 -0
index 721c727..69c1c39 100644
@@ -1539,6 +1539,12 @@ int validate_lvname_param(struct cmd_context *cmd, const char **vg_name,
 	if (!apply_lvname_restrictions(*lv_name))
 		return_0;
 
+	if (!validate_name(*lv_name)) {
+		log_error("Logical volume name \"%s\" is invalid.",
+			  *lv_name);
+		return 0;
+	}
+
 	return 1;
 }