summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-15 10:20:48 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-15 19:42:40 +0200
commit33bb063b053c24a84fdd13b866d1f80a964aeabf (patch)
tree40b6d9f51f5d3f8e53ba9531d91e14b02fb1da7b /source4/dsdb/samdb
parent6dc0c07a51ee3d26ffc44e6178b6ae842190bd19 (diff)
downloadsamba-33bb063b053c24a84fdd13b866d1f80a964aeabf.tar.gz
samba-33bb063b053c24a84fdd13b866d1f80a964aeabf.tar.bz2
samba-33bb063b053c24a84fdd13b866d1f80a964aeabf.zip
s4:password_hash LDB module - support this new password set syntax
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index e90653f7ec..48d841b817 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -2431,10 +2431,18 @@ static int password_hash_modify(struct ldb_module *module, struct ldb_request *r
++rep_attr_cnt;
}
if ((passwordAttr->num_values != 1) &&
- (passwordAttr->flags != LDB_FLAG_MOD_REPLACE)) {
+ (passwordAttr->flags == LDB_FLAG_MOD_ADD)) {
talloc_free(ac);
ldb_asprintf_errstring(ldb,
- "'%s' attributes must have exactly one value!",
+ "'%s' attribute must have exactly one value on add operations!",
+ *l);
+ return LDB_ERR_CONSTRAINT_VIOLATION;
+ }
+ if ((passwordAttr->num_values > 1) &&
+ (passwordAttr->flags == LDB_FLAG_MOD_DELETE)) {
+ talloc_free(ac);
+ ldb_asprintf_errstring(ldb,
+ "'%s' attribute must have zero or one value(s) on delete operations!",
*l);
return LDB_ERR_CONSTRAINT_VIOLATION;
}