]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/acl.c
Should include <ac/unistd.h> instead of <unistd.h>
[openldap] / servers / slapd / acl.c
index a9fcc6a1209589b002b85e2698d6c7bed3e5c75d..72a89e2751086049b139b853a50a8d096ce366af 100644 (file)
 
 #include "slap.h"
 
-extern Attribute       *attr_find();
-extern struct acl      *global_acl;
-extern int             global_default_access;
-extern char            *access2str();
-extern char            *dn_normalize_case();
-
-int            acl_access_allowed();
-int            access_allowed();
-struct acl     *acl_get_applicable();
-
-static int     regex_matches();
-
-static string_expand(char *newbuf, int bufsiz, char *pattern,
-       char *match, regmatch_t *matches);
+static int     regex_matches(char *pat, char *str, char *buf, regmatch_t *matches);
+static void    string_expand(char *newbuf, int bufsiz, char *pattern,
+                             char *match, regmatch_t *matches);
 
 
 /*
@@ -83,8 +72,8 @@ access_allowed(
 
        if (a) {
                for (i = 0; i < MAXREMATCHES && matches[i].rm_so > 0; i++) {
-                       Debug( LDAP_DEBUG_ARGS, "=> match[%d]: %d %d ",
-                               i, matches[i].rm_so, matches[i].rm_eo );
+                       Debug( LDAP_DEBUG_ARGS, "=> match[%d]: %d %d ", i,
+                              (int)matches[i].rm_so, (int)matches[i].rm_eo );
 
                        if( matches[i].rm_so <= matches[0].rm_eo ) {
                                for ( n = matches[i].rm_so; n < matches[i].rm_eo; n++) {
@@ -140,7 +129,7 @@ acl_get_applicable(
        for ( i = 1, a = be->be_acl; a != NULL; a = a->acl_next, i++ ) {
                if (a->acl_dnpat != NULL) {
                        Debug( LDAP_DEBUG_TRACE, "=> dnpat: [%d] %s nsub: %d\n", 
-                               i, a->acl_dnpat, a->acl_dnre.re_nsub);
+                               i, a->acl_dnpat, (int) a->acl_dnre.re_nsub);
 
                        if (regexec(&a->acl_dnre, edn, nmatch, matches, 0))
                                continue;
@@ -171,7 +160,7 @@ acl_get_applicable(
        for ( i = 1, a = global_acl; a != NULL; a = a->acl_next, i++ ) {
                if (a->acl_dnpat != NULL) {
                        Debug( LDAP_DEBUG_TRACE, "=> dnpat: [%d] %s nsub: %d\n", 
-                               i, a->acl_dnpat, a->acl_dnre.re_nsub);
+                               i, a->acl_dnpat, (int) a->acl_dnre.re_nsub);
 
                        if (regexec(&a->acl_dnre, edn, nmatch, matches, 0)) {
                                continue;
@@ -472,7 +461,8 @@ acl_check_mods(
        return( LDAP_SUCCESS );
 }
 
-static string_expand(
+static void
+string_expand(
        char *newbuf,
        int bufsiz,
        char *pat,