summaryrefslogtreecommitdiffstats
path: root/ipa_server
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-10-30 17:25:45 -0400
committerRob Crittenden <rcritten@redhat.com>2008-10-30 17:29:22 -0400
commit62876ccee3ba679adda926b88564732552459619 (patch)
tree0519e10c36e9c516ecdcb11c95e478c0b503122d /ipa_server
parent6879140db790a23a8782f7200400f2b58a69f6a0 (diff)
downloadfreeipa-62876ccee3ba679adda926b88564732552459619.tar.gz
freeipa-62876ccee3ba679adda926b88564732552459619.tar.xz
freeipa-62876ccee3ba679adda926b88564732552459619.zip
Initial implementation of automount support
Add argument handling to crud.Del Make get_list handle LDAP scope
Diffstat (limited to 'ipa_server')
-rw-r--r--ipa_server/plugins/b_ldap.py9
-rw-r--r--ipa_server/servercore.py11
-rw-r--r--ipa_server/updates/automount.update35
3 files changed, 53 insertions, 2 deletions
diff --git a/ipa_server/plugins/b_ldap.py b/ipa_server/plugins/b_ldap.py
index e53afc12..c279ac70 100644
--- a/ipa_server/plugins/b_ldap.py
+++ b/ipa_server/plugins/b_ldap.py
@@ -139,6 +139,15 @@ class ldap(CrudBackend):
return entry.get('dn')
+ def get_base_entry(self, searchbase, searchfilter, attrs):
+ return servercore.get_base_entry(searchbase, searchfilter, attrs)
+
+ def get_sub_entry(self, searchbase, searchfilter, attrs):
+ return servercore.get_sub_entry(searchbase, searchfilter, attrs)
+
+ def get_one_entry(self, searchbase, searchfilter, attrs):
+ return servercore.get_one_entry(searchbase, searchfilter, attrs)
+
def get_ipa_config(self):
"""Return a dictionary of the IPA configuration"""
return servercore.get_ipa_config()
diff --git a/ipa_server/servercore.py b/ipa_server/servercore.py
index 052c386b..5f13e8d4 100644
--- a/ipa_server/servercore.py
+++ b/ipa_server/servercore.py
@@ -104,13 +104,20 @@ def get_sub_entry (base, searchfilter, sattrs=None):
"""
return get_entry(base, ldap.SCOPE_SUBTREE, searchfilter, sattrs)
-def get_list (base, searchfilter, sattrs=None):
+def get_one_entry (base, searchfilter, sattrs=None):
+ """Get the children of an entry (with a scope of ONE).
+ Return as a list of dict of values.
+ Multi-valued fields are represented as lists.
+ """
+ return get_list(base, searchfilter, sattrs, ldap.SCOPE_ONELEVEL)
+
+def get_list (base, searchfilter, sattrs=None, scope=ldap.SCOPE_SUBTREE):
"""Gets a list of entries. Each is converted to a dict of values.
Multi-valued fields are represented as lists.
"""
entries = []
- entries = context.conn.getConn().getList(base, ldap.SCOPE_SUBTREE, searchfilter, sattrs)
+ entries = context.conn.getConn().getList(base, scope, searchfilter, sattrs)
return map(convert_entry, entries)
diff --git a/ipa_server/updates/automount.update b/ipa_server/updates/automount.update
new file mode 100644
index 00000000..25d45a09
--- /dev/null
+++ b/ipa_server/updates/automount.update
@@ -0,0 +1,35 @@
+#
+# An automount schema based on RFC 2307-bis.
+#
+# This schema defines new automount and automountMap objectclasses to represent
+# the automount maps and their entries.
+#
+dn: cn=schema
+add:attributeTypes:
+ ( 1.3.6.1.1.1.1.31 NAME 'automountMapName'
+ DESC 'automount Map Name'
+ EQUALITY caseExactIA5Match
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE
+ X-ORIGIN 'RFC 2307bis' )
+add:attributeTypes:
+ ( 1.3.6.1.1.1.1.32 NAME 'automountKey'
+ DESC 'Automount Key value'
+ EQUALITY caseExactIA5Match
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE
+ X-ORIGIN 'RFC 2307bis' )
+add:attributeTypes:
+ ( 1.3.6.1.1.1.1.33 NAME 'automountInformation'
+ DESC 'Automount information'
+ EQUALITY caseExactIA5Match
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE
+ X-ORIGIN 'RFC 2307bis' )
+add:objectClasses:
+ ( 1.3.6.1.1.1.2.16 NAME 'automountMap'
+ DESC 'Automount Map information' SUP top
+ STRUCTURAL MUST automountMapName MAY description
+ X-ORIGIN 'RFC 2307bis' )
+add:objectClasses:
+ ( 1.3.6.1.1.1.2.17 NAME 'automount'
+ DESC 'Automount information' SUP top STRUCTURAL
+ MUST ( automountKey $ automountInformation ) MAY description
+ X-ORIGIN 'RFC 2307bis' )