httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1416581 - in /httpd/httpd/branches/2.4.x: ./ docs/manual/ docs/manual/mod/ modules/examples/ modules/generators/ modules/ldap/ modules/loggers/ modules/session/ modules/ssl/ server/ support/ support/win32/
Date Mon, 03 Dec 2012 16:33:45 GMT
Author: jim
Date: Mon Dec  3 16:33:42 2012
New Revision: 1416581

URL: http://svn.apache.org/viewvc?rev=1416581&view=rev
Log:
Merge r1337344, r1378178, r1397636, r1398025, r1398040, r1398481, r1407004, r1407006, r1407088,
r1407528 from trunk:

* support/suexec.c: Add gcc format-string attributes to logging
  functions.  
  (main): Always print uid/gid as unsigned long, and cast to avoid
  warnings (which somewhat defeats the point of the format string
  attrs, but is necessary since the size of gid/uid varies).


remove an unnecessary check in a nest loop of ap_create_environment()


s/;;/;/

No need to test for NULL before calling apr_pstrdup.

No need it apr_pcalloc here, the memory is fully initialized the line just after

cppCheck: unreadVariable - 'serviceFlag' is not used in the function, so remove it

Remove unused code. "Next week" hasn't happened in the last 10 years or so.


log client error at level debug, log broken Host header value


remove some more old unused code


remove obsolete comment from 1.3 days

Submitted by: jorton, pqf, jailletc36, jailletc36, jailletc36, jailletc36, sf, sf, sf, sf
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/docs/manual/   (props changed)
    httpd/httpd/branches/2.4.x/docs/manual/mod/   (props changed)
    httpd/httpd/branches/2.4.x/modules/examples/mod_example_hooks.c
    httpd/httpd/branches/2.4.x/modules/generators/mod_autoindex.c
    httpd/httpd/branches/2.4.x/modules/ldap/util_ldap.c
    httpd/httpd/branches/2.4.x/modules/loggers/mod_log_config.c
    httpd/httpd/branches/2.4.x/modules/session/mod_session.c
    httpd/httpd/branches/2.4.x/modules/ssl/ssl_engine_vars.c
    httpd/httpd/branches/2.4.x/server/error_bucket.c
    httpd/httpd/branches/2.4.x/server/protocol.c
    httpd/httpd/branches/2.4.x/server/provider.c
    httpd/httpd/branches/2.4.x/server/util_script.c
    httpd/httpd/branches/2.4.x/server/vhost.c
    httpd/httpd/branches/2.4.x/support/suexec.c
    httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1337344,1378178,1397636,1398025,1398040,1398481,1407004,1407006,1407088,1407528

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Mon Dec  3 16:33:42 2012
@@ -97,34 +97,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      documentation patch : http://apache-doc-fr.gryzor.com/fallbackresource_disabled_2.4_doc.patch
      +1: gryzor, covener, sf
 
-    * proposal 1/x: try to keep 2.4.x in line with trunk.
-      Only small and trivial patches. No CHANGES needed IMO (maybe needed for 1407006 ?).
-      I will propose other ones the same way if you find it interesting.
-         1407004: Remove unused code. "Next week" hasn't happened in the last 10 years or
so.
-         1407528: remove obsolete comment from 1.3 days
-         1407088: remove some more old unused code
-         1397636: s/;;/;/
-         1378178: remove an unnecessary check in a nest loop of ap_create_environment()
-         1407006: log client error at level debug, log broken Host header value
-         1337344: support/suexec.c: Add gcc format-string attributes to logging functions.
-         1398481: cppCheck: unreadVariable - 'serviceFlag' is not used in the function, so
remove it
-         1398025: No need to test for NULL before calling apr_pstrdup.
-         1398040: No need it apr_pcalloc here, the memory is fully initialized the line just
after
-      trunk patches:
-         http://svn.apache.org/viewvc?view=revision&revision=1407004
-         http://svn.apache.org/viewvc?view=revision&revision=1407528
-         http://svn.apache.org/viewvc?view=revision&revision=1407088
-         http://svn.apache.org/viewvc?view=revision&revision=1397636
-         http://svn.apache.org/viewvc?view=revision&revision=1378178
-         http://svn.apache.org/viewvc?view=revision&revision=1407006
-         http://svn.apache.org/viewvc?view=revision&revision=1337344
-         http://svn.apache.org/viewvc?view=revision&revision=1398481
-         http://svn.apache.org/viewvc?view=revision&revision=1398025
-         http://svn.apache.org/viewvc?view=revision&revision=1398040
-      2.4.x patch:
-         http://people.apache.org/~jailletc36/backport.patch
-      +1: jailletc36, sf, jim
-
     * mod_session_dbd: fix a segmentation fault in the function dbd_remove.
       PR 53452
       trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1408958

