summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-10-27 19:52:21 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-11-05 11:56:22 +0100
commit992d35d38a95280dfa18f0ad5f518d2b8342c7dc (patch)
tree9ba6d16b4886a1c4ad392a6c1cc99799b3437c8a
parentb2e91d41194abcc7abc803fc3dc66eb635fcbd25 (diff)
downloadsamba-992d35d38a95280dfa18f0ad5f518d2b8342c7dc.tar.gz
samba-992d35d38a95280dfa18f0ad5f518d2b8342c7dc.tar.bz2
samba-992d35d38a95280dfa18f0ad5f518d2b8342c7dc.zip
s4:samdb python bindings - make the python wrap connect more like the C one
Add call for setting the create permissions.
-rw-r--r--source4/scripting/python/samba/__init__.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index 5278862301..06e276c2d0 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -103,18 +103,25 @@ class Ldb(ldb.Ldb):
if nosync_p is not None and nosync_p == true:
flags |= FLG_NOSYNC
+ self.set_create_perms()
+
if url is not None:
self.connect(url, flags, options)
- def set_credentials(self, credentials):
- glue.ldb_set_credentials(self, credentials)
-
def set_session_info(self, session_info):
glue.ldb_set_session_info(self, session_info)
+ def set_credentials(self, credentials):
+ glue.ldb_set_credentials(self, credentials)
+
def set_loadparm(self, lp_ctx):
glue.ldb_set_loadparm(self, lp_ctx)
+ def set_create_perms(self, perms=0600):
+ # we usually want Samba databases to be private. If we later find we
+ # need one public, we will have to change this here
+ super(Ldb, self).set_create_perms(perms)
+
def searchone(self, attribute, basedn=None, expression=None,
scope=ldb.SCOPE_BASE):
"""Search for one attribute as a string.