summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/acl/aclinit.c
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2008-12-05 22:41:53 +0000
committerRich Megginson <rmeggins@redhat.com>2008-12-05 22:41:53 +0000
commit0253cf3cca45f65caaeabfe886a41da5de916bdc (patch)
treefaab17e1bf51b7ff1b147c6c648bbb6075b2a359 /ldap/servers/plugins/acl/aclinit.c
parent458a42a89182a23408e0db6482c59736936410d4 (diff)
downloadds-0253cf3cca45f65caaeabfe886a41da5de916bdc.tar.gz
ds-0253cf3cca45f65caaeabfe886a41da5de916bdc.tar.xz
ds-0253cf3cca45f65caaeabfe886a41da5de916bdc.zip
Resolves: bug 454030
Bug Description: Need to address 64-bit compiler warnings - again Reviewed by: nhosoi (Thanks!) Fix Description: This patch cleans up most of the other remaining compiler warnings. I compiled the directory server code with these flags on RHEL5 x86_64: -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic I also enabled argument/format match checking for most of the commonly used varadic functions. Most of the problems I found fell into these categories: 1) Too many or not enough arguments e.g. most everything that uses or did use LDAPDebug had extra 0,0 arguments. If they had been switched to use slapi_log_error, I removed the extra arguments - for those places still using LDAPDebug, I introduced more macros to handle the number of arguments, since C macros cannot be varadic. 2) When using NSPR formatting functions, we have to use %llu or %lld for 64-bit values, even on 64-bit systems. However, for regular system formatting functions, we have to use %ld or %lu. I introduced two new macros NSPRIu64 and NSPRI64 to handle cases where we are passing explicit 64-bit values to NSPR formatting functions, so that we can use the regular PRIu64 and PRI64 macros for regular system formatting functions. I also made sure we used NSPRI* only with NSPR functions, and used PRI* only with system functions. 3) use %lu for size_t and %ld for time_t I did find a few "real" errors, places that the code was doing something definitely not right: https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/acl/aclinit.c_sec4 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/acl/acllas.c_sec17 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/http/http_impl.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/memberof/memberof.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/pam_passthru/pam_ptimpl.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/cl5_api.c_sec5 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/cl5_clcache.c_sec2 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/replutil.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/libglobs.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/back-ldbm/dbverify.c_sec2 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/back-ldbm/ldif2ldbm.c_sec3 This is why it's important to use this compiler checking, and why it's important to fix compiler warnings, if for no other reason than the sheer noise from so many warnings can mask real errors. Platforms tested: RHEL5 Flag Day: no Doc impact: no
Diffstat (limited to 'ldap/servers/plugins/acl/aclinit.c')
-rw-r--r--ldap/servers/plugins/acl/aclinit.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/ldap/servers/plugins/acl/aclinit.c b/ldap/servers/plugins/acl/aclinit.c
index 9ef4993f..46095925 100644
--- a/ldap/servers/plugins/acl/aclinit.c
+++ b/ldap/servers/plugins/acl/aclinit.c
@@ -86,7 +86,7 @@ aclinit_main()
/* Initialize the LIBACCESS ACL library */
if (ACL_Init() != 0) {
slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
- "ACL Library Initialization failed\n",0,0,0);
+ "ACL Library Initialization failed\n");
return 1;
}
@@ -240,7 +240,7 @@ aclinit_search_and_update_aci ( int thisbeonly, const Slapi_DN *base,
if ( thisbeonly && be_name == NULL) {
slapi_log_error ( SLAPI_LOG_FATAL, plugin_name,
- "Error: This be_name must be specified.\n", 0, 0, 0);
+ "Error: This be_name must be specified.\n");
return -1;
}
@@ -387,7 +387,7 @@ __aclinit_handler ( Slapi_Entry *e, void *callback_data)
slapi_log_error ( SLAPI_LOG_FATAL, plugin_name,
"Error: This (%s) ACL will not be considered for evaluation"
" because of syntax errors.\n",
- attrValue->bv_val ? attrValue->bv_val: "NULL", 0, 0);
+ attrValue->bv_val ? attrValue->bv_val: "NULL");
call_back_data->retCode = rv;
}
i= slapi_attr_next_value( attr, i, &sval );
@@ -409,7 +409,7 @@ __aclinit_handler ( Slapi_Entry *e, void *callback_data)
/* We got an error; Log it and then march along */
slapi_log_error ( SLAPI_LOG_FATAL, plugin_name,
"Error: ACls not deleted from %s\n",
- e_sdn, 0, 0);
+ slapi_sdn_get_dn(e_sdn));
call_back_data->retCode = rv;
}
if ( call_back_data->lock_flag == DO_TAKE_ACLCACHE_WRITELOCK) {
@@ -458,14 +458,14 @@ __aclinit__RegisterAttributes(void)
if (rv < 0) {
acl_print_acllib_err(&errp, NULL);
slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
- "Unable to Register the methods\n", 0,0,0);
+ "Unable to Register the methods\n");
return ACL_ERR;
}
rv = ACL_MethodSetDefault (&errp, methodinfo);
if (rv < 0) {
acl_print_acllib_err(&errp, NULL);
slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
- "Unable to Set the default method\n", 0,0,0);
+ "Unable to Set the default method\n");
return ACL_ERR;
}
rv = ACL_AttrGetterRegister(&errp, ACL_ATTR_IP, DS_LASIpGetter,
@@ -473,7 +473,7 @@ __aclinit__RegisterAttributes(void)
if (rv < 0) {
acl_print_acllib_err(&errp, NULL);
slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
- "Unable to Register Attr ip\n", 0,0,0);
+ "Unable to Register Attr ip\n");
return ACL_ERR;
}
rv = ACL_AttrGetterRegister(&errp, ACL_ATTR_DNS, DS_LASDnsGetter,
@@ -481,7 +481,7 @@ __aclinit__RegisterAttributes(void)
if (rv < 0) {
acl_print_acllib_err(&errp, NULL);
slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
- "Unable to Register Attr dns\n", 0,0,0);
+ "Unable to Register Attr dns\n");
return ACL_ERR;
}
return ACL_OK;
@@ -512,59 +512,59 @@ __aclinit__RegisterLases(void)
if (ACL_LasRegister(NULL, DS_LAS_USER, (LASEvalFunc_t) DS_LASUserEval,
(LASFlushFunc_t) NULL) < 0) {
slapi_log_error (SLAPI_LOG_FATAL, plugin_name,
- "Unable to register USER Las\n",0,0,0);
+ "Unable to register USER Las\n");
return ACL_ERR;
}
if (ACL_LasRegister(NULL, DS_LAS_GROUP, (LASEvalFunc_t) DS_LASGroupEval,
(LASFlushFunc_t) NULL) < 0) {
slapi_log_error (SLAPI_LOG_FATAL, plugin_name,
- "Unable to register GROUP Las\n",0,0,0);
+ "Unable to register GROUP Las\n");
return ACL_ERR;
}
if (ACL_LasRegister(NULL, DS_LAS_GROUPDN, (LASEvalFunc_t)DS_LASGroupDnEval,
(LASFlushFunc_t)NULL) < 0) {
slapi_log_error (SLAPI_LOG_FATAL, plugin_name,
- "Unable to register GROUPDN Las\n",0,0,0);
+ "Unable to register GROUPDN Las\n");
return ACL_ERR;
}
if (ACL_LasRegister(NULL, DS_LAS_ROLEDN, (LASEvalFunc_t)DS_LASRoleDnEval,
(LASFlushFunc_t)NULL) < 0) {
slapi_log_error (SLAPI_LOG_FATAL, plugin_name,
- "Unable to register ROLEDN Las\n",0,0,0);
+ "Unable to register ROLEDN Las\n");
return ACL_ERR;
}
if (ACL_LasRegister(NULL, DS_LAS_USERDN, (LASEvalFunc_t)DS_LASUserDnEval,
(LASFlushFunc_t)NULL) < 0) {
slapi_log_error (SLAPI_LOG_FATAL, plugin_name,
- "Unable to register USERDN Las\n",0,0,0);
+ "Unable to register USERDN Las\n");
return ACL_ERR;
}
if (ACL_LasRegister(NULL, DS_LAS_USERDNATTR,
(LASEvalFunc_t)DS_LASUserDnAttrEval,
(LASFlushFunc_t)NULL) < 0) {
slapi_log_error (SLAPI_LOG_FATAL, plugin_name,
- "Unable to register USERDNATTR Las\n",0,0,0);
+ "Unable to register USERDNATTR Las\n");
return ACL_ERR;
}
if (ACL_LasRegister(NULL, DS_LAS_AUTHMETHOD,
(LASEvalFunc_t)DS_LASAuthMethodEval,
(LASFlushFunc_t)NULL) < 0) {
slapi_log_error (SLAPI_LOG_FATAL, plugin_name,
- "Unable to register CLIENTAUTHTYPE Las\n",0,0,0);
+ "Unable to register CLIENTAUTHTYPE Las\n");
return ACL_ERR;
}
if (ACL_LasRegister(NULL, DS_LAS_GROUPDNATTR,
(LASEvalFunc_t)DS_LASGroupDnAttrEval,
(LASFlushFunc_t)NULL) < 0) {
slapi_log_error (SLAPI_LOG_FATAL, plugin_name,
- "Unable to register GROUPDNATTR Las\n",0,0,0);
+ "Unable to register GROUPDNATTR Las\n");
return ACL_ERR;
}
if (ACL_LasRegister(NULL, DS_LAS_USERATTR,
(LASEvalFunc_t)DS_LASUserAttrEval,
(LASFlushFunc_t)NULL) < 0) {
slapi_log_error (SLAPI_LOG_FATAL, plugin_name,
- "Unable to register USERATTR Las\n",0,0,0);
+ "Unable to register USERATTR Las\n");
return ACL_ERR;
}
return ACL_OK;