Propchange: httpd/httpd/branches/2.4.x/docs/manual/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk/docs/manual:r1337344,1378178,1397636,1398025,1398040,1398481,1407004,1407006,1407088,1407528

Propchange: httpd/httpd/branches/2.4.x/docs/manual/mod/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk/docs/manual/mod:r1337344,1378178,1397636,1398025,1398040,1398481,1407004,1407006,1407088,1407528

Modified: httpd/httpd/branches/2.4.x/modules/examples/mod_example_hooks.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/examples/mod_example_hooks.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/examples/mod_example_hooks.c (original)
+++ httpd/httpd/branches/2.4.x/modules/examples/mod_example_hooks.c Mon Dec  3 16:33:42 2012
@@ -1019,7 +1019,7 @@ static int x_handler(request_rec *r)
             ap_get_server_banner());
     ap_rputs("  <BR>\n", r);
     ap_rprintf(r, "  Server built: \"%s\"\n", ap_get_server_built());
-    ap_rputs("  </P>\n", r);;
+    ap_rputs("  </P>\n", r);
     ap_rputs("  <P>\n", r);
     ap_rputs("  The format for the callback trace is:\n", r);
     ap_rputs("  </P>\n", r);

Modified: httpd/httpd/branches/2.4.x/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/generators/mod_autoindex.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/generators/mod_autoindex.c (original)
+++ httpd/httpd/branches/2.4.x/modules/generators/mod_autoindex.c Mon Dec  3 16:33:42 2012
@@ -207,7 +207,7 @@ static void push_item(apr_array_header_t
     }
 
     p->type = type;
-    p->data = data ? apr_pstrdup(arr->pool, data) : NULL;
+    p->data = apr_pstrdup(arr->pool, data);
     p->apply_path = apr_pstrcat(arr->pool, path, "*", NULL);
 
     if ((type == BY_PATH) && (!ap_is_matchexp(to))) {
@@ -694,7 +694,7 @@ static void *merge_autoindex_configs(apr
              * There are local nonincremental settings, which clear
              * all inheritance from above.  They *are* the new base settings.
              */
-            new->opts = add->opts;;
+            new->opts = add->opts;
         }
         /*
          * We're guaranteed that there'll be no overlap between

Modified: httpd/httpd/branches/2.4.x/modules/ldap/util_ldap.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/ldap/util_ldap.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/ldap/util_ldap.c (original)
+++ httpd/httpd/branches/2.4.x/modules/ldap/util_ldap.c Mon Dec  3 16:33:42 2012
@@ -1647,7 +1647,7 @@ static int uldap_cache_checkuserid(reque
                 *binddn = apr_pstrdup(r->pool, search_nodep->dn);
                 if (attrs) {
                     int i;
-                    *retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals);
+                    *retvals = apr_palloc(r->pool, sizeof(char *) * search_nodep->numvals);
                     for (i = 0; i < search_nodep->numvals; i++) {
                         (*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]);
                     }

Modified: httpd/httpd/branches/2.4.x/modules/loggers/mod_log_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/loggers/mod_log_config.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/loggers/mod_log_config.c (original)
+++ httpd/httpd/branches/2.4.x/modules/loggers/mod_log_config.c Mon Dec  3 16:33:42 2012
@@ -1551,7 +1551,7 @@ static void *ap_default_log_writer_init(
 
         pl = ap_open_piped_log(p, name + 1);
         if (pl == NULL) {
-           return NULL;;
+           return NULL;
         }
         return ap_piped_log_write_fd(pl);
     }

Modified: httpd/httpd/branches/2.4.x/modules/session/mod_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/session/mod_session.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/session/mod_session.c (original)
+++ httpd/httpd/branches/2.4.x/modules/session/mod_session.c Mon Dec  3 16:33:42 2012
@@ -334,7 +334,7 @@ static apr_status_t session_identity_enc
         apr_table_setn(z->entries, SESSION_EXPIRY, expiry);
     }
     apr_table_do((int (*) (void *, const char *, const char *))
-                 identity_count, &length, z->entries, NULL);;
+                 identity_count, &length, z->entries, NULL);
     buffer = apr_pcalloc(r->pool, length + 1);
     apr_table_do((int (*) (void *, const char *, const char *))
                  identity_concat, buffer, z->entries, NULL);

Modified: httpd/httpd/branches/2.4.x/modules/ssl/ssl_engine_vars.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/ssl/ssl_engine_vars.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/ssl/ssl_engine_vars.c (original)
+++ httpd/httpd/branches/2.4.x/modules/ssl/ssl_engine_vars.c Mon Dec  3 16:33:42 2012
@@ -496,7 +496,7 @@ static char *ssl_var_lookup_ssl_cert(apr
         result = ssl_var_lookup_ssl_cert_PEM(p, xs);
     }
 
-    if (result != NULL && resdup)
+    if (resdup)
         result = apr_pstrdup(p, result);
     return result;
 }

Modified: httpd/httpd/branches/2.4.x/server/error_bucket.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/error_bucket.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/error_bucket.c (original)
+++ httpd/httpd/branches/2.4.x/server/error_bucket.c Mon Dec  3 16:33:42 2012
@@ -45,7 +45,7 @@ AP_DECLARE(apr_bucket *) ap_bucket_error
 
     h = apr_bucket_alloc(sizeof(*h), b->list);
     h->status = error;
-    h->data = (buf) ? apr_pstrdup(p, buf) : NULL;
+    h->data = apr_pstrdup(p, buf);
 
     b = apr_bucket_shared_make(b, h, 0, 0);
     b->type = &ap_bucket_type_error;

Modified: httpd/httpd/branches/2.4.x/server/protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/protocol.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/protocol.c (original)
+++ httpd/httpd/branches/2.4.x/server/protocol.c Mon Dec  3 16:33:42 2012
@@ -561,9 +561,6 @@ static int read_request_line(request_rec
     const char *uri;
     const char *pro;
 
-#if 0
-    conn_rec *conn = r->connection;
-#endif
     int major = 1, minor = 0;   /* Assume HTTP/1.0 if non-"HTTP" protocol */
     char http[5];
     apr_size_t len;
@@ -627,20 +624,10 @@ static int read_request_line(request_rec
                       ap_escape_logitem(r->pool, r->the_request));
     }
 
