diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-05-09 12:30:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:51:50 -0500 |
commit | 51d5ddecc60b6e33e1d542cb92b2fe6736849398 (patch) | |
tree | 8129d864e86c8005337d2e48d39cbb4ab6fe9fde /source4/lib | |
parent | 9652ed4de87d2bc449c0dd5fe07f4e15190511f0 (diff) | |
download | samba-51d5ddecc60b6e33e1d542cb92b2fe6736849398.tar.gz samba-51d5ddecc60b6e33e1d542cb92b2fe6736849398.tar.bz2 samba-51d5ddecc60b6e33e1d542cb92b2fe6736849398.zip |
r606: added a HIDDEN attribute on fields in ldb (in @ATTRIBUTES). This allows you to mark
an attribute as only appearing in searches that explicitly name it. It will be used
for attributes like nTSecurityDescriptor
(This used to be commit f5cd3d733b71368ea652f8a4d653d87f45ff983f)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_cache.c | 1 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_search.c | 4 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_tdb.h | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_cache.c b/source4/lib/ldb/ldb_tdb/ldb_cache.c index 87e9538d01..2a879f384c 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_cache.c +++ b/source4/lib/ldb/ldb_tdb/ldb_cache.c @@ -222,6 +222,7 @@ int ltdb_attribute_flags(struct ldb_context *ldb, const char *attr_name) { "CASE_INSENSITIVE", LTDB_FLAG_CASE_INSENSITIVE }, { "INTEGER", LTDB_FLAG_INTEGER }, { "WILDCARD", LTDB_FLAG_WILDCARD }, + { "HIDDEN", LTDB_FLAG_HIDDEN }, { NULL, 0} }; size_t len; diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c index e2c83202e9..25e22b3dd4 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_search.c +++ b/source4/lib/ldb/ldb_tdb/ldb_search.c @@ -135,6 +135,10 @@ static int msg_add_all_elements(struct ldb_context *ldb, struct ldb_message *ret { int i; for (i=0;i<msg->num_elements;i++) { + int flags = ltdb_attribute_flags(ldb, msg->elements[i].name); + if (flags & LTDB_FLAG_HIDDEN) { + continue; + } if (msg_add_element(ldb, ret, &msg->elements[i]) != 0) { return -1; } diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.h b/source4/lib/ldb/ldb_tdb/ldb_tdb.h index c791cbe201..b678aac631 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.h +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.h @@ -42,6 +42,7 @@ struct ltdb_private { #define LTDB_FLAG_INTEGER (1<<1) #define LTDB_FLAG_WILDCARD (1<<2) #define LTDB_FLAG_OBJECTCLASS (1<<3) +#define LTDB_FLAG_HIDDEN (1<<4) #ifndef IVAL |