r18875: The comment field can be empty
authorVolker Lendecke <vlendec@samba.org>
Sun, 24 Sep 2006 22:10:48 +0000 (22:10 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:14:40 +0000 (12:14 -0500)
(This used to be commit 6d5d7bf4bbcfee77853776af59e00d006fd86dc9)

source3/groupdb/mapping_ldb.c

index bfff98e87f4083c1138eddf45b80c1d8f4514f00..c6ff6ca2af8d4464d21a9e6c9e4f875d5f75222d 100644 (file)
@@ -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;
        }