summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile28
-rw-r--r--Pivot.py4
-rw-r--r--files/slapd-pivot.conf.sample17
3 files changed, 48 insertions, 1 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ced020b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,28 @@
+VERSION = 0.0.1
+PREFIX = /usr/local
+
+FILES = \
+ Backend.py \
+ Config.py \
+ Pivot.py \
+ slapd-pivot.py \
+ Makefile
+
+SUBDIRS = \
+ files
+
+all:
+ @echo "usage: make install"
+ @echo " make dist [PREFIX=/path]"
+
+dist:
+ tar -jcvf slapd-pivot-$(VERSION).tbz \
+ --exclude '*.pyc' --exclude 'test' --exclude '*.tbz' \
+ --exclude '*.tar.bz2' --exclude '\.*' \
+ $(FILES) $(SUBDIRS)
+
+install:
+ chmod +x slapd-pivot.py
+ cp files/slapd-pivot.conf.sample $(PREFIX)/etc/slapd-pivot.conf.sample
+ ln -sf `pwd`/slapd-pivot.py $(PREFIX)/sbin/slapd-pivot
+
diff --git a/Pivot.py b/Pivot.py
index 5f02d92..1a27826 100644
--- a/Pivot.py
+++ b/Pivot.py
@@ -142,7 +142,9 @@ class Storage:
return self.entries.keys()[:] # copy
def exists(self, dn):
- return dn in self.entries.keys()
+ if not self.entries.has_key("dn"):
+ return False
+ return len(self.entries["dn"]) > 0
def delete(self, dn):
if self.entries.has_key(dn):
diff --git a/files/slapd-pivot.conf.sample b/files/slapd-pivot.conf.sample
new file mode 100644
index 0000000..6ecd263
--- /dev/null
+++ b/files/slapd-pivot.conf.sample
@@ -0,0 +1,17 @@
+
+[main]
+
+ref-attribute: member
+key-attribute: uid
+tag-attribute: memberOf
+rdn-attribute: cn
+ref-objectclass: group
+access-attribute: access
+
+storage-file = /var/db/pivot.ldif
+
+ldap-base: dc=fam
+ldap-root: cn=root,dc=fam
+ldap-password: barn
+ldap-host: ldap://localhost:3890
+