diff options
author | Mike Fulbright <msf@redhat.com> | 2002-08-01 04:08:12 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2002-08-01 04:08:12 +0000 |
commit | 3435a8d1bebf5c00911281adf7c8f1ff4180dcf3 (patch) | |
tree | 9acd436107a4afe7a7777f2d9135d02c97bc3d52 | |
parent | 48a22d4ab047a848303bdb5bfa27b2a6d3ea990c (diff) | |
download | anaconda-3435a8d1bebf5c00911281adf7c8f1ff4180dcf3.tar.gz anaconda-3435a8d1bebf5c00911281adf7c8f1ff4180dcf3.tar.xz anaconda-3435a8d1bebf5c00911281adf7c8f1ff4180dcf3.zip |
be more picky about what we allow as a volume or logical volume name
-rw-r--r-- | partIntfHelpers.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/partIntfHelpers.py b/partIntfHelpers.py index 597f5b2f7..c7b838a98 100644 --- a/partIntfHelpers.py +++ b/partIntfHelpers.py @@ -41,9 +41,12 @@ def sanityCheckVolumeGroupName(volname): if volname in badNames: return _("Error - the volume group name %s is not valid." % (volname,)) - if string.find(volname, '/') != -1 or string.find(volname, ' ') != -1: - return _("Error - the volume group name contains illegal characters " - " or spaces.") + for i in range(0, len(volname)): + rc = string.find(string.letters + string.digits + '.' + '_', volname[i]) + if rc == -1: + return _("Error - the volume group name contains illegal " + "characters or spaces. Acceptable characters " + "are letters, digits, '.' or '_'.") return None def sanityCheckLogicalVolumeName(logvolname): @@ -62,10 +65,12 @@ def sanityCheckLogicalVolumeName(logvolname): return _("Error - the logical volume name %s is not " "valid." % (logvolname,)) - if (string.find(logvolname, '/') != -1 or - string.find(logvolname, ' ') != -1): - return _("Error - the logical volume name contains illegal " - "characters or spaces.") + for i in range(0, len(logvolname)): + rc = string.find(string.letters + string.digits + '.' + '_', logvolname[i]) + if rc == -1: + return _("Error - the logical volume name contains illegal " + "characters or spaces. Acceptable characters " + "are letters, digits, '.' or '_'.") return None def sanityCheckMountPoint(mntpt, fstype, preexisting): |