git.samba.org
/
jra
/
samba
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
28800c5
)
r18910: Change ldb_msg_add_string() to not actually add an attribute if the
author
Andrew Tridgell
<tridge@samba.org>
Tue, 26 Sep 2006 01:21:34 +0000
(
01:21
+0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 17:14:45 +0000
(12:14 -0500)
string is zero length. This allows callers to not have to worry about
creating an invalid ldap attribute.
See extensive discussion on samba-technical list :-)
(This used to be commit
9e66df05a4df3d3c7b02048d80e2661103d1d40a
)
source3/lib/ldb/common/ldb_msg.c
patch
|
blob
|
history
diff --git
a/source3/lib/ldb/common/ldb_msg.c
b/source3/lib/ldb/common/ldb_msg.c
index 52c6b82484f7120db0c63434e117278fb0c209e7..a4ba045669c34e26659e67a1f5c4b7d2e97eefc0 100644
(file)
--- a/
source3/lib/ldb/common/ldb_msg.c
+++ b/
source3/lib/ldb/common/ldb_msg.c
@@
-227,6
+227,11
@@
int ldb_msg_add_string(struct ldb_message *msg,
val.data = discard_const_p(uint8_t, str);
val.length = strlen(str);
+ if (val.length == 0) {
+ /* allow empty strings as non-existant attributes */
+ return 0;
+ }
+
return ldb_msg_add_value(msg, attr_name, &val);
}