-    /* we've probably got something to do, ignore graceful restart requests */
-
     r->request_time = apr_time_now();
     ll = r->the_request;
     r->method = ap_getword_white(r->pool, &ll);
 
-#if 0
-/* XXX If we want to keep track of the Method, the protocol module should do
- * it.  That support isn't in the scoreboard yet.  Hopefully next week
- * sometime.   rbb */
-    ap_update_connection_status(AP_CHILD_THREAD_FROM_ID(conn->id), "Method",
-                                r->method);
-#endif
-
     uri = ap_getword_white(r->pool, &ll);
 
     /* Provide quick information about the request method as soon as known */
@@ -663,8 +650,6 @@ static int read_request_line(request_rec
     }
     r->protocol = apr_pstrmemdup(r->pool, pro, len);
 
-    /* XXX ap_update_connection_status(conn->id, "Protocol", r->protocol); */
-
     /* Avoid sscanf in the common case */
     if (len == 8
         && pro[0] == 'H' && pro[1] == 'T' && pro[2] == 'T' &&
pro[3] == 'P'

Modified: httpd/httpd/branches/2.4.x/server/provider.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/provider.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/provider.c (original)
+++ httpd/httpd/branches/2.4.x/server/provider.c Mon Dec  3 16:33:42 2012
@@ -42,7 +42,7 @@ AP_DECLARE(apr_status_t) ap_register_pro
 
     if (global_providers == NULL) {
         global_providers = apr_hash_make(pool);
-        global_providers_names = apr_hash_make(pool);;
+        global_providers_names = apr_hash_make(pool);
         apr_pool_cleanup_register(pool, NULL, cleanup_global_providers,
                                   apr_pool_cleanup_null);
     }

Modified: httpd/httpd/branches/2.4.x/server/util_script.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/util_script.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/util_script.c (original)
+++ httpd/httpd/branches/2.4.x/server/util_script.c Mon Dec  3 16:33:42 2012
@@ -122,7 +122,7 @@ AP_DECLARE(char **) ap_create_environmen
             *whack++ = '_';
         }
         while (*whack != '=') {
-            if (!apr_isalnum(*whack) && *whack != '_') {
+            if (!apr_isalnum(*whack)) {
                 *whack = '_';
             }
             ++whack;

Modified: httpd/httpd/branches/2.4.x/server/vhost.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/vhost.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/vhost.c (original)
+++ httpd/httpd/branches/2.4.x/server/vhost.c Mon Dec  3 16:33:42 2012
@@ -754,8 +754,9 @@ static void fix_hostname(request_rec *r)
 
 bad:
     r->status = HTTP_BAD_REQUEST;
-    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00550)
-                  "Client sent malformed Host header");
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00550)
+                  "Client sent malformed Host header: %s",
+                  r->hostname);
     return;
 }
 

