summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/groupdb/mapping_ldb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/groupdb/mapping_ldb.c b/source3/groupdb/mapping_ldb.c
index bfff98e87f..c6ff6ca2af 100644
--- a/source3/groupdb/mapping_ldb.c
+++ b/source3/groupdb/mapping_ldb.c
@@ -149,8 +149,12 @@ static struct ldb_dn *mapping_dn(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
sid_to_string(string_sid, &map->sid)) != LDB_SUCCESS ||
ldb_msg_add_fmt(msg, "gidNumber", "%u", (unsigned)map->gid) != LDB_SUCCESS ||
ldb_msg_add_fmt(msg, "sidNameUse", "%u", (unsigned)map->sid_name_use) != LDB_SUCCESS ||
- ldb_msg_add_string(msg, "ntName", map->nt_name) != LDB_SUCCESS ||
- ldb_msg_add_string(msg, "comment", map->comment) != LDB_SUCCESS) {
+ ldb_msg_add_string(msg, "ntName", map->nt_name) != LDB_SUCCESS) {
+ goto failed;
+ }
+
+ if ((map->comment[0] != '\0') &&
+ (ldb_msg_add_string(msg, "ntName", map->nt_name) != LDB_SUCCESS)) {
goto failed;
}