From: Graham Leggett Date: Thu, 26 Dec 2013 18:01:53 +0000 (+0000) Subject: * easy proposals to synch 2.4.x and trunk X-Git-Tag: 2.4.8~334 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7d0a244a5c58c9d3cb73c0914f35c6d15a9422e;p=apache * easy proposals to synch 2.4.x and trunk - Use apr_file_printf(... "%pm"...) instead of explicit call to apr_strerror - remove unused variables - axe some useless assignments (clang scan-build) - Remove useless apr_pstrdup as done for other mod_auth modules in r1026660 - Remove unused APXS setting from template for generated Makefile git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1553528 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index ee0a9bfb61..94ddf46ce9 100644 --- a/STATUS +++ b/STATUS @@ -98,23 +98,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * easy proposals to synch 2.4.x and trunk - - Use apr_file_printf(... "%pm"...) instead of explicit call to apr_strerror - - remove unused variables - - axe some useless assignments (clang scan-build) - - Remove useless apr_pstrdup as done for other mod_auth modules in r1026660 - - Remove unused APXS setting from template for generated Makefile - trunk patches: - - https://svn.apache.org/viewvc?view=revision&revision=1464674 - - https://svn.apache.org/viewvc?view=revision&revision=1465084 - - https://svn.apache.org/viewvc?view=revision&revision=1534997 - - https://svn.apache.org/viewvc?view=revision&revision=1538149 - - https://svn.apache.org/viewvc?view=revision&revision=1535699 - 2.4.x patches: trunk patches work - - the 3 first ones partially apply because of files which are not part of 2.4.x - http://people.apache.org/~jim/patches/ez-2.4-v1.patch - +1: jailletc36, jim, minfrin - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/aaa/mod_auth_form.c b/modules/aaa/mod_auth_form.c index 7bba517b80..474a9de235 100644 --- a/modules/aaa/mod_auth_form.c +++ b/modules/aaa/mod_auth_form.c @@ -149,7 +149,7 @@ static const char *add_authn_provider(cmd_parms * cmd, void *config, authn_provider_list *newp; newp = apr_pcalloc(cmd->pool, sizeof(authn_provider_list)); - newp->provider_name = apr_pstrdup(cmd->pool, arg); + newp->provider_name = arg; /* lookup and cache the actual provider now */ newp->provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, diff --git a/modules/aaa/mod_authz_dbm.c b/modules/aaa/mod_authz_dbm.c index 4f13caeab5..bb893d4442 100644 --- a/modules/aaa/mod_authz_dbm.c +++ b/modules/aaa/mod_authz_dbm.c @@ -210,7 +210,6 @@ static authz_status dbmfilegroup_check_authorization(request_rec *r, char *user = r->user; const char *realm = ap_auth_name(r); const char *filegroup = NULL; - const char *orig_groups = NULL; apr_status_t status; const char *groups; char *v; @@ -245,12 +244,9 @@ static authz_status dbmfilegroup_check_authorization(request_rec *r, return AUTHZ_DENIED; } - orig_groups = groups; - filegroup = authz_owner_get_file_group(r); if (filegroup) { - groups = orig_groups; while (groups[0]) { v = ap_getword(r->pool, &groups, ','); if (!strcmp(v, filegroup)) { diff --git a/support/apxs.in b/support/apxs.in index 8bdc2daca0..ad1287ffb1 100644 --- a/support/apxs.in +++ b/support/apxs.in @@ -676,7 +676,6 @@ top_builddir=%PREFIX% include %INSTALLBUILDDIR%/special.mk # the used tools -APXS=apxs APACHECTL=apachectl # additional defines, includes and libraries diff --git a/support/htcacheclean.c b/support/htcacheclean.c index 4150936fbb..92d09e183a 100644 --- a/support/htcacheclean.c +++ b/support/htcacheclean.c @@ -1087,9 +1087,8 @@ static apr_status_t remove_directory(apr_pool_t *pool, const char *dir) return rv; } if (rv != APR_SUCCESS) { - char errmsg[120]; - apr_file_printf(errfile, "Could not open directory %s: %s" APR_EOL_STR, - dir, apr_strerror(rv, errmsg, sizeof errmsg)); + apr_file_printf(errfile, "Could not open directory %s: %pm" APR_EOL_STR, + dir, &rv); return rv; } @@ -1110,10 +1109,9 @@ static apr_status_t remove_directory(apr_pool_t *pool, const char *dir) const char *file = apr_pstrcat(pool, dir, "/", dirent.name, NULL); rv = apr_file_remove(file, pool); if (APR_SUCCESS != rv) { - char errmsg[120]; apr_file_printf(errfile, - "Could not remove file '%s': %s" APR_EOL_STR, file, - apr_strerror(rv, errmsg, sizeof errmsg)); + "Could not remove file '%s': %pm" APR_EOL_STR, file, + &rv); break; } } @@ -1127,9 +1125,8 @@ static apr_status_t remove_directory(apr_pool_t *pool, const char *dir) rv = APR_SUCCESS; } if (rv != APR_SUCCESS) { - char errmsg[120]; - apr_file_printf(errfile, "Could not remove directory %s: %s" APR_EOL_STR, - dir, apr_strerror(rv, errmsg, sizeof errmsg)); + apr_file_printf(errfile, "Could not remove directory %s: %pm" APR_EOL_STR, + dir, &rv); } } @@ -1151,9 +1148,8 @@ static apr_status_t find_directory(apr_pool_t *pool, const char *base, rv = apr_dir_open(&dirp, base, pool); if (rv != APR_SUCCESS) { - char errmsg[120]; - apr_file_printf(errfile, "Could not open directory %s: %s" APR_EOL_STR, - base, apr_strerror(rv, errmsg, sizeof errmsg)); + apr_file_printf(errfile, "Could not open directory %s: %pm" APR_EOL_STR, + base, &rv); return rv; } @@ -1194,18 +1190,16 @@ static apr_status_t find_directory(apr_pool_t *pool, const char *base, remove = apr_pstrcat(pool, base, "/", header, NULL); status = apr_file_remove(remove, pool); if (status != APR_SUCCESS && !APR_STATUS_IS_ENOENT(status)) { - char errmsg[120]; - apr_file_printf(errfile, "Could not remove file %s: %s" APR_EOL_STR, - remove, apr_strerror(status, errmsg, sizeof errmsg)); + apr_file_printf(errfile, "Could not remove file %s: %pm" APR_EOL_STR, + remove, &status); rv = status; } remove = apr_pstrcat(pool, base, "/", data, NULL); status = apr_file_remove(remove, pool); if (status != APR_SUCCESS && !APR_STATUS_IS_ENOENT(status)) { - char errmsg[120]; - apr_file_printf(errfile, "Could not remove file %s: %s" APR_EOL_STR, - remove, apr_strerror(status, errmsg, sizeof errmsg)); + apr_file_printf(errfile, "Could not remove file %s: %pm" APR_EOL_STR, + remove, &status); rv = status; } @@ -1357,7 +1351,6 @@ static void usage_repeated_arg(apr_pool_t *pool, char option) { static void log_pid(apr_pool_t *pool, const char *pidfilename, apr_file_t **pidfile) { apr_status_t status; - char errmsg[120]; pid_t mypid = getpid(); if (APR_SUCCESS == (status = apr_file_open(pidfile, pidfilename, @@ -1369,9 +1362,8 @@ static void log_pid(apr_pool_t *pool, const char *pidfilename, apr_file_t **pidf else { if (errfile) { apr_file_printf(errfile, - "Could not write the pid file '%s': %s" APR_EOL_STR, - pidfilename, - apr_strerror(status, errmsg, sizeof errmsg)); + "Could not write the pid file '%s': %pm" APR_EOL_STR, + pidfilename, &status); } exit(1); } @@ -1393,7 +1385,6 @@ int main(int argc, const char * const argv[]) char opt; const char *arg; char *proxypath, *path, *pidfilename; - char errmsg[1024]; interrupted = 0; repeat = 0; @@ -1579,8 +1570,8 @@ int main(int argc, const char * const argv[]) } proxypath = apr_pstrdup(pool, arg); if ((status = apr_filepath_set(proxypath, pool)) != APR_SUCCESS) { - usage(apr_psprintf(pool, "Could not set filepath to '%s': %s", - proxypath, apr_strerror(status, errmsg, sizeof errmsg))); + usage(apr_psprintf(pool, "Could not set filepath to '%s': %pm", + proxypath, &status)); } break; @@ -1680,8 +1671,7 @@ int main(int argc, const char * const argv[]) } if (apr_filepath_get(&path, 0, pool) != APR_SUCCESS) { - usage(apr_psprintf(pool, "Could not get the filepath: %s", - apr_strerror(status, errmsg, sizeof errmsg))); + usage(apr_psprintf(pool, "Could not get the filepath: %pm", &status)); } baselen = strlen(path);