1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

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)
This commit is contained in:
Andrew Tridgell 2004-05-09 12:30:30 +00:00 committed by Gerald (Jerry) Carter
parent 9652ed4de8
commit 51d5ddecc6
3 changed files with 6 additions and 0 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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