buf[len] = '\0';
/* Ignore this entry if the characters aren't permissible */
- if (!validate_vgname(buf)) {
+ if (!validate_name(buf)) {
stack;
goto out;
}
int vg_remove_snapshot(struct volume_group *vg, struct logical_volume *cow);
-static inline int validate_vgname(const char *n)
+static inline int validate_name(const char *n)
{
register char c;
register int len = 0;
return 0;
}
+ if (!validate_name(lp->lv_name)) {
+ log_error("Logical volume name \"%s\" has invalid characters",
+ lp->lv_name);
+ return 0;
+ }
+
return 1;
}
return EINVALID_CMD_LINE;
}
- if (!validate_vgname(vg_name)) {
+ if (!validate_name(vg_name)) {
log_error("Please provide a valid volume group name");
return EINVALID_CMD_LINE;
}
return ECMD_FAILED;
}
- if (!validate_vgname(lv_name_new)) {
+ if (!validate_name(lv_name_new)) {
log_error
("New logical volume name \"%s\" has invalid characters",
lv_name_new);
if (!strncmp(vg_name, cmd->dev_dir, strlen(cmd->dev_dir)))
vg_name += strlen(cmd->dev_dir);
- if (!validate_vgname(vg_name)) {
+ if (!validate_name(vg_name)) {
log_error("Volume group name \"%s\" has invalid characters",
vg_name);
return ECMD_FAILED;
return ECMD_FAILED;
}
- if (!validate_vgname(vg_name)) {
+ if (!validate_name(vg_name)) {
log_error("New volume group name \"%s\" has invalid characters",
vg_name);
return ECMD_FAILED;
return ECMD_FAILED;
}
- if (!validate_vgname(vg_name_new)) {
+ if (!validate_name(vg_name_new)) {
log_error("New volume group name \"%s\" has invalid characters",
vg_name_new);
return ECMD_FAILED;