admserv/cgi-src40/admpw.c | 3 +--
admserv/cgi-src40/config.c | 3 ---
admserv/cgi-src40/viewlog.c | 2 +-
mod_admserv/mod_admserv.c | 9 ++++++---
4 files changed, 8 insertions(+), 9 deletions(-)
New commits:
commit 0f9bcc0f95dd5523b4a5f4739ae095b6adfd5af0
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Apr 26 13:54:07 2011 -0700
Bug 699815 - (cov#10849,10851) Remove unused variables
There are a few unused variables that should be removed from the
adminserver code.
diff --git a/admserv/cgi-src40/admpw.c b/admserv/cgi-src40/admpw.c
index cbba671..ff0dc6c 100644
--- a/admserv/cgi-src40/admpw.c
+++ b/admserv/cgi-src40/admpw.c
@@ -264,7 +264,7 @@ static void output_admuid(AdmldapInfo admInfo) {
static void update_uidpwd(AdmldapInfo admInfo) {
FILE *f;
- char *uid=NULL ,*pw=NULL, *col=NULL;
+ char *uid=NULL, *pw=NULL, *col=NULL;
char *newuid=NULL, *newpw=NULL;
static char filename[BIG_LINE];
static char inbuf[BIG_LINE];
@@ -273,7 +273,6 @@ static void update_uidpwd(AdmldapInfo admInfo) {
PR_snprintf(filename, sizeof(filename), tmpfile);
PL_strfree(tmpfile);
- uid = admldapGetLocalAdminName(admInfo);
newuid = get_cgi_var("admpw.uid",NULL, NULL);
newpw = get_cgi_var("admpw.pw",NULL, NULL);
if (newuid==NULL && newpw==NULL) {
diff --git a/admserv/cgi-src40/config.c b/admserv/cgi-src40/config.c
index 8e04f88..69e89f6 100644
--- a/admserv/cgi-src40/config.c
+++ b/admserv/cgi-src40/config.c
@@ -165,7 +165,6 @@ int main(int argc, char *argv[])
AttributePtr nv;
char *acceptLanguage = (char*)"en";
Resource *i18nResource = NULL;
- AdmldapInfo adminfo = NULL;
char *configdir = util_get_conf_dir();
char *secdir = util_get_security_dir();
char *logdir = util_get_log_dir();
@@ -263,8 +262,6 @@ int main(int argc, char *argv[])
if (binddn) rv = ADM_GetCurrentPassword(&err, &bindpw);
- adminfo = admldapBuildInfo(configdir, &rv);
-
errorCode = ADMSSL_InitSimple(configdir, secdir, 1);
if (errorCode) {
if (i18nResource)
commit 511a345be262920d19ecf73bc7093446c2d03b1a
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Apr 26 09:57:04 2011 -0700
Bug 699815 - (cov#10858) getenv() called twice in viewlog cgi
We call getenv() twice to set qs. We should only call getenv() to
set qs if the GET method is being used.
diff --git a/admserv/cgi-src40/viewlog.c b/admserv/cgi-src40/viewlog.c
index 2eff9c2..a24130b 100644
--- a/admserv/cgi-src40/viewlog.c
+++ b/admserv/cgi-src40/viewlog.c
@@ -305,7 +305,7 @@ int main(int argc, char *argv[])
{
int _ai = ADMUTIL_Init();
- char *qs = getenv("QUERY_STRING");
+ char *qs = NULL;
char line[BIG_LINE];
FILE *html = open_html_file(MY_PAGE);
char *method = NULL;
commit 0241013085c58b6af06bb6f6633fcbf81fc1ae54
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Apr 26 09:42:32 2011 -0700
Bug 699815 - (cov#10859) Add missing braces in mod_admserv code
There are a few spots in mod_admserv where we attempt to reconnect
to DS. The braces on the if statements were left out, so the loops
that retry the connection are only executed once. This adds the
braces so the connection is retried.
diff --git a/mod_admserv/mod_admserv.c b/mod_admserv/mod_admserv.c
index ede5c33..3c3e9e0 100644
--- a/mod_admserv/mod_admserv.c
+++ b/mod_admserv/mod_admserv.c
@@ -2652,10 +2652,11 @@ authenticate_user(LdapServerData *data, char *baseDN, char *user,
const char *pw
break;
closeLDAPConnection(server);
- if (!(server = openLDAPConnection(data)))
+ if (!(server = openLDAPConnection(data))) {
ap_log_rerror(APLOG_MARK, APLOG_NOTICE|APLOG_NOERRNO, 0, r,
"unable to open LDAPConnection to server [%s:%d]", data->host,
data->port);
return DECLINED;
+ }
} while (server != NULL && ++tries < 2);
if (ldapError != LDAPU_SUCCESS)
@@ -2683,11 +2684,12 @@ authenticate_user(LdapServerData *data, char *baseDN, char *user,
const char *pw
break;
closeLDAPConnection(server);
- if(!(server = openLDAPConnection(data)))
+ if(!(server = openLDAPConnection(data))) {
ap_log_rerror(APLOG_MARK, APLOG_NOTICE|APLOG_NOERRNO, 0, r,
"unable to find user [%s] in server [%s:%d] under base DN
[%s]",
user, data->host, data->port, data->baseDN ?
data->baseDN : baseDN);
return DECLINED;
+ }
} while (server != NULL && ++tries < 2);
if (ldapError != LDAPU_SUCCESS)
@@ -2725,11 +2727,12 @@ authenticate_user(LdapServerData *data, char *baseDN, char *user,
const char *pw
break;
closeLDAPConnection(server);
- if(!(server = openLDAPConnection(data)))
+ if(!(server = openLDAPConnection(data))) {
ap_log_rerror(APLOG_MARK, APLOG_NOTICE|APLOG_NOERRNO, 0, r,
"unable to bind as [%s] to server [%s:%d]",
userdn, data->host, data->port); /*i18n*/
return DECLINED;
+ }
} while (server != NULL && ++tries < 2);
if (ldapError != LDAP_SUCCESS)