[sysadmin-bin] create-auth: be paranoid about the location of the home directory



commit 72503c34aa4f308668038c0c793dc465faef5428
Author: Olav Vitters <olav vitters nl>
Date:   Sat Apr 2 13:41:01 2011 +0200

    create-auth: be paranoid about the location of the home directory

 create-auth |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/create-auth b/create-auth
index 5375483..af4aa8b 100755
--- a/create-auth
+++ b/create-auth
@@ -89,7 +89,12 @@ def get_homedirs(limit_uids=None):
         if searchattr not in attr:
             continue
 
-        uids[attr['uid'][0]] = attr[searchattr][0]
+        attrval = attr[searchattr][0]
+        # be paranoid about the homedirectory location
+        if attrval != '/home/users/%s' % uid:
+            continue
+
+        uids[attr['uid'][0]] = attrval
     return uids
 
 def get_uids_from_wheel():



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]