git.samba.org
/
mat
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b85dfce
)
s4-dsdb: Added a helper to python SamDB for retrieving and setting minPwdAge.
author
Nadezhda Ivanova
<nivanova@samba.org>
Mon, 22 Nov 2010 16:34:18 +0000
(18:34 +0200)
committer
Nadezhda Ivanova
<nivanova@samba.org>
Mon, 22 Nov 2010 16:52:04 +0000
(18:52 +0200)
source4/scripting/python/samba/samdb.py
patch
|
blob
|
history
diff --git
a/source4/scripting/python/samba/samdb.py
b/source4/scripting/python/samba/samdb.py
index 61d7c3ec809614b82a18515d65bdb1cd665b41b9..460c8b898cb217e896e8635b2d1cd2286c5083e6 100644
(file)
--- a/
source4/scripting/python/samba/samdb.py
+++ b/
source4/scripting/python/samba/samdb.py
@@
-602,3
+602,18
@@
accountExpires: %u
def get_partitions_dn(self):
return dsdb._dsdb_get_partitions_dn(self)
+
+ def set_minPwdAge(self, value):
+ m = ldb.Message()
+ m.dn = ldb.Dn(self, self.domain_dn())
+ m["minPwdAge"] = ldb.MessageElement(value, ldb.FLAG_MOD_REPLACE, "minPwdAge")
+ self.modify(m)
+
+ def get_minPwdAge(self):
+ res = self.search(self.domain_dn(), scope=ldb.SCOPE_BASE, attrs=["minPwdAge"])
+ if len(res) == 0:
+ return None
+ elif not "minPwdAge" in res[0]:
+ return None
+ else:
+ return res[0]["minPwdAge"][0]