struct berval vals[2];
char *replicahost;
LDAPURLDesc *ludp;
- static int lastmod = 1;
static BackendInfo *bi = NULL;
static BackendDB *be = NULL;
return( 1 );
}
+
+ if ( be == NULL ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( CONFIG, INFO, "%s: line %d: lastmod"
+ " line must appear inside a database definition\n",
+ fname, lineno , 0 );
+#else
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: lastmod"
+ " line must appear inside a database definition\n",
+ fname, lineno, 0 );
+#endif
+ return 1;
+
+ } else if ( SLAP_NOLASTMODCMD(be) ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( CONFIG, INFO, "%s: line %d: lastmod"
+ " not available for %s database\n",
+ fname, lineno , be->bd_info->bi_type );
+#else
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: lastmod"
+ " not available for %s databases\n",
+ fname, lineno, be->bd_info->bi_type );
+#endif
+ return 1;
+ }
+
if ( strcasecmp( cargv[1], "on" ) == 0 ) {
- if ( be ) {
- SLAP_DBFLAGS(be) &= ~SLAP_DBFLAG_NOLASTMOD;
- } else {
- lastmod = 1;
- }
+ SLAP_DBFLAGS(be) &= ~SLAP_DBFLAG_NOLASTMOD;
} else {
- if ( be ) {
- SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NOLASTMOD;
- } else {
- lastmod = 0;
- }
+ SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NOLASTMOD;
}
#ifdef SIGHUP
rc = sc->sc_parse( op, rs, c );
assert( rc != LDAP_UNAVAILABLE_CRITICAL_EXTENSION );
- switch ( rc ) {
- /* for some reason, the control should be ignored */
- case SLAP_CTRL_IGNORE:
- op->o_tmpfree( c, op->o_tmpmemctx );
- op->o_ctrls[--nctrls] = NULL;
- goto next_ctrl;
-
- /* the control was successfully parsed */
- case LDAP_SUCCESS:
- break;
-
- /* something happened... */
- default:
+ if ( rc ) {
rs->sr_err = rc;
goto return_results;
}
return LDAP_PROTOCOL_ERROR;
}
- /*
- * NOTE: according to RFC 2696 3.:
- *
- If the page size is greater than or equal to the sizeLimit value, the
- server should ignore the control as the request can be satisfied in a
- single page.
- *
- * NOTE: this assumes that the op->ors_slimit be set before the controls
- * are parsed.
- */
- if ( op->ors_slimit > 0 && size >= op->ors_slimit ) {
- return SLAP_CTRL_IGNORE;
- }
-
if( cookie.bv_len ) {
PagedResultsCookie reqcookie;
if( cookie.bv_len != sizeof( reqcookie ) ) {
slap_mask_t bi_flags; /* backend flags */
#define SLAP_BFLAG_MONITOR 0x0001U /* a monitor backend */
+#define SLAP_BFLAG_NOLASTMODCMD 0x0010U
#define SLAP_BFLAG_INCREMENT 0x0100U
#define SLAP_BFLAG_ALIASES 0x1000U
#define SLAP_BFLAG_REFERRALS 0x2000U
#define SLAP_REFERRALS(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_REFERRALS)
#define SLAP_SUBENTRIES(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_SUBENTRIES)
#define SLAP_DYNAMIC(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_DYNAMIC)
+#define SLAP_NOLASTMODCMD(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_NOLASTMODCMD)
+#define SLAP_LASTMODCMD(be) (!SLAP_NOLASTMODCMD(be))
char **bi_controls; /* supported controls */
#endif
#define SLAP_CTRL_FRONTEND 0x00800000U
-#define SLAP_CTRL_FRONTEND_SEARCH 0x00010000U /* for NOOP */
-#define SLAP_CTRL_IGNORE 0x00020000U
+#define SLAP_CTRL_FRONTEND_SEARCH 0x00010000U /* for NOOP */
#define SLAP_CTRL_OPFLAGS 0x0000FFFFU
#define SLAP_CTRL_ABANDON 0x00000001U