From e1188406fb1e42ac04abc46f8a09522a29b83178 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Aug 2008 17:49:34 +1000 Subject: added some comments at the request of a frustrated abartlet (This used to be commit cad2e6c4c13ccd02587e47d13e897e0a327b58eb) --- source4/lib/charset/iconv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source4/lib/charset/iconv.c b/source4/lib/charset/iconv.c index 4f4bc8fd2d..d4f930b462 100644 --- a/source4/lib/charset/iconv.c +++ b/source4/lib/charset/iconv.c @@ -469,6 +469,9 @@ static size_t iconv_copy(void *cd, const char **inbuf, size_t *inbytesleft, return 0; } +/* + this takes a UTF8 sequence and produces a UTF16 sequence + */ static size_t utf8_pull(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { @@ -586,6 +589,10 @@ error: return -1; } + +/* + this takes a UTF16 sequence and produces a UTF8 sequence + */ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { -- cgit From 7e1c62f8b64c9e42018bea33557af31fb7fa7414 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 20 Aug 2008 15:46:58 +1000 Subject: added a LDB_ATTR_FLAG_FIXED so the schema module can mark attributes as never to be removed. (This used to be commit 9dce558206a2ce70c69b9b6c5c3c9c58ee165b1d) --- source4/lib/ldb/common/ldb_attributes.c | 5 +++++ source4/lib/ldb/include/ldb.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source4/lib/ldb/common/ldb_attributes.c b/source4/lib/ldb/common/ldb_attributes.c index effd93ae26..81aab52a08 100644 --- a/source4/lib/ldb/common/ldb_attributes.c +++ b/source4/lib/ldb/common/ldb_attributes.c @@ -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)); } diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index 0338ae1d93..7ce6103422 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -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 -- cgit