Modified: httpd/httpd/branches/2.4.x/support/suexec.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/suexec.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/support/suexec.c (original)
+++ httpd/httpd/branches/2.4.x/support/suexec.c Mon Dec  3 16:33:42 2012
@@ -128,6 +128,12 @@ static const char *const safe_env_lst[] 
     NULL
 };
 
+static void log_err(const char *fmt,...) 
+    __attribute__((format(printf,1,2)));
+static void log_no_err(const char *fmt,...)  
+    __attribute__((format(printf,1,2)));
+static void err_output(int is_error, const char *fmt, va_list ap) 
+    __attribute__((format(printf,2,0)));
 
 static void err_output(int is_error, const char *fmt, va_list ap)
 {
@@ -263,7 +269,7 @@ int main(int argc, char *argv[])
      */
     uid = getuid();
     if ((pw = getpwuid(uid)) == NULL) {
-        log_err("crit: invalid uid: (%ld)\n", uid);
+        log_err("crit: invalid uid: (%lu)\n", (unsigned long)uid);
         exit(102);
     }
     /*
@@ -440,7 +446,7 @@ int main(int argc, char *argv[])
      * a UID less than AP_UID_MIN.  Tsk tsk.
      */
     if ((uid == 0) || (uid < AP_UID_MIN)) {
-        log_err("cannot run as forbidden uid (%d/%s)\n", uid, cmd);
+        log_err("cannot run as forbidden uid (%lu/%s)\n", (unsigned long)uid, cmd);
         exit(107);
     }
 
@@ -449,7 +455,7 @@ int main(int argc, char *argv[])
      * or as a GID less than AP_GID_MIN.  Tsk tsk.
      */
     if ((gid == 0) || (gid < AP_GID_MIN)) {
-        log_err("cannot run as forbidden gid (%d/%s)\n", gid, cmd);
+        log_err("cannot run as forbidden gid (%lu/%s)\n", (unsigned long)gid, cmd);
         exit(108);
     }
 
@@ -460,7 +466,7 @@ int main(int argc, char *argv[])
      * and setgid() to the target group. If unsuccessful, error out.
      */
     if (((setgid(gid)) != 0) || (initgroups(actual_uname, gid) != 0)) {
-        log_err("failed to setgid (%ld: %s)\n", gid, cmd);
+        log_err("failed to setgid (%lu: %s)\n", (unsigned long)gid, cmd);
         exit(109);
     }
 
@@ -468,7 +474,7 @@ int main(int argc, char *argv[])
      * setuid() to the target user.  Error out on fail.
      */
     if ((setuid(uid)) != 0) {
-        log_err("failed to setuid (%ld: %s)\n", uid, cmd);
+        log_err("failed to setuid (%lu: %s)\n", (unsigned long)uid, cmd);
         exit(110);
     }
 
@@ -556,11 +562,11 @@ int main(int argc, char *argv[])
         (gid != dir_info.st_gid) ||
         (uid != prg_info.st_uid) ||
         (gid != prg_info.st_gid)) {
-        log_err("target uid/gid (%ld/%ld) mismatch "
-                "with directory (%ld/%ld) or program (%ld/%ld)\n",
-                uid, gid,
-                dir_info.st_uid, dir_info.st_gid,
-                prg_info.st_uid, prg_info.st_gid);
+        log_err("target uid/gid (%lu/%lu) mismatch "
+                "with directory (%lu/%lu) or program (%lu/%lu)\n",
+                (unsigned long)uid, (unsigned long)gid,
+                (unsigned long)dir_info.st_uid, (unsigned long)dir_info.st_gid,
+                (unsigned long)prg_info.st_uid, (unsigned long)prg_info.st_gid);
         exit(120);
     }
     /*

Modified: httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c?rev=1416581&r1=1416580&r2=1416581&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c (original)
+++ httpd/httpd/branches/2.4.x/support/win32/ApacheMonitor.c Mon Dec  3 16:33:42 2012
@@ -542,7 +542,6 @@ BOOL ApacheManageService(LPCTSTR szServi
 {
     TCHAR szMsg[MAX_PATH];
     BOOL retValue;
-    BOOL serviceFlag = TRUE;
     SC_HANDLE schService;
     SC_HANDLE schSCManager;
     SERVICE_STATUS schSStatus;



Mime
View raw message