added a LDB_ATTR_FLAG_FIXED so the schema module can mark attributes
authorAndrew Tridgell <tridge@samba.org>
Wed, 20 Aug 2008 05:46:58 +0000 (15:46 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 20 Aug 2008 05:46:58 +0000 (15:46 +1000)
as never to be removed.
(This used to be commit 9dce558206a2ce70c69b9b6c5c3c9c58ee165b1d)

source4/lib/ldb/common/ldb_attributes.c
source4/lib/ldb/include/ldb.h

index effd93ae2674e9e8ec620d53033b3bf4e2732886..81aab52a0898f3b5b567018bd8658ef9d4517fbb 100644 (file)
@@ -149,6 +149,11 @@ void ldb_schema_attribute_remove(struct ldb_context *ldb, const char *name)
                return;
        }
 
+       /* FIXED attributes are never removed */
+       if (a->flags & LDB_ATTR_FLAG_FIXED) {
+               return;
+       }
+
        if (a->flags & LDB_ATTR_FLAG_ALLOCATED) {
                talloc_free(discard_const_p(char, a->name));
        }
index 0338ae1d938654305ba1624a5cba97cd9a347437..7ce61034228da9dd9d176cd8f7e3908106968699 100644 (file)
@@ -358,9 +358,9 @@ const struct ldb_schema_attribute *ldb_schema_attribute_by_name(struct ldb_conte
 #define LDB_ATTR_FLAG_ALLOCATED    (1<<1) 
 
 /**
-   The attribute is constructed from other attributes
+   The attribute is supplied by the application and should not be removed
 */
-#define LDB_ATTR_FLAG_CONSTRUCTED  (1<<1
+#define LDB_ATTR_FLAG_FIXED        (1<<2
 
 /**
   LDAP attribute syntax for a DN