[Fedora-directory-commits] ldapserver/ldap/servers/plugins/acl acl.c, 1.9, 1.10 acl_ext.c, 1.6, 1.7 acleffectiverights.c, 1.6, 1.7 aclinit.c, 1.6, 1.7 acllas.c, 1.7, 1.8 aclparse.c, 1.6, 1.7 aclutil.c, 1.7, 1.8

Noriko Hosoi (nhosoi) fedora-directory-commits at redhat.com
Thu Oct 18 00:08:30 UTC 2007


Author: nhosoi

Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/acl
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25950/ldap/servers/plugins/acl

Modified Files:
	acl.c acl_ext.c acleffectiverights.c aclinit.c acllas.c 
	aclparse.c aclutil.c 
Log Message:
Resolves: #188320
Summary: HP-UX: warnings reported by the HP-UX compiler



Index: acl.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/acl.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- acl.c	4 Oct 2007 16:27:47 -0000	1.9
+++ acl.c	18 Oct 2007 00:08:27 -0000	1.10
@@ -244,7 +244,6 @@
 	int					err;
 	int					ret_val;
 	char				*right;
-	int					num_handle;
 	struct	acl_pblock	*aclpb = NULL;
 	AclAttrEval			*c_attrEval = NULL;
 	int					got_reader_locked = 0;
@@ -555,7 +554,7 @@
 	** figure out if there are any ACLs which can be applied.
 	** If no ACLs are there, then it's a DENY as default.
 	*/
-	if (!(num_handle = acl__scan_for_acis(aclpb, &err))) {
+	if (!(acl__scan_for_acis(aclpb, &err))) {
 
 		/* We might have accessed the ACL first time which could
 		** have caused syntax error.
@@ -782,7 +781,7 @@
 		}
 	} else{
 		slapi_log_error(loglevel, plugin_name, 
-			"conn=%d op=%d (%s): %s %s on entry(%s).attr(%s)"
+			"conn=%d op=%d (%s): %s %s on entry(%s).attr(%s) to %s"
 			": %s\n",
 				op->o_connid, op->o_opid,
 				source,
@@ -790,6 +789,7 @@
 				right, 
 				edn,
 				attr ? attr: "NULL",
+				real_user,
 				acl_info[0] ? acl_info : access_reason);									
 	}
 	
@@ -2252,7 +2252,6 @@
 
 			Targetattrfilter	*attrFilter = NULL;
 
-			int			found_applicable = 0;
 			Slapi_Attr	*attr_ptr = NULL;
 			Slapi_Value *sval;
 			const struct berval *attrVal;
@@ -2299,8 +2298,6 @@
 					 * values in on the back of it.
 				 	*/
 
-					found_applicable = 1;
-
 					sval=NULL;
 					attrVal=NULL;
 					k= slapi_attr_first_value(attr_ptr,&sval);
@@ -2695,12 +2692,9 @@
 	char			*testRights[2];
 	aci_t			*aci;
 	int			numHandles = 0;
-	aclEvalContext		*c_evalContext = NULL;
 	
 	TNF_PROBE_0_DEBUG(acl__TestRights_start,"ACL","");
 
-	c_evalContext = &aclpb->aclpb_curr_entryEval_context;
-
 	/* record the aci and reason for access decision */
 	result_reason->deciding_aci = NULL;
 	result_reason->reason = ACL_REASON_NONE;
@@ -3931,7 +3925,7 @@
 	char		*unused_str1, *unused_str2;
 	char		*acl_tag, *testRight[2];
 	int			j, expr_num;
-	int			result_status, rv, cache_result;
+	int			result_status, cache_result;
 	PRUint32	cookie;
 	aci_t		*aci;
 
@@ -3992,7 +3986,7 @@
 
 
 	ACL_SetDefaultResult (NULL, aclpb->aclpb_acleval, ACL_RES_INVALID);
-	rv = ACL_EvalSetACL(NULL, aclpb->aclpb_acleval, aci->aci_handle);
+	ACL_EvalSetACL(NULL, aclpb->aclpb_acleval, aci->aci_handle);
 
 	testRight[0] = acl_access2str ( access );
 	testRight[1] = '\0';


Index: acl_ext.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/acl_ext.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- acl_ext.c	10 Nov 2006 23:44:49 -0000	1.6
+++ acl_ext.c	18 Oct 2007 00:08:27 -0000	1.7
@@ -43,11 +43,13 @@
 #include 	"acl.h"
 
 static void acl__done_aclpb ( struct acl_pblock *aclpb );
+#ifdef FOR_DEBUGGING
 static void	acl__dump_stats ( struct acl_pblock *aclpb , const char *block_type);
+static char * acl__get_aclpb_type ( Acl_PBlock *aclpb );
+#endif
 static Acl_PBlock * acl__get_aclpb_from_pool ( );
 static int acl__put_aclpb_back_to_pool ( Acl_PBlock *aclpb );
 static Acl_PBlock * acl__malloc_aclpb ( );
-static char * acl__get_aclpb_type ( Acl_PBlock *aclpb );
 static PRLock *aclext_get_lock ();
 
 
@@ -788,7 +790,9 @@
 
 	}
 
-	/* acl__dump_stats ( aclpb, acl__get_aclpb_type(aclpb));					*/
+#ifdef FOR_DEBUGGING
+	acl__dump_stats ( aclpb, acl__get_aclpb_type(aclpb));
+#endif
 
 	/* reset the usergroup cache */
 	aclg_reset_userGroup ( aclpb );
@@ -956,15 +960,16 @@
 
 }
 
