From c458df644100f7abfd2b06212e648b88d087073e Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 17 Aug 2006 16:10:17 +0000 Subject: [PATCH] add bverb_to_mask() API --- servers/slapd/config.c | 11 +++++++++-- servers/slapd/proto-slap.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/servers/slapd/config.c b/servers/slapd/config.c index a0a4080e7f..cbf71e3bde 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -880,14 +880,21 @@ done: /* restrictops, allows, disallows, requires, loglevel */ int -verb_to_mask(const char *word, slap_verbmasks *v) { +bverb_to_mask(struct berval *bword, slap_verbmasks *v) { int i; for(i = 0; !BER_BVISNULL(&v[i].word); i++) { - if(!strcasecmp(word, v[i].word.bv_val)) break; + if(!ber_bvstrcasecmp(bword, &v[i].word)) break; } return(i); } +int +verb_to_mask(const char *word, slap_verbmasks *v) { + struct berval bword; + ber_str2bv( word, 0, 0, &bword ); + return bverb_to_mask( &bword, v ); +} + int verbs_to_mask(int argc, char *argv[], slap_verbmasks *v, slap_mask_t *m) { int i, j; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index d182de895c..99934a9f80 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -589,6 +589,8 @@ LDAP_SLAPD_F (int) read_config LDAP_P(( const char *fname, const char *dir )); LDAP_SLAPD_F (void) config_destroy LDAP_P ((void)); LDAP_SLAPD_F (char **) slap_str2clist LDAP_P(( char ***, char *, const char * )); +LDAP_SLAPD_F (int) bverb_to_mask LDAP_P(( + struct berval *bword, slap_verbmasks *v )); LDAP_SLAPD_F (int) verb_to_mask LDAP_P(( const char *word, slap_verbmasks *v )); LDAP_SLAPD_F (int) verbs_to_mask LDAP_P(( -- 2.39.5