-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathldapCheckUserGroupAcl
executable file
·51 lines (41 loc) · 1.52 KB
/
ldapCheckUserGroupAcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /usr/bin/python
import os
import ldap
import subprocess
from optparse import OptionParser
import tempfile
from ldapConf import *
from ldapUtil import *
####################################################################################
# global constants
####################################################################################
version="%prog: v0.82 (2011-Nov-27)"
modifiedBy="Garry Thuna"
###################################################################################
# parse command line options
###################################################################################
usage = "usage: %prog [options]"
description = "Checks references between users, groups, and acls"
parser = OptionParser(usage=usage, version=version, description=description)
(options, args) = parser.parse_args()
####################################################################################
# bind to the ldap server
# do the preliminary procssing of users and groups
# do the preliminary procssing of workspaces
####################################################################################
con = ldap.initialize(BIND_URI)
con.start_tls_s()
con.simple_bind_s(BIND_DN, BIND_PW)
groups, \
users, \
gnum2idx, \
gid2idx, \
uid2idx, \
belongsTo, \
workspaces, \
awsName2ws, \
awsName2path, \
gnum2awsName, \
servers, \
asName2server = preProcessLdapObjects(con)
con.unbind_s()