+#ifdef FOR_DEBUGGING
 static char *
 acl__get_aclpb_type ( Acl_PBlock *aclpb )
 {
-
 	if (aclpb->aclpb_state & ACLPB_TYPE_PROXY)	
 		return ACLPB_TYPE_PROXY_STR;
 
 	return ACLPB_TYPE_MAIN_STR;
 }
+
 static void
 acl__dump_stats ( struct acl_pblock *aclpb , const char *block_type)
 {
@@ -998,6 +1003,7 @@
 					aclpb->aclpb_stat_num_copy_attrs);
 	slapi_log_error( SLAPI_LOG_ACL, plugin_name, " **** ACL OPERATION STAT END  *******\n");
 }
+#endif
 /****************************************************************************/
 /*				E	N	D													*/
 /****************************************************************************/


Index: acleffectiverights.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/acleffectiverights.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- acleffectiverights.c	10 Nov 2006 23:44:49 -0000	1.6
+++ acleffectiverights.c	18 Oct 2007 00:08:27 -0000	1.7
@@ -663,7 +663,6 @@
 	char *gerstr = NULL;
 	size_t gerstrsize = 0;
 	size_t gerstrcap = 0;
-	unsigned long entryrights;
 	int iscritical = 1;
 	int rc;
 
@@ -698,7 +697,7 @@
 	}
 
 	/* Get entry level effective rights */
-	entryrights = _ger_get_entry_rights ( gerpb, e, subjectndn, &gerstr, &gerstrsize, &gerstrcap, errbuf );
+	_ger_get_entry_rights ( gerpb, e, subjectndn, &gerstr, &gerstrsize, &gerstrcap, errbuf );
 
 	/*
 	 * Attribute level effective rights may not be NULL


Index: aclinit.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/aclinit.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- aclinit.c	10 Nov 2006 23:44:49 -0000	1.6
+++ aclinit.c	18 Oct 2007 00:08:27 -0000	1.7
@@ -232,7 +232,6 @@
 	 /* Tell __aclinit_handler whether it's an add or a delete */
 	Slapi_PBlock 	*aPb;
 	LDAPControl		**ctrls=NULL;
-	int				retval;
 	struct berval	*bval;
 	aclinit_handler_callback_data_t call_back_data;
 
@@ -273,7 +272,7 @@
 		ctrls[0] = NULL;
 		ctrls[1] = NULL;
 	
