[Fedora-directory-commits] mod_admserv mod_admserv.c,1.34,1.35
Richard Allen Megginson
rmeggins at fedoraproject.org
Thu Dec 4 20:01:48 UTC 2008
Author: rmeggins
Update of /cvs/dirsec/mod_admserv
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1338
Modified Files:
mod_admserv.c
Log Message:
Fix various compiler warnings about define redefinitions, unused functions/variables, wrong types being cast, etc.
Index: mod_admserv.c
===================================================================
RCS file: /cvs/dirsec/mod_admserv/mod_admserv.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- mod_admserv.c 3 Sep 2008 17:32:51 -0000 1.34
+++ mod_admserv.c 4 Dec 2008 20:01:45 -0000 1.35
@@ -25,7 +25,25 @@
*/
#include <unistd.h>
+/* httpd.h defines
+ all of these unconditionally - so we undefine
+ them here to make the compiler warnings shut up
+ hopefully we don't need the real versions
+ of these, but then with no warnings the compiler
+ will just silently redefine them to the wrong
+ ones anyway
+ Then undefine them after the include so that
+ our own local defines will take effect
+*/
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
#include "httpd.h"
+#define CORE_PRIVATE 1 /* to pick up ap_die */
+#include "http_request.h"
+#undef CORE_PRIVATE
#include "apr_strings.h"
#include "apr_lib.h"
#include "apr_optional.h"
@@ -43,8 +61,12 @@
#include "http_config.h"
#include "http_connection.h"
#include "http_protocol.h"
-#include "http_request.h"
#include "http_log.h"
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
/* need uid and gid of apache process after setuid */
#if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
@@ -543,7 +565,7 @@
static apr_status_t close_pipe(void *thefd)
{
- int fd = (int)thefd;
+ int fd = (int)((intptr_t)thefd);
return close(fd);
}
@@ -597,7 +619,7 @@
/* Register a cleanup callback so this gets closed at the end of the
request. */
- apr_pool_cleanup_register(r->pool, (void *)fd, close_pipe,
+ apr_pool_cleanup_register(r->pool, (void *)((intptr_t)fd), close_pipe,
apr_pool_cleanup_null);
/* Send this to the client so they know what fd to read from */
@@ -786,7 +808,6 @@
AdmldapInfo info = NULL;
server_rec *s = r->server;
int error = 0;
- char path[PATH_MAX];
char *userGroupLdapURL = NULL;
char *userGroupBindDN = NULL;
char *userGroupBindPW = NULL;
@@ -1192,7 +1213,6 @@
}
static int update_admpwd(char *admroot, char *newuid, char *newpw);
-static int update_adm_conf(char *admroot, char *newpw);
/*
* Miodrag (06-15-98)
@@ -1213,7 +1233,6 @@
char *adminDN = NULL;
LDAPMod mod, *mods[2];
char *vals[2];
- char *attrs[2];
int rval = 0;
int error;
@@ -1318,7 +1337,7 @@
change_sie_password(const char *name, char *query, void* arg, request_rec *r)
{
FILE *f;
- char *uid=NULL ,*pw=NULL, *col=NULL, *origpw_hash=NULL;
+ char *uid=NULL , *col=NULL, *origpw_hash=NULL;
char *newpw=query;
char filename[BIG_LINE];
char inbuf[BIG_LINE];
@@ -2215,10 +2234,8 @@
server_rec *base_server)
{
AdmldapInfo info;
- char path[PATH_MAX];
int error;
LDAP *server;
- char *errorInfo = NULL;
int tries = 0;
admserv_serv_config *srv_cfg = NULL;
@@ -2447,7 +2464,7 @@
cf->nescompat = 0;
cf->adminsdk = 0;
cf->cgibindir = 0;
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, "[%d] create_config [0x%x] for %s",
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, "[%d] create_config [0x%p] for %s",
getpid(), cf, path ? path : "(null)");
return (void *) cf;
@@ -2459,7 +2476,7 @@
static void * create_server_config(apr_pool_t *p, server_rec *s)
{
admserv_serv_config * cf = (admserv_serv_config *) apr_pcalloc(p, sizeof(admserv_serv_config));
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, "[%d] create_server_config [0x%x] for %s",
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, "[%d] create_server_config [0x%p] for %s",
getpid(), cf, s->server_hostname ? s->server_hostname : "(null)");
cf->gconfig = admserv_config_global_create(s);
@@ -2519,7 +2536,7 @@
cf->cacheLifeTime = atol(value);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL,
- "[%d] Set [0x%x] [%s] to %ld",
+ "[%d] Set [0x%p] [%s] to %ld",
getpid(), cf, cmd->directive->directive, cf->cacheLifeTime);
}
@@ -2537,7 +2554,7 @@
cf->versionString = apr_pstrdup(cmd->pool, value);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL,
- "[%d] Set [0x%x] [%s] to %s",
+ "[%d] Set [0x%p] [%s] to %s",
getpid(), cf, cmd->directive->directive, cf->versionString);
}
More information about the Fedora-directory-commits
mailing list