data.flags = DB_DBT_USERMEM;
/* fetch it */
rc = db->get( db, tid, key, &data, bdb->bi_db_opflags );
-
#endif
+
if( rc == DB_NOTFOUND ) {
return rc;
Backend *be,
AttributeDescription *desc )
{
- int rc;
slap_mask_t mask;
char *dbname;
struct berval prefix;
return LDAP_INAPPROPRIATE_MATCHING;
}
- return LDAP_SUCCESS;
+ return LDAP_SUCCESS;
}
int bdb_index_param(
{
static char *controls[] = {
LDAP_CONTROL_MANAGEDSAIT,
+ LDAP_CONTROL_SUBENTRIES,
NULL
};
Datum data;
ID_BLOCK *idl;
ID_BLOCK **tmp;
- int i, nids;
+ int nids;
+ unsigned i;
idl = idl_fetch_one( be, db, key );
Backend *be,
AttributeDescription *desc )
{
- int rc;
slap_mask_t mask;
char *dbname;
struct berval prefix;
return LDAP_INAPPROPRIATE_MATCHING;
}
- return LDAP_SUCCESS;
+ return LDAP_SUCCESS;
}
int index_param(
int rc;
struct berval vals[2];
- static int lastmod = ON;
+ static int lastmod = 1;
static BackendInfo *bi = NULL;
static BackendDB *be = NULL;
if ( be ) {
be->be_flags &= ~SLAP_BFLAG_NOLASTMOD;
} else {
- lastmod = ON;
+ lastmod = 1;
}
} else {
if ( be ) {
be->be_flags |= SLAP_BFLAG_NOLASTMOD;
} else {
- lastmod = OFF;
+ lastmod = 0;
}
}
}
/*
- * FIXME: should be replaced by dnExtractRdn() (together with dn_rdn)
+ * FIXME: should be replaced by dnExtractRdn()
*/
int
dn_rdnlen(
return p - dn_in->bv_val;
}
-/*
- * FIXME: should be replaced by dnExtractRdn() (together with dn_rdnlen)
- */
-char * dn_rdn(
- Backend *be,
- struct berval *dn_in )
-{
- struct berval rdn;
-
- assert( dn_in );
-
- if ( dn_in == NULL ) {
- return NULL;
- }
-
- if ( !dn_in->bv_len ) {
- return NULL;
- }
-
- if ( be != NULL && be_issuffix( be, dn_in->bv_val ) ) {
- return NULL;
- }
-
- if ( dnExtractRdn( dn_in, &rdn ) != LDAP_SUCCESS ) {
- return NULL;
- }
-
- return rdn.bv_val;
-}
-
-/*
- * dn_issuffix - tells whether suffix is a suffix of dn.
- * Both dn and suffix must be normalized.
- * deprecated in favor of dnIsSuffix()
- */
-int
-dn_issuffix(
- const char *dn,
- const char *suffix
-)
-{
- struct berval bvdn, bvsuffix;
-
- assert( dn );
- assert( suffix );
-
- bvdn.bv_val = (char *) dn;
- bvdn.bv_len = strlen( dn );
- bvsuffix.bv_val = (char *) suffix;
- bvsuffix.bv_len = strlen( suffix );
-
- return dnIsSuffix( &bvdn, &bvsuffix );
-}
-
/* rdn_attr_type:
*
* Given a string (i.e. an rdn) of the form:
LDAP_SLAPD_F (char *) dn_validate LDAP_P(( char *dn ));
LDAP_SLAPD_F (char *) dn_normalize LDAP_P(( char *dn ));
LDAP_SLAPD_F (char *) dn_parent LDAP_P(( Backend *be, const char *dn ));
-LDAP_SLAPD_F (char *) dn_rdn LDAP_P(( Backend *be, struct berval *dn ));
LDAP_SLAPD_F (int) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn ));
-LDAP_SLAPD_F (int) dn_issuffix LDAP_P(( const char *dn, const char *suffix ));
LDAP_SLAPD_F (char *) rdn_attr_value LDAP_P(( const char * rdn ));
LDAP_SLAPD_F (char *) rdn_attr_type LDAP_P(( const char * rdn ));
LDAP_SLAPD_F (int) rdn_attrs LDAP_P(( const char * rdn,
LDAP_SLAPD_V (ber_socket_t) dtblsize;
-
LDAP_END_DECL
#endif /* _proto_slap */
static AttributeTypeSchemaCheckFN aliasAttribute;
static AttributeTypeSchemaCheckFN referralAttribute;
static AttributeTypeSchemaCheckFN subentryAttribute;
+static AttributeTypeSchemaCheckFN administrativeRoleAttribute;
static AttributeTypeSchemaCheckFN dynamicAttribute;
static struct slap_schema_ad_map {
"EQUALITY objectIdentifierMatch "
"USAGE directoryOperation "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )",
- NULL, 0, NULL, NULL, NULL,
+ administrativeRoleAttribute, 0, NULL, NULL, NULL,
offsetof(struct slap_internal_schema, si_ad_administrativeRole) },
{ "subtreeSpecification", "( 2.5.18.6 NAME 'subtreeSpecification' "
"SINGLE-VALUE "
return LDAP_SUCCESS;
}
+static int administrativeRoleAttribute (
+ Backend *be,
+ Entry *e,
+ Attribute *attr,
+ const char** text,
+ char *textbuf, size_t textlen )
+{
+ *text = textbuf;
+
+ if( !SLAP_SUBENTRIES(be) ) {
+ snprintf( textbuf, textlen,
+ "attribute \"%s\" not supported in context",
+ attr->a_desc->ad_cname.bv_val );
+ return LDAP_OBJECT_CLASS_VIOLATION;
+ }
+
+ snprintf( textbuf, textlen,
+ "attribute \"%s\" not supported!",
+ attr->a_desc->ad_cname.bv_val );
+ return LDAP_OBJECT_CLASS_VIOLATION;
+}
+
static int dynamicAttribute (
Backend *be,
Entry *e,
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
+#ifndef SLAP_SETS_H_
+#define SLAP_SETS_H_
+
+#include <ldap_cdefs.h>
+
+LDAP_BEGIN_DECL
+
/* this routine needs to return the bervals instead of
* plain strings, since syntax is not known. It should
* also return the syntax or some "comparison cookie"
void *cookie, struct berval *filter,
char *user, char *this, BerVarray *results);
+LDAP_END_DECL
+
+#endif
\ No newline at end of file
*/
#define SLAP_MOD_SOFTADD 0x1000
-#define ON (1)
-#define OFF (-1)
-#define UNDEFINED (0)
-
#define MAXREMATCHES (10)
#define SLAP_MAX_WORKER_THREADS (32)
typedef struct slap_matching_rule {
LDAPMatchingRule smr_mrule;
- ber_len_t smr_oidlen;
+ ber_len_t smr_oidlen;
slap_mask_t smr_usage;
#define SLAP_MR_HIDE 0x8000U
struct slap_attribute_type *sat_next;
-#define sat_oid sat_atype.at_oid
-#define sat_names sat_atype.at_names
-#define sat_desc sat_atype.at_desc
+#define sat_oid sat_atype.at_oid
+#define sat_names sat_atype.at_names
+#define sat_desc sat_atype.at_desc
#define sat_obsolete sat_atype.at_obsolete
-#define sat_sup_oid sat_atype.at_sup_oid
+#define sat_sup_oid sat_atype.at_sup_oid
#define sat_equality_oid sat_atype.at_equality_oid
#define sat_ordering_oid sat_atype.at_ordering_oid
#define sat_substr_oid sat_atype.at_substr_oid
#define sat_single_value sat_atype.at_single_value
#define sat_collective sat_atype.at_collective
#define sat_no_user_mod sat_atype.at_no_user_mod
-#define sat_usage sat_atype.at_usage
+#define sat_usage sat_atype.at_usage
#define sat_extensions sat_atype.at_extensions
struct slap_attr_desc *sat_ad;
#define o_tls_ssf o_authz.sai_tls_ssf
#define o_sasl_ssf o_authz.sai_sasl_ssf
-struct slap_op;
-struct slap_conn;
-
typedef void (slap_response)( struct slap_conn *, struct slap_op *,
ber_tag_t, ber_int_t, ber_int_t, const char *, const char *,
BerVarray, const char *, struct berval *,
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 advapi32.lib sasl.lib libdb32.lib hs_regex.lib libsasl.lib rpcrt4.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+# ADD LINK32 advapi32.lib rpcrt4.lib sasl.lib libdb40.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
!ELSEIF "$(CFG)" == "slapd - Win32 Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 advapi32.lib libdb32.lib hs_regex.lib libsasl.lib rpcrt4.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 advapi32.lib rpcrt4.lib libdb40d.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
!ELSEIF "$(CFG)" == "slapd - Win32 Single Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 sasl.lib libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 sasl.lib libdb40.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
!ELSEIF "$(CFG)" == "slapadd - Win32 Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb40d.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
!ELSEIF "$(CFG)" == "slapadd - Win32 Single Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 sasl.lib libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 sasl.lib libdb40.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
!ELSEIF "$(CFG)" == "slapcat - Win32 Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb40d.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
!ELSEIF "$(CFG)" == "slapcat - Win32 Single Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 sasl.lib libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 sasl.lib libdb40.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
!ELSEIF "$(CFG)" == "slapindex - Win32 Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb40d.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
!ELSEIF "$(CFG)" == "slapindex - Win32 Single Debug"