-		retval = slapi_build_control_from_berval(
+		slapi_build_control_from_berval(
 										MTN_CONTROL_USE_ONE_BACKEND_OID,
                 						bval,
 										1 /* is critical */, 


Index: acllas.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/acllas.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- acllas.c	10 Nov 2006 23:44:49 -0000	1.7
+++ acllas.c	18 Oct 2007 00:08:27 -0000	1.8
@@ -478,7 +478,6 @@
 	int			matched;
 	int			rc;
 	short		len;
-	char		*s = NULL;
 	const size_t 	LDAP_URL_prefix_len = strlen(LDAP_URL_prefix);
 	lasInfo			lasinfo;
 	int			got_undefined = 0;
@@ -579,9 +578,9 @@
 		} else {
 			/* URL format */
 			
-			if ((s = strstr (user, ACL_RULE_MACRO_DN_KEY)) != NULL ||
-				(s = strstr (user, ACL_RULE_MACRO_DN_LEVELS_KEY)) != NULL ||
-				(s = strstr (user, ACL_RULE_MACRO_ATTR_KEY)) != NULL) {			
+			if ((strstr (user, ACL_RULE_MACRO_DN_KEY) != NULL) ||
+				(strstr (user, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
+				(strstr (user, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
 				
 				matched = aclutil_evaluate_macro( s_user, &lasinfo,
 													ACL_EVAL_USER);
@@ -589,7 +588,7 @@
 					break;
 				}										
 				
-			} else if ((s = strchr (user, '?'))!= NULL) {
+			} else if (strchr (user, '?') != NULL) {
 				/* URL format */
 				if (acllas__client_match_URL ( lasinfo.aclpb, lasinfo.clientDn, 
 							     s_user) == ACL_TRUE) {
@@ -828,12 +827,9 @@
 					"Group not evaluated(%s)\n", groupName);
 			break;
 		} else {			
-			char	*s;
-
-			if ((s = strstr (groupName, ACL_RULE_MACRO_DN_KEY)) != NULL ||
-				(s = strstr (groupName, ACL_RULE_MACRO_DN_LEVELS_KEY)) != NULL ||
-				(s = strstr (groupName, ACL_RULE_MACRO_ATTR_KEY)) != NULL) {			
-				
+			if ((strstr (groupName, ACL_RULE_MACRO_DN_KEY) != NULL) ||
+				(strstr (groupName, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
+				(strstr (groupName, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
 				matched = aclutil_evaluate_macro( groupName, &lasinfo,
 													ACL_EVAL_GROUP);
 				slapi_log_error ( SLAPI_LOG_ACL, plugin_name,
@@ -993,12 +989,9 @@
 		} else {
 
 			/* Take care of param strings */
-		
-			char	*s;
-
-			if ((s = strstr (role, ACL_RULE_MACRO_DN_KEY)) != NULL ||
-				(s = strstr (role, ACL_RULE_MACRO_DN_LEVELS_KEY)) != NULL ||
-				(s = strstr (role, ACL_RULE_MACRO_ATTR_KEY)) != NULL) {			
+			if ((strstr (role, ACL_RULE_MACRO_DN_KEY) != NULL) ||
+				(strstr (role, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
+				(strstr (role, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
 				
 				matched = aclutil_evaluate_macro( role, &lasinfo,
 													ACL_EVAL_ROLE);
@@ -1431,6 +1424,7 @@
 	}
 }
 
+#ifdef FOR_DEBUGGING
 static void
 dump_eval_info (char *caller, struct eval_info *info, int idx)
 {
@@ -1481,7 +1475,7 @@
 		slapi_log_error ( SLAPI_LOG_FATAL, NULL, "%s\n", buf );
 	}
 }
-
+#endif
 
 /***************************************************************************
 *
@@ -1611,7 +1605,9 @@
 	max_memberlimit = aclpb->aclpb_max_member_sizelimit;
 	max_nestlevel = aclpb->aclpb_max_nesting_level;
 
-	/* dump_eval_info ( "acllas__user_ismember_of_group", &info, -1 ); */
+#ifdef FOR_DEBUGGING
+	dump_eval_info ( "acllas__user_ismember_of_group", &info, -1 );
+#endif
 
 eval_another_member:
 
@@ -2101,14 +2097,12 @@
 	*/
 	attrName = attr_pattern;
 	if (strstr(attrName, LDAP_URL_prefix)) {
-		char *s;
-
 
 		/* In this case "grppupdnattr="ldap:///base??attr" */
 
-		if ((s = strstr (attrName, ACL_RULE_MACRO_DN_KEY)) != NULL ||
-				(s = strstr (attrName, ACL_RULE_MACRO_DN_LEVELS_KEY)) != NULL ||
-				(s = strstr (attrName, ACL_RULE_MACRO_ATTR_KEY)) != NULL) {			
+		if ((strstr (attrName, ACL_RULE_MACRO_DN_KEY) != NULL) ||
+			(strstr (attrName, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
+			(strstr (attrName, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
 				
 				matched = aclutil_evaluate_macro( attrName, &lasinfo,
 													ACL_EVAL_GROUPDNATTR);
@@ -3162,7 +3156,6 @@
 								  Slapi_DN *roleDN, Slapi_DN *clientDn) {
 
 	int present = 0;
-	int rc = 0;
 
 	/* Get the client's entry if we don't have already */
 	if ( aclpb && ( NULL == aclpb->aclpb_client_entry )) {
@@ -3202,7 +3195,7 @@
 
 	/* If the client has the role then it's a match, otherwise no */
 
-	rc = slapi_role_check( aclpb->aclpb_client_entry, roleDN, &present);
+	slapi_role_check( aclpb->aclpb_client_entry, roleDN, &present);
 	if ( present ) {
 		return(ACL_TRUE);
 	}							
@@ -3356,13 +3349,11 @@
 	char **tptr = NULL;
 	char *t = NULL;
 	char *s = NULL;
-	char *target_dn = NULL;
 	struct acl_pblock *aclpb = lasinfo->aclpb;
-	int found_matched_val_in_ht = 0;
 
 	aci = lasinfo->aclpb->aclpb_curr_aci;
 	/* Get a pointer to the ndn in the resouirce */
-	target_dn = slapi_entry_get_ndn (  lasinfo->resourceEntry );
+	slapi_entry_get_ndn (  lasinfo->resourceEntry );
 
 	/*
 	 * First, get the matched value from the target resource.
@@ -3395,8 +3386,6 @@
 				"ACL info: found matched_val (%s) for aci index %d"
 				"in macro ht\n", 
 				aci->aclName, aci->aci_index,0);
-	
-			found_matched_val_in_ht = 1;
 		}
 	}
 
@@ -3740,14 +3729,10 @@
 acllas_eval_one_user( struct acl_pblock *aclpb, char * clientDN, char *rule) {
 
 	int exact_match = 0;
-	int ret_code = 0;
 	const size_t 	LDAP_URL_prefix_len = strlen(LDAP_URL_prefix);
-	char *s = NULL;
-
-	
 
 	/* URL format */
-	if ((s = strchr (rule, '?'))!= NULL) {
+	if (strchr (rule, '?') != NULL) {
 				/* URL format */
 				if (acllas__client_match_URL ( aclpb, clientDN, 
 							     rule) == ACL_TRUE) {
@@ -3763,7 +3748,7 @@
 		/* Here, contains a =*, so need to match comp by comp */
 		/* skip the ldap:/// part */
 		rule += LDAP_URL_prefix_len;
-		ret_code = acl_match_prefix( rule, clientDN, &exact_match);
+		acl_match_prefix( rule, clientDN, &exact_match);
 	}
 	if ( exact_match) {
 		return( ACL_TRUE);


Index: aclparse.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/aclparse.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- aclparse.c	10 Nov 2006 23:44:49 -0000	1.6
+++ aclparse.c	18 Oct 2007 00:08:27 -0000	1.7
@@ -1768,7 +1768,7 @@
 static int process_filter_list( Targetattrfilter ***input_attrFilterArray,
 						  char * input_str) {
 
-	char *str, *end_attr, *tmp_attr;
+	char *str, *end_attr;
 	Targetattrfilter *attrfilter = NULL;
 	int		numattr=0;
 	Targetattrfilter **attrFilterArray = NULL;
@@ -1801,7 +1801,7 @@
 		attrfilter = (Targetattrfilter *) slapi_ch_malloc (sizeof (Targetattrfilter));
 		memset (attrfilter, 0, sizeof(Targetattrfilter));
 
-		if ((tmp_attr = strstr( str,":")) != NULL) {
+		if (strstr( str,":") != NULL) {
 			
 			if ( __acl_init_targetattrfilter( attrfilter, str ) != 0 ) {
 				slapi_ch_free((void**)&attrfilter);


Index: aclutil.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/aclutil.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- aclutil.c	10 Nov 2006 23:44:49 -0000	1.7
+++ aclutil.c	18 Oct 2007 00:08:27 -0000	1.8
@@ -57,7 +57,9 @@
 static PRIntn	acl_ht_free_entry_and_value(PLHashEntry *he, PRIntn i,
 																void *arg);
 static PLHashNumber acl_ht_hash( const void *key);
+#ifdef FOR_DEBUGGING
 static PRIntn	acl_ht_display_entry(PLHashEntry *he, PRIntn i, void *arg);
+#endif
 
 /***************************************************************************/
 /*	UTILITY FUNCTIONS						   */
@@ -664,7 +666,6 @@
 	char *macro_suffix = NULL;
 	char *tmp_ptr = NULL;
 	char *matched_val = NULL;
-	char *ndn_suffix_start = NULL;
 	char *ret_val = NULL;
 	int ndn_len = 0;
 	int macro_suffix_len = 0;
@@ -717,9 +718,6 @@
 		}
 	}
 
-	/* Start of the suffix in ndn...and it matched. */
-	ndn_suffix_start = (char*)&ndn[ndn_len-macro_suffix_len];
-
 	/* Here, macro_suffix is a suffix of ndn.
 	 * 
 	 *
@@ -1374,11 +1372,12 @@
 /* Free all the values in the ht */
 void acl_ht_display_ht( acl_ht_t *acl_ht) {
 
-#ifdef DEBUG
+#ifdef FOR_DEBUGGING
 	PL_HashTableEnumerateEntries( acl_ht, acl_ht_display_entry, NULL);
 #endif
 }
 
+#ifdef FOR_DEBUGGING
 static PRIntn
 acl_ht_display_entry(PLHashEntry *he, PRIntn i, void *arg)
 {
@@ -1393,6 +1392,7 @@
     return HT_ENUMERATE_NEXT;
 
 }
+#endif
 
 /* remove this entry from the ht--doesn't free the value.*/
 void acl_ht_remove( acl_ht_t *acl_ht, PLHashNumber key) {




More information about the Fedora-directory-commits mailing list