summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-02-04 20:49:59 +0000
committerMatt Wilson <msw@redhat.com>2000-02-04 20:49:59 +0000
commit53a49617168c79c66636cf22da6f45454a5d2b4a (patch)
tree16920d49aafaec4c70e34871af70de7cf7ec1be2 /iutil.py
parentf96109bf0b831fe2824ea37aca011fe68262e4d7 (diff)
downloadanaconda-53a49617168c79c66636cf22da6f45454a5d2b4a.tar.gz
anaconda-53a49617168c79c66636cf22da6f45454a5d2b4a.tar.xz
anaconda-53a49617168c79c66636cf22da6f45454a5d2b4a.zip
check useraccount
Diffstat (limited to 'iutil.py')
-rw-r--r--iutil.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/iutil.py b/iutil.py
index f1f5728d2..dd18d61a3 100644
--- a/iutil.py
+++ b/iutil.py
@@ -218,4 +218,19 @@ def rmrf (path):
os.unlink (path + '/' + file)
os.rmdir (path)
+def validUser (user):
+ if len (user) > 8:
+ return 0
+ if not user[0] in string.letters:
+ return 0
+
+ for letter in user:
+ if (letter == ':'
+ or letter == ','
+ or letter == '\n'
+ or ord (letter) < 33):
+ return 0
+
+ return 1
+