summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/acl
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-03-05 04:29:24 +0000
committerRich Megginson <rmeggins@redhat.com>2005-03-05 04:29:24 +0000
commitb352660e243c7b9b7d050f1c38cff1c9faf278b1 (patch)
treeede08019beb931c3206609ab2377a015d510bdb4 /ldap/servers/plugins/acl
parentf08951680ddfebc3f3df07e720ad0650fe473c0f (diff)
downloadds-b352660e243c7b9b7d050f1c38cff1c9faf278b1.tar.gz
ds-b352660e243c7b9b7d050f1c38cff1c9faf278b1.tar.xz
ds-b352660e243c7b9b7d050f1c38cff1c9faf278b1.zip
clean up sprintf usage and many other flawfinder issues; clean up compiler warnings on Linux; remove pam_passthru from DS 7.1
Diffstat (limited to 'ldap/servers/plugins/acl')
-rw-r--r--ldap/servers/plugins/acl/acl.c34
-rw-r--r--ldap/servers/plugins/acl/acl_ext.c1
-rw-r--r--ldap/servers/plugins/acl/aclanom.c1
-rw-r--r--ldap/servers/plugins/acl/acleffectiverights.c133
-rw-r--r--ldap/servers/plugins/acl/aclinit.c2
-rw-r--r--ldap/servers/plugins/acl/acllas.c10
-rw-r--r--ldap/servers/plugins/acl/aclparse.c1
-rw-r--r--ldap/servers/plugins/acl/aclutil.c102
8 files changed, 88 insertions, 196 deletions
diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c
index 24848efa..4e21c31d 100644
--- a/ldap/servers/plugins/acl/acl.c
+++ b/ldap/servers/plugins/acl/acl.c
@@ -35,7 +35,7 @@ static char *ds_map_generic[2] = { NULL, NULL };
/****************************************************************************/
static int acl__resource_match_aci(struct acl_pblock *aclpb, aci_t *aci ,
int skip_attrEval, int *a_matched);
-static acl__TestRights(Acl_PBlock *aclpb,int access, char **right,
+static int acl__TestRights(Acl_PBlock *aclpb,int access, char **right,
char ** map_generic, aclResultReason_t *result_reason);
static int acl__scan_for_acis(struct acl_pblock *aclpb, int *err);
static void acl__reset_cached_result (struct acl_pblock *aclpb );
@@ -43,7 +43,6 @@ static int acl__scan_match_handles ( struct acl_pblock *aclpb, int type);
static int acl__attr_cached_result (struct acl_pblock *aclpb, char *attr, int access );
static int acl__match_handlesFromCache (struct acl_pblock *aclpb, char *attr, int access);
static int acl__get_attrEval ( struct acl_pblock *aclpb, char *attr );
-static int acl__config_get_readonly ();
static int acl__recompute_acl (Acl_PBlock *aclpb, AclAttrEval *a_eval,
int access, int aciIndex);
static void __acl_set_aclIndex_inResult ( Acl_PBlock *aclpb,
@@ -991,8 +990,7 @@ acl_read_access_allowed_on_entry (
slapi_ch_free ( (void **) &aclpb->aclpb_Evalattr);
aclpb->aclpb_Evalattr = slapi_ch_malloc(len);
}
- strncpy (aclpb->aclpb_Evalattr, attr_type, len);
- aclpb->aclpb_Evalattr[len] = '\0';
+ PL_strncpyz (aclpb->aclpb_Evalattr, attr_type, len);
if ( attr_index >= 0 ) {
/*
* access was granted to one of the user specified attributes
@@ -3872,34 +3870,6 @@ acl_regen_aclsignature ()
}
-
-static int
-acl__handle_config_entry (Slapi_Entry *e, void *callback_data )
-{
-
- int *value = (int *) callback_data;
-
- *value = slapi_entry_attr_get_int( e, "nsslapd-readonly");
-
- return 0;
-}
-
-static int
-acl__config_get_readonly ()
-{
-
- int readonly = 0;
-
- slapi_search_internal_callback( "cn=config", LDAP_SCOPE_BASE, "(objectclass=*)",
- NULL, 0 /* attrsonly */,
- &readonly/* callback_data */,
- NULL /* controls */,
- NULL /* result_callback */,
- acl__handle_config_entry,
- NULL /* referral_callback */);
-
- return readonly;
-}
/*
*
* Assumptions:
diff --git a/ldap/servers/plugins/acl/acl_ext.c b/ldap/servers/plugins/acl/acl_ext.c
index 129c7f54..511862b9 100644
--- a/ldap/servers/plugins/acl/acl_ext.c
+++ b/ldap/servers/plugins/acl/acl_ext.c
@@ -730,7 +730,6 @@ acl__done_aclpb ( struct acl_pblock *aclpb )
int i;
int dump_aclpb_info = 0;
- char *ds_attr_userdn=NULL; /* for finding userdn for freeing */
int rc=-1;
char *tmp_ptr=NULL;
diff --git a/ldap/servers/plugins/acl/aclanom.c b/ldap/servers/plugins/acl/aclanom.c
index 1161a4bd..ba03552a 100644
--- a/ldap/servers/plugins/acl/aclanom.c
+++ b/ldap/servers/plugins/acl/aclanom.c
@@ -352,7 +352,6 @@ aclanom_get_suffix_info(Slapi_Entry *e,
char *ndn = NULL;
Slapi_DN *e_sdn;
const char *aci_ndn;
- int populate = 0;
struct scoped_entry_anominfo *s_e_anominfo =
&aclpb->aclpb_scoped_entry_anominfo;
diff --git a/ldap/servers/plugins/acl/acleffectiverights.c b/ldap/servers/plugins/acl/acleffectiverights.c
index 98d08ee9..2a1c61ae 100644
--- a/ldap/servers/plugins/acl/acleffectiverights.c
+++ b/ldap/servers/plugins/acl/acleffectiverights.c
@@ -5,6 +5,53 @@
#include "acl.h"
+/* safer than doing strcat unprotected */
+/* news2 is optional, provided as a convenience */
+/* capacity is the capacity of the gerstr, size is the current length */
+static void
+_append_gerstr(char **gerstr, size_t *capacity, size_t *size, const char *news, const char *news2)
+{
+ size_t len;
+ size_t increment = 128;
+ size_t fornull;
+
+ if (!news) {
+ return;
+ }
+
+ /* find out how much space we need */
+ len = strlen(news);
+ fornull = 1;
+ if (news2) {
+ len += strlen(news2);
+ fornull++;
+ }
+
+ /* increase space if needed */
+ while ((*size + len + fornull) > *capacity) {
+ if ((len + fornull) > increment) {
+ *capacity += len + fornull; /* just go ahead and grow the string enough */
+ } else {
+ *capacity += increment; /* rather than having lots of small increments */
+ }
+ }
+
+ if (!*gerstr) {
+ *gerstr = slapi_ch_malloc(*capacity);
+ **gerstr = 0;
+ } else {
+ *gerstr = slapi_ch_realloc(*gerstr, *capacity);
+ }
+ strcat(*gerstr, news);
+ if (news2) {
+ strcat(*gerstr, news2);
+ }
+
+ *size += len;
+
+ return;
+}
+
static int
_ger_g_permission_granted ( Slapi_PBlock *pb, Slapi_Entry *e, char **errbuf )
{
@@ -203,8 +250,8 @@ _ger_new_gerpb (
{
Connection *conn;
struct acl_cblock *geraclcb;
- Acl_PBlock *aclpb, *geraclpb;
- Operation *op, *gerop;
+ Acl_PBlock *geraclpb;
+ Operation *gerop;
int rc = LDAP_SUCCESS;
*aclcb = NULL;
@@ -282,17 +329,18 @@ _ger_get_entry_rights (
Slapi_PBlock *gerpb,
Slapi_Entry *e,
const char *subjectndn,
- char *gerstr,
+ char **gerstr,
+ size_t *gerstrsize,
+ size_t *gerstrcap,
char **errbuf
)
{
unsigned long entryrights = 0;
Slapi_RDN *rdn = NULL;
- const char *rdnstr = NULL;
- char *equalsign = NULL;
char *rdntype = NULL;
+ char *rdnvalue = NULL;
- strcpy ( gerstr, "entryLevelRights: " );
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "entryLevelRights: ", NULL);
slapi_log_error (SLAPI_LOG_ACL, plugin_name,
"_ger_get_entry_rights: SLAPI_ACL_READ\n" );
@@ -300,7 +348,7 @@ _ger_get_entry_rights (
{
/* v - view e */
entryrights |= SLAPI_ACL_READ;
- strcat (gerstr, "v");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "v", NULL);
}
slapi_log_error (SLAPI_LOG_ACL, plugin_name,
"_ger_get_entry_rights: SLAPI_ACL_ADD\n" );
@@ -308,7 +356,7 @@ _ger_get_entry_rights (
{
/* a - add child entry below e */
entryrights |= SLAPI_ACL_ADD;
- strcat (gerstr, "a");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "a", NULL);
}
slapi_log_error (SLAPI_LOG_ACL, plugin_name,
"_ger_get_entry_rights: SLAPI_ACL_DELETE\n" );
@@ -316,7 +364,7 @@ _ger_get_entry_rights (
{
/* d - delete e */
entryrights |= SLAPI_ACL_DELETE;
- strcat (gerstr, "d");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "d", NULL);
}
/*
* Some limitation/simplification applied here:
@@ -327,12 +375,8 @@ _ger_get_entry_rights (
* the first rdn type only for now.
*/
rdn = slapi_rdn_new_dn ( slapi_entry_get_ndn (e) );
- rdnstr = slapi_rdn_get_rdn ( rdn );
- if ( NULL != (equalsign = strchr ( rdnstr, '=' )) )
- {
- rdntype = slapi_ch_malloc ( equalsign-rdnstr+1 );
- strncpy ( rdntype, rdnstr, equalsign-rdnstr );
- rdntype [ equalsign-rdnstr ] = '\0';
+ slapi_rdn_get_first(rdn, &rdntype, &rdnvalue);
+ if ( NULL != rdntype ) {
slapi_log_error (SLAPI_LOG_ACL, plugin_name,
"_ger_get_entry_rights: SLAPI_ACL_WRITE_DEL & _ADD %s\n", rdntype );
if (acl_access_allowed(gerpb, e, rdntype, NULL,
@@ -342,19 +386,17 @@ _ger_get_entry_rights (
{
/* n - rename e */
entryrights |= SLAPI_ACL_WRITE;
- strcat (gerstr, "n");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "n", NULL);
}
- slapi_ch_free ( (void**) &rdntype );
}
slapi_rdn_free ( &rdn );
-done:
if ( entryrights == 0 )
{
- strcat (gerstr, "none");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "none", NULL);
}
- strcat (gerstr, "\n");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "\n", NULL);
return entryrights;
}
@@ -370,25 +412,19 @@ _ger_get_attr_rights (
const char *subjectndn,
char *type,
char **gerstr,
- int *gerstrsize,
+ size_t *gerstrsize,
+ size_t *gerstrcap,
int isfirstattr,
char **errbuf
)
{
unsigned long attrrights = 0;
- /* Enough space for " $type:rwoscxx" ? */
- if ( (*gerstrsize - strlen(*gerstr)) < (strlen(type) + 16) )
- {
- /* slapi_ch_realloc() exits if realloc() failed */
- *gerstrsize += 256;
- *gerstr = slapi_ch_realloc ( *gerstr, *gerstrsize );
- }
if (!isfirstattr)
{
- strcat ( *gerstr, ", " );
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, ", ", NULL);
}
- sprintf ( *gerstr + strlen(*gerstr), "%s:", type );
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, type, ":");
slapi_log_error (SLAPI_LOG_ACL, plugin_name,
"_ger_get_attr_rights: SLAPI_ACL_READ %s\n", type );
@@ -396,7 +432,7 @@ _ger_get_attr_rights (
{
/* r - read the values of type */
attrrights |= SLAPI_ACL_READ;
- strcat (*gerstr, "r");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "r", NULL);
}
slapi_log_error (SLAPI_LOG_ACL, plugin_name,
"_ger_get_attr_rights: SLAPI_ACL_SEARCH %s\n", type );
@@ -404,7 +440,7 @@ _ger_get_attr_rights (
{
/* s - search the values of type */
attrrights |= SLAPI_ACL_SEARCH;
- strcat (*gerstr, "s");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "s", NULL);
}
slapi_log_error (SLAPI_LOG_ACL, plugin_name,
"_ger_get_attr_rights: SLAPI_ACL_COMPARE %s\n", type );
@@ -412,7 +448,7 @@ _ger_get_attr_rights (
{
/* c - compare the values of type */
attrrights |= SLAPI_ACL_COMPARE;
- strcat (*gerstr, "c");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "c", NULL);
}
slapi_log_error (SLAPI_LOG_ACL, plugin_name,
"_ger_get_attr_rights: SLAPI_ACL_WRITE_ADD %s\n", type );
@@ -420,7 +456,7 @@ _ger_get_attr_rights (
{
/* w - add the values of type */
attrrights |= ACLPB_SLAPI_ACL_WRITE_ADD;
- strcat (*gerstr, "w");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "w", NULL);
}
slapi_log_error (SLAPI_LOG_ACL, plugin_name,
"_ger_get_attr_rights: SLAPI_ACL_WRITE_DEL %s\n", type );
@@ -428,7 +464,7 @@ _ger_get_attr_rights (
{
/* o - delete the values of type */
attrrights |= ACLPB_SLAPI_ACL_WRITE_DEL;
- strcat (*gerstr, "o");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "o", NULL);
}
/* If subjectdn has no general write right, check for self write */
if ( 0 == (attrrights & (ACLPB_SLAPI_ACL_WRITE_DEL | ACLPB_SLAPI_ACL_WRITE_ADD)) )
@@ -442,19 +478,19 @@ _ger_get_attr_rights (
{
/* W - add self to the attribute */
attrrights |= ACLPB_SLAPI_ACL_WRITE_ADD;
- strcat (*gerstr, "W");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "W", NULL);
}
if (acl_access_allowed(gerpb, e, type, &val, ACLPB_SLAPI_ACL_WRITE_DEL) == LDAP_SUCCESS)
{
/* O - delete self from the attribute */
attrrights |= ACLPB_SLAPI_ACL_WRITE_DEL;
- strcat (*gerstr, "O");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "O", NULL);
}
}
if ( attrrights == 0 )
{
- strcat (*gerstr, "none");
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "none", NULL);
}
return attrrights;
@@ -467,21 +503,22 @@ _ger_get_attrs_rights (
const char *subjectndn,
char **attrs,
char **gerstr,
- int *gerstrsize,
+ size_t *gerstrsize,
+ size_t *gerstrcap,
char **errbuf
)
{
int isfirstattr = 1;
/* gerstr was initially allocated with enough space for one more line */
- strcat ( *gerstr, "attributeLevelRights: " );
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "attributeLevelRights: ", NULL);
if (attrs && *attrs)
{
int i;
for ( i = 0; attrs[i]; i++ )
{
- _ger_get_attr_rights ( gerpb, e, subjectndn, attrs[i], gerstr, gerstrsize, isfirstattr, errbuf );
+ _ger_get_attr_rights ( gerpb, e, subjectndn, attrs[i], gerstr, gerstrsize, gerstrcap, isfirstattr, errbuf );
isfirstattr = 0;
}
}
@@ -495,7 +532,7 @@ _ger_get_attrs_rights (
if ( ! slapi_attr_flag_is_set (attr, SLAPI_ATTR_FLAG_OPATTR) )
{
slapi_attr_get_type ( attr, &type );
- _ger_get_attr_rights ( gerpb, e, subjectndn, type, gerstr, gerstrsize, isfirstattr, errbuf );
+ _ger_get_attr_rights ( gerpb, e, subjectndn, type, gerstr, gerstrsize, gerstrcap, isfirstattr, errbuf );
isfirstattr = 0;
}
prevattr = attr;
@@ -505,7 +542,7 @@ _ger_get_attrs_rights (
if ( isfirstattr )
{
/* not a single attribute was retrived or specified */
- strcat ( *gerstr, "*:none" );
+ _append_gerstr(gerstr, gerstrsize, gerstrcap, "*:none", NULL);
}
return;
}
@@ -587,13 +624,13 @@ acl_get_effective_rights (
void *aclcb = NULL;
char *subjectndn = NULL;
char *gerstr = NULL;
- int gerstrsize = 1024;
+ size_t gerstrsize = 0;
+ size_t gerstrcap = 0;
unsigned long entryrights;
int iscritical = 1;
int rc;
*errbuf = '\0';
- gerstr = slapi_ch_malloc ( gerstrsize );
/*
* Get the subject
@@ -624,13 +661,13 @@ acl_get_effective_rights (
}
/* Get entry level effective rights */
- entryrights = _ger_get_entry_rights ( gerpb, e, subjectndn, gerstr, errbuf );
+ entryrights = _ger_get_entry_rights ( gerpb, e, subjectndn, &gerstr, &gerstrsize, &gerstrcap, errbuf );
/*
* Attribute level effective rights may not be NULL
* even if entry level's is.
*/
- _ger_get_attrs_rights ( gerpb, e, subjectndn, attrs, &gerstr, &gerstrsize, errbuf );
+ _ger_get_attrs_rights ( gerpb, e, subjectndn, attrs, &gerstr, &gerstrsize, &gerstrcap, errbuf );
bailout:
/*
@@ -640,7 +677,7 @@ bailout:
if ( rc != LDAP_SUCCESS )
{
- sprintf ( gerstr, "entryLevelRights: %d\nattributeLevelRights: *:%d", rc, rc );
+ gerstr = slapi_ch_smprintf("entryLevelRights: %d\nattributeLevelRights: *:%d", rc, rc );
}
slapi_log_error (SLAPI_LOG_ACLSUMMARY, plugin_name,
diff --git a/ldap/servers/plugins/acl/aclinit.c b/ldap/servers/plugins/acl/aclinit.c
index a2e8c6ae..53cd975b 100644
--- a/ldap/servers/plugins/acl/aclinit.c
+++ b/ldap/servers/plugins/acl/aclinit.c
@@ -36,7 +36,6 @@ static int acl_initialized = 0;
int
aclinit_main()
{
- char *cookie = NULL;
Slapi_PBlock *pb;
int rv;
Slapi_DN *sdn;
@@ -194,7 +193,6 @@ aclinit_search_and_update_aci ( int thisbeonly, const Slapi_DN *base,
{
char *attrs[2] = { "aci", NULL };
/* Tell __aclinit_handler whether it's an add or a delete */
- int any_error = op;
Slapi_PBlock *aPb;
LDAPControl **ctrls=NULL;
int retval;
diff --git a/ldap/servers/plugins/acl/acllas.c b/ldap/servers/plugins/acl/acllas.c
index 88913ae6..e6437866 100644
--- a/ldap/servers/plugins/acl/acllas.c
+++ b/ldap/servers/plugins/acl/acllas.c
@@ -1487,7 +1487,6 @@ acllas__user_ismember_of_group( struct acl_pblock *aclpb,
int max_nestlevel;
int max_memberlimit;
aclUserGroup *u_group;
- char ebuf [ BUFSIZ ];
struct member_info *groupMember = NULL;
struct member_info *parentGroup = NULL;
@@ -3180,13 +3179,10 @@ DS_LASRoleDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
PList_t global_auth)
{
- char *s_attrName = NULL;
char *attrName;
int matched;
int rc;
Slapi_Attr *attr;
- int numOflevels = 0;
- char *n_currEntryDn = NULL;
lasInfo lasinfo;
Slapi_Value *sval=NULL;
const struct berval *attrVal;
@@ -3477,16 +3473,10 @@ static char **
acllas_replace_dn_macro( char *rule, char *matched_val, lasInfo *lasinfo) {
char **a = NULL;
- char *str = NULL;
char *patched_rule = NULL;
char *rule_to_use = NULL;
char *new_patched_rule = NULL;
- char *rule_prefix = NULL;
- char *rule_suffix = NULL;
- int rule_suffix_len = 0;
- char *comp = NULL;
int matched_val_len = 0;
- int macro_len = 0;
int j = 0;
int has_macro_dn = 0;
int has_macro_levels = 0;
diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c
index f3c333fa..d6df5111 100644
--- a/ldap/servers/plugins/acl/aclparse.c
+++ b/ldap/servers/plugins/acl/aclparse.c
@@ -1576,7 +1576,6 @@ __acl_trim_filterstr( char * str ) {
static int __acl__init_targetattrfilters( aci_t *aci, char *input_str) {
- int numattr=0;
char *s, *str;
int len;
char *addlistptr = NULL;
diff --git a/ldap/servers/plugins/acl/aclutil.c b/ldap/servers/plugins/acl/aclutil.c
index d1eb9a67..8971c4f2 100644
--- a/ldap/servers/plugins/acl/aclutil.c
+++ b/ldap/servers/plugins/acl/aclutil.c
@@ -16,9 +16,6 @@ static void aclutil__typestr (int type , char str[]);
static void aclutil__Ruletypestr (int type , char str[]);
static char* __aclutil_extract_dn_component ( char **e_dns, int position,
char *attrName );
-static char* acl_get_final_component(char *macro_prefix) ;
-static char* acl_match_component( char *start, char *component);
-static int aclutil_compare_components( char * comp1, char *comp2);
static int acl_find_comp_start(char * s, int pos );
static PRIntn acl_ht_free_entry_and_value(PLHashEntry *he, PRIntn i,
void *arg);
@@ -130,7 +127,7 @@ aclutil_print_err (int rv , const Slapi_DN *sdn, const struct berval* val,
return;
if (val->bv_len > 0 && val->bv_val != NULL) {
- sprintf (str, "%.1023s", val->bv_val);
+ PR_snprintf (str, sizeof(str), "%.1023s", val->bv_val);
} else {
str[0] = '\0';
}
@@ -629,7 +626,6 @@ acl_match_macro_in_target( const char *ndn, char * match_this,
char *tmp_ptr = NULL;
char *matched_val = NULL;
char *ndn_suffix_start = NULL;
- char *macro_prefix_final_component = NULL;
char *ret_val = NULL;
int ndn_len = 0;
int macro_suffix_len = 0;
@@ -890,12 +886,7 @@ acl_match_macro_in_target( const char *ndn, char * match_this,
int
acl_match_prefix( char *macro_prefix, const char *ndn, int *exact_match) {
- int macro_index = 0;
- int ndn_index = 0;
int ret_code = -1;
- char *curr_macro_component = NULL;
- char *curr_ndn_component = NULL;
- int matched = 0;
int macro_prefix_len = 0;
int ndn_len = 0;
int i = 0;
@@ -1289,97 +1280,6 @@ get_this_component(char *dn, int *index) {
}
-/*
- * return 1 if comp1==comp2,
- * return 0 otherwise.
- *
- * the components might have *'s.
- *
- * eg: comp1: cn=*
- * comp2: cn=fred
- *
- *
-*/
-
-static int
-aclutil_compare_components( char * comp1, char *comp2) {
-
- char *tmp_str = NULL;
-
- tmp_str = strstr( comp1, "=*");
- if ( tmp_str == NULL) {
-
- /* Just a straight cmp */
-
- if (slapi_utf8casecmp((ACLUCHP)comp1, (ACLUCHP)comp2) == 0) {
- return(1);
- } else {
- return(0);
- }
- } else {
-
- char *tmp_comp1= NULL;
- char *tmp_comp2 = NULL;
- int ret_code = 0;
-
- /* Here, just compare the bit before the = */
-
- tmp_comp1 = slapi_ch_strdup(comp1);
- tmp_comp2 = slapi_ch_strdup(comp2);
-
- /*
- * Probably need to verify it's not escaped--see code for looking for
- * unescaped commas.
- */
-
- tmp_str = strstr(tmp_comp1, "=");
- *tmp_str = '\0';
-
- tmp_str = strstr(tmp_comp2, "=");
- if ( tmp_str == NULL) {
- ret_code = 0;
- } else{
-
- *tmp_str = '\0';
-
- if (slapi_utf8casecmp((ACLUCHP)comp1, (ACLUCHP)comp2) == 0) {
- ret_code = 1;
- } else {
- ret_code = 0;
- }
-
- slapi_ch_free((void **)&tmp_comp1);
- slapi_ch_free((void **)&tmp_comp2);
-
- return(ret_code);
-
- }
-
- }
-}
-
-/*
- * return a pointer to the final component of macro_prefix.
-*/
-
-static char *
-acl_get_final_component(char *macro_prefix) {
-
- return(NULL);
-}
-
-/*
- *
- *
-*/
-
-static char *
-acl_match_component( char *start, char *component) {
-
-
- return(NULL);
-}
-
/* acl hash table funcs */
/*