1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00

1006 Commits

Author SHA1 Message Date
Joe Orton
83d565fbb5 Merge r1933586, r1916058, r1916068, r1933631, r1929891 from trunk:
Fix OpenSSL 4.0 compatibility and test that in CI.

CI: Update to test OpenSSL 4.0.0 explicitly.
CI: No longer disable deprecated-declaration warnings for OpenSSL 3.4 -Werror build.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_UserCheck): Change name to
  const X509_NAME *.
  (ssl_callback_proxy_cert): Change ca_name, issuer, and ca_issuer to
  const X509_NAME *.

* modules/ssl/ssl_engine_log.c (ssl_log_cert_error): Change cert
  parameter to const X509 *. Use X509_get0_serialNumber,
  X509_get0_notBefore, and X509_get0_notAfter instead of non-const
  variants.
  (ssl_log_xerror, ssl_log_cxerror, ssl_log_rxerror): Change cert
  parameter to const X509 *.

* modules/ssl/ssl_engine_vars.c (ssl_var_lookup_ssl_cert_dn): Change
  xsname parameter to const X509_NAME *.
  (ssl_var_lookup_ssl_cert_dn_oneline): Change xsname parameter to
  const X509_NAME *.
  (ssl_var_lookup_ssl_cert): Change xsname to const X509_NAME *.
  (ssl_var_lookup_ssl_cert_rfc4523_cea): Change issuer to const
  X509_NAME *.

* modules/ssl/ssl_private.h (ssl_log_xerror, ssl_log_cxerror,
  ssl_log_rxerror): Update declarations to use const X509 *.

* modules/ssl/ssl_util_ssl.c (modssl_X509_NAME_to_string): Change dn
  parameter to const X509_NAME *.
  (getIDs): Change subj to const X509_NAME *.

* modules/ssl/ssl_util_ssl.h (modssl_X509_NAME_to_string): Update
  declaration to use const X509_NAME *.

* support/ab.c (ssl_print_cert_info): Change dn to const X509_NAME *.

mod_ssl: use ASN1_STRING accessor API in dump_extn_value:

* modules/ssl/ssl_engine_vars.c (dump_extn_value): Use
  ASN1_STRING_get0_data() and ASN1_STRING_length() rather than
  directly dereferencing the ASN1_OCTET_STRING structure, which is
  opaque in OpenSSL 4.0.
* modules/ssl/ssl_private.h: Add compat macros for
  ASN1_STRING_get0_data and ASN1_STRING_length for pre-1.1 API.

mod_ssl: constify ASN1_TIME pointers, use X509_get0_not{Before,After}:

* modules/ssl/ssl_engine_vars.c (ssl_var_lookup_ssl_cert_valid,
  ssl_var_lookup_ssl_cert_remain): Constify ASN1_TIME * parameter.
  (ssl_var_lookup_ssl_cert): Use X509_get0_notBefore() and
  X509_get0_notAfter() which return const pointers.
  (ssl_var_lookup_ssl_cert_remain): Use ASN1_TIME_check() directly
  rather than INVALID_ASN1_TIME macro which dereferences the
  ASN1_TIME structure.
  (dump_extn_value): Constify ASN1_OCTET_STRING * parameter.
* modules/ssl/ssl_private.h: Add compat macros for
  X509_get0_before and X509_get0_after for pre-1.1 API.

mod_ssl: constify X509_NAME_ENTRY and X509_EXTENSION pointers:

* modules/ssl/ssl_engine_vars.c (ssl_var_lookup_ssl_cert_dn,
  extract_dn): Constify X509_NAME_ENTRY * variables, constify
  X509_NAME * parameter of extract_dn, drop unnecessary casts
  on X509_NAME_ENTRY_get_object() calls.
  (ssl_ext_list): Use MODSSL_X509_EXT_CONST for X509_EXTENSION *
  since X509_EXTENSION accessors are only constified in OpenSSL 4.
* modules/ssl/ssl_util_ssl.c, modules/ssl/ssl_util_ssl.h
  (modssl_X509_NAME_ENTRY_to_string): Constify X509_NAME_ENTRY *
  parameter.
* modules/ssl/ssl_private.h: Add MODSSL_X509_EXT_CONST, defined
  as const for OpenSSL 4+ and empty otherwise.

* modules/ssl/ssl_util_ssl.c (asn1_string_convert): Constify
  ASN1_STRING * argument.
* modules/ssl/ssl_engine_ocsp.c (extract_responder_uri): Use
  modssl_ASN1_STRING_convert instead of directly accessing ASN1_STRING
  data pointer.

* modules/ssl/ssl_util_ssl.c (modssl_ASN1_STRING_convert): Rename from
  asn1_string_convert and export function.
  (asn1_string_to_utf8): Update to use modssl_ASN1_STRING_convert.
  (modssl_X509_NAME_ENTRY_to_string): Update to use
  modssl_ASN1_STRING_convert.

* modules/ssl/ssl_util_ssl.h (modssl_ASN1_STRING_convert): Declare new
  function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

CI: Add OpenSSL 3.1 builds, including a no-engine build.
(attempt to use 3.2 failed, unsure why)
- add OpenSSL build binaries to $PATH 

CI: add OpenSSL 3.2, test OpenSSL 3.x using Apache::Test
trunk to pick up r1916067.

CI: The OpenSSL no-engine config option is redundant as of 4.0, remove.

CI: Try to fix ab failures during OpenSSL ech job, set RPATH via LDFLAGS

CI: For OpenSSL branch builds, always build a fresh version of the
OpenSSL branch and cache the commit hash to allow checking for freshness.
Also clone with --depth=1 to save time+bandwidth.

Reviewed by: jorton, covener (skimmed+CI results), rpluem
Github: closes #642


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1934973 13f79535-47bb-0310-9956-ffa450edef68
2026-06-04 08:50:44 +00:00
Joe Orton
dc5bf17873 Merge r1934594, r1934597 from trunk:
memchr() takes a char * as a first parameter, and 'buf' is a const char *.

This breaks build process at least with gcc 16.1.1 and maintainer-mode enabled.

Without maintainer-mode, only a warning is generated.

strchr() takes a char * as a first parameter, and in the cases a const char * is passed.

This breaks build process at least with gcc 16.1.1 and maintainer-mode enabled.

Without maintainer-mode, only a warning is generated.

Submitted by: jailletc36
Reviewed by: jailletc36, jim, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1934885 13f79535-47bb-0310-9956-ffa450edef68
2026-06-02 13:55:21 +00:00
Jim Jagielski
84a9b978e7 svn merge -c 1910518,1910847,1912477,1918297 ^/httpd/httpd/trunk .
*) Easy patches: synch 2.4.x and trunk
        - ab: Increase MAX_CONCURRENCY hard limit (from 20K to 200K)
        - ab: Fix X509 * leak
        - dav/fs/dbm.c: Remove error message references to "property" databases
        - httpd.h: Fix comment


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1923142 13f79535-47bb-0310-9956-ffa450edef68
2025-01-15 11:51:28 +00:00
Joe Orton
c74ab99d6b Merge r1915508 from trunk:
* support/htcacheclean.c (list_urls): Continue rather than stopping
  after listing a file for each subdirectory.

PR: 65091
Submitted by: Artem Egorenkov <aegorenkov.91 gmail.com>
Reviewed by: jorton, ylavic, jfclere



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1916131 13f79535-47bb-0310-9956-ffa450edef68
2024-03-05 13:11:54 +00:00
Joe Orton
72bef51a8d Merge r1862611, r1877693, r1878703, r1884207 from trunk:
* support/htpasswd.c (usage): Document SHA-256/512 support.

Windows : do not include ap_config_auto.h 

* support/htpasswd.c (usage): Fix typo. 

Fix misleading crypt vs hash terminology in ht* and dbmmanage tools.

What the htpasswd, htdbm and dbmmanage tools do is hashing passwords, not
encrypting them, so fix the terminology in manpages, docs, --help, comments
and function names.

Submitted by: Michele Preziuso <mpreziuso kaosdynamics.com>, jorton, steffenal, ylavic
Github: closes #408
Reviewed by: jorton, ylavic, jfclere


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1916129 13f79535-47bb-0310-9956-ffa450edef68
2024-03-05 13:10:50 +00:00
Joe Orton
3928bbf8b3 Merge r1861793, r1862612, r1862724, r1877251, r1907672 from trunk:
Add support for SHA-2 crypt() algorithm in htpasswd.

* configure.in: Detect SHA-2 support in crypt().

* support/passwd_common.h: Define ALG_CRYPT_SHA256, ALG_CRYPT_SHA512,
  include ap_config_auto.h.

* support/htpasswd.c (check_args): Allow -2, -5, -r arguments for
  SHA-256, SHA-256 and rounds options respectively.

* support/passwd_common.c
  (parse_common_options): Parse -2, -5, -r args.
  (mkhash): Generate crypt hash for SHA256/SHA512 algorithms.

Update transform.

* support/htpasswd.c (usage): More usage fixes for SHA-2; describe
  as "secure", leave bcrypt only algorithm described as "very secure".


* support/passwd_common.c (mkhash): Fix salt buffer size for SHA2
  (caught by gcc 10).


configure: Assume crypt() does not support SHA-2 when cross-compiling.

Can be forced with "./configure ap_cv_crypt_sha2=yes ..." still.

* configure.in:
  Give AC_RUN_IFELSE a cross-compiling action, otherwise it fails with:
    configure: error: cannot run test program while cross compiling

Submitted by: jorton, ylavic
Reviewed by: minfrin, ylavic, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1915516 13f79535-47bb-0310-9956-ffa450edef68
2024-02-01 16:54:40 +00:00
Graham Leggett
28f6fc01c3 Backport to v2.4.
*) mod_ssl: Improve compatibility with OpenSSL 3, fix build warnings about
     deprecated ENGINE_ API, honor OPENSSL_API_COMPAT setting while defaulting
     to compatibitily with version 1.1.1 (including ENGINEs / SSLCryptoDevice).
     mod_ssl: Disable the OpenSSL ENGINE API when OPENSSL_NO_ENGINE is set.
     Allow for "SSLCryptoDevice builtin" if the ENGINE API is not available,
     notably with OpenSSL >= 3.  PR 68080.
     trunk patch: http://svn.apache.org/r1908537
                  http://svn.apache.org/r1908539
                  http://svn.apache.org/r1908542
                  http://svn.apache.org/r1913616
                  http://svn.apache.org/r1913815
                  http://svn.apache.org/r1913816
                  http://svn.apache.org/r1908542
                  http://svn.apache.org/r1913832
     2.4.x patch: https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/381.diff
                  (https://github.com/apache/httpd/pull/381)
     +1: ylavic, jorton, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1913912 13f79535-47bb-0310-9956-ffa450edef68
2023-11-18 11:34:12 +00:00
Eric Covener
cb6ad2f138 backport 1906428,1906433,1907993 from trunk
add rotatelogs -T to truncate all but the first-opened file.

+ docs tweak for compat




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1908025 13f79535-47bb-0310-9956-ffa450edef68
2023-03-03 14:20:27 +00:00
Jim Jagielski
4d37880753 Merge r1822857, r1876815, r1893499, r1900024, r1900152, r1900306, r1900559, r1900564, r1900691, r1900694 from trunk:
* Makefile.in (build/config_vars.out): Rebuild if build/config_vars.sh
  has changed.


sort safe_env_lst 
bz 64371


mod_optional_hook_import: debug message at APLOG_DEBUG level.



  *) de-duplicate ALOGNO from code copy.



ab: apr_base64_encode already NUL-terminate the output.

And returns the length including the trailing \0, so setting it at that
length is off by +1.



* Avoid an overflow on large inputs

PR: 66033


dav_get_liveprop_info() returns a long not an int.

Update the type of global_ns accordingly and update the format specifier when this variable is used in printf like functions.

This also aligns code with dav_core_insert_prop() in modules/dav/main/std_liveprop.c

Length computed by count_string() are accumulated in an apr_size_t, so be more consistent and use this data type also in this function.

Fix some typo

[skip ci]

Fix some typos

[skip ci]
Submitted by: jorton, gbechis, ylavic, icing, ylavic, rpluem, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed by: jailletc36, rpluem, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1903618 13f79535-47bb-0310-9956-ffa450edef68
2022-08-21 20:26:51 +00:00
Christophe Jaillet
882b022f48 Merge r1756843, r1897890, r1898731, r1900064, r1900077 from trunk
* mod_auth_digest: Fix some missed "strcasecmp <--> ap_cstr_casecmp" conversions
   * mod_dav: fix a typo
   * mod_lua: Avoid "may be uninitialized" warning
   * ab: Fix alignment in an 'if' block.
   * mod_authz_dbd: fix select-groups example, bz 66010

Submitted by: jailletc36, rpluem, rpluem, jailletc36, gbechis
Reviewed by: jailletc36, ylavic, rpluem
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901567 13f79535-47bb-0310-9956-ffa450edef68
2022-06-02 20:02:50 +00:00
Yann Ylavic
b03fe85b73 ab: Allow for TLSv1.3 when the SSL library supports it.
When TLS1_3_VERSION is defined by the SSL library, bump the maximum TLS
protocol to that and use it for "-f ALL" or "-f TLSv1.3".

This mixes proposed patches from BZ 63594 and 64699.

BZ: 63594, 64699


Merge r1900157 from trunk:

Submitted by: abhilash <abhilash1232 gmail.com>
Submitted by: xiaolongx.jiang intel.com
Submitted by: ylavic
Reviewed by: ylavic, rpluem, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901203 13f79535-47bb-0310-9956-ffa450edef68
2022-05-24 09:06:42 +00:00
Joe Orton
2cfafb4a36 Merge r1889957 from trunk: [excluding server/mpm/simple changes]
* server/mpm/event/event.c, 
  server/mpm/simple/simple_run.c,
  support/htcacheclean.c: Adjust use of APR_RING macros to
  ensure the APR_RING_HEAD is always embedded in a containing
  structure, to avoid warnings with GCC 11.  (apr_ring.h also
  suggests this is best practice)

See also: https://bugzilla.redhat.com/show_bug.cgi?id=1957353
          https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98503
          msgid <814cca2a-1992-3fae-bb0e-c84b3d09b73b@gmail.com>
Github: closes #186
Reviewed by: jorton, minfrin, jfclere


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1891377 13f79535-47bb-0310-9956-ffa450edef68
2021-07-08 07:04:49 +00:00
Joe Orton
2c67d14299 Merge r1864784 from trunk:
-l and -L are not exclusive.
Document the 'G' suffix.
Fix some minor style issues.

Submitted by: jailletc36
Reviewed by: jorton, ylavic, jfclere


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1890671 13f79535-47bb-0310-9956-ffa450edef68
2021-06-10 09:38:40 +00:00
Christophe Jaillet
8433a9b8c9 Merge r1730128, r1878140, r1878265, r1881736, r1882775, r1883872, r1884509, r1887720 from trunk
*) Easy patches: synch 2.4.x and trunk
         - doxygen: Correct doxygen groupname
         - .gdbinit: align columns
         - .gdbinit: fix indentation
         - mod_dav: Add specific logs for different modes
         - core: ap_pbase64encode(): save double NUL byte allocation and assignment
         - core: ap_pbase64decode(): save double NUL byte allocation and assignment
         - support: Fix a typo in a comment
         - proxy_util.c: Fix leak in error path in the do_malloc case

Submitted by: wrowe, ylavic, ylavic, jorton, rpluem, ylavic, jorton, jorton
Reviewed by: jailletc36, gbechis, ylavic
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1888929 13f79535-47bb-0310-9956-ffa450edef68
2021-04-18 19:40:13 +00:00
Christophe Jaillet
7f1ce37f5f Merge r1612945, r1734835, r1738875, r1833416, r1842898, r1867257, r1876745, r1876807, r1876823, r1877642 from trunk
Easy patches: synch 2.4.x and trunk
        - core: Re-introduce check for sufficient PCRE version.
        - core: Fix doc string for QualifyRedirectURL
        - mod_proxy: really return an error message on invalid "flusher" value.
        - mod_http2: Remove extra and un-needed ""
        - mod_ldap: fix a (unlikely) memory leak 
        - ab: fix a typo
        - suexec: Report error string after failure from setgid/initgroups or setuid
        - mod_session_crypto: be less specific and don't echo passphrase
        - mod_proxy_html: Fix proxy_html_conf.bufsz to have correct type, as
                          it is used with ap_set_int_slot.
        - mod_md: update duplicated APLOGNOs.

Submitted by: fuankg, trawick, ylavic, jailletc36, jorton, jailletc36, jorton, covener, jorton, ylavic
Reviewed by: jailletc36, jim, ylavic
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1879490 13f79535-47bb-0310-9956-ffa450edef68
2020-07-03 19:53:37 +00:00
Jim Jagielski
d9d02ac48f Merge r1876484, r1876493 from trunk:
PR64313  htcacheclean: Empty directories in CacheRoot are still present even after using "-t"


* Whitespace style fixes. No functional change.
Submitted by: jfclere, rpluem
Reviewed by: jailletc36, rpluem, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1876887 13f79535-47bb-0310-9956-ffa450edef68
2020-04-23 12:33:04 +00:00
Eric Covener
d58a763f8f Merge r1875429 from trunk:
fix apxs for non-destdir builds

subtr(...,0, -1) chops off a character and leaves relative path.

(you will need to re-run configure)



Reviewed By: +1: covener, gbechis, rpluem



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1875475 13f79535-47bb-0310-9956-ffa450edef68
2020-03-20 13:00:44 +00:00
Yann Ylavic
0e8845df28 Merge r1872042, r1872062 from trunk:
Add support for cross compiling to apxs. If apxs is being executed from somewhere
other than its target location, add that prefix to includes and library directories.
Without this, apxs would fail to find config_vars.mk and exit.


Allow instdso.sh to be found while cross compiling.


Submitted by: minfrin
Reviewed by: minfrin, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1874288 13f79535-47bb-0310-9956-ffa450edef68
2020-02-21 00:36:36 +00:00
Yann Ylavic
5002dde60a Merge r1873985 from trunk:
Fix spelling errors found by codespell.  [skip ci]

Submitted by: mrumph
Reviewed by: mrumph, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1874286 13f79535-47bb-0310-9956-ffa450edef68
2020-02-21 00:33:40 +00:00
Joe Orton
457cf7748b Merge r1846254 from trunk (under "documentation" RTC exception):
* support/htpasswd.c (usage): Fix bcrypt round maximum.

* docs/manual/programs/htpasswd.xml: Document that bcrypt rounds are
capped at 17.

PR: 62078



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1864798 13f79535-47bb-0310-9956-ffa450edef68
2019-08-09 13:25:20 +00:00
Graham Leggett
1efc485fd9 Easy patches: synch 2.4.x and trunk
- core: 80 chars
   - http_core: Clean-uo and style. No functional change overall
   - http_core: One more style fix in ap_process_http_async_connection()
   - mod_mime: Fix a cppcheck warning
   - mod_proxy_ajp: Fix a harmless clang warning
   - suexec: avoid a potential sprintf overflow
   - mod_headers: This is harmless, but this really should be an 'echo_do *'
   - core: Fix typo
   - core: Update a comment about the 'PATCH' HTTP command
   - mod_proxy_balancer: Fix some HTML syntax issues
trunk patch:
   - http://svn.apache.org/r1780282
   - http://svn.apache.org/r1814659
   - http://svn.apache.org/r1814660
   - http://svn.apache.org/r1838285
   - http://svn.apache.org/r1842881
   - http://svn.apache.org/r1846253
   - http://svn.apache.org/r1853757
   - http://svn.apache.org/r1851702
   - http://svn.apache.org/r1853980
   - http://svn.apache.org/r1855614
2.4.x patch: svn merge -c 1780282,1814659,1814660,1838285,1842881,1846253,1853757,1851702,1853980,1855614 ^/httpd/httpd/trunk .
+1: jailletc36, jim, rjung


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1860129 13f79535-47bb-0310-9956-ffa450edef68
2019-05-27 12:37:34 +00:00
Graham Leggett
0afa0f80d5 ab: Add client certificate support.
trunk: http://svn.apache.org/r1841784
2.4.x: svn merge -c r1841784 ^/httpd/httpd/trunk .
+1: minfrin, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1843412 13f79535-47bb-0310-9956-ffa450edef68
2018-10-10 09:13:20 +00:00
Graham Leggett
8e4ac13ff5 ab: print Server Temp Key information.
trunk patch: http://svn.apache.org/r1738415
             http://svn.apache.org/r1826930
2.4.x patch: https://svn.apache.org/repos/asf/httpd/httpd/patches/2.4.x/httpd-2.4-ab.patch
+1: minfrin, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1843411 13f79535-47bb-0310-9956-ffa450edef68
2018-10-10 09:10:15 +00:00
Jim Jagielski
4c1d0422ec Merge r1490294, r1734635, r1749403, r1813116, r1816179, r1817598, r1832198, r1832200, r1832277, r1832317 from trunk:
Note that the function will be available in APR.


Silent a smatch warning:
mod_auth_form.c:626 get_form_auth() warn: variable dereferenced before check 'sent_user' (see line 616)

Use 'memcpy' instead of 'strcpy' when the size of the string has already been computed.

Fix compilation failure :

unixd.c: In function ‘ap_unixd_mpm_set_signals’:
unixd.c:579:5: error: implicit declaration of function ‘apr_signal’; did you mean ‘strsignal’? [-Werror=implicit-function-declaration]
     apr_signal(SIGPIPE, SIG_IGN);
     ^~~~~~~~~~
     strsignal

Not sure where it comes from, maybe related to r1812301.

mod_substitute: add runtime traces. PR 61132.



In verify_ocsp_status in ssl_engine_ocsp.c, the log message, "OCSP response not successful: %d" should print the value of r instead of rc.
The value of rc will always be 0.

PR 61876 [sam <sam.eastman.4114 gmail.com>]

Success of 'SHGetMalloc()' should be tested with the SUCCEEDED macro.

/!\   This commit is _NOT COMPILE TESTED_. (I don't have a windows build environment available)
 
See PR 60086.

Axe some dead code.
 
See PR 60086.

Fix typo

Fix a potential un-intialized variable usage warning.
This can not be a runtime ixsue, because, in such a case, we would assert and abort before.

 PR 59819.
Submitted by: minfrin, jailletc36, jailletc36, jailletc36, ylavic, jailletc36, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed by: jailletc36, ylavic, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1832607 13f79535-47bb-0310-9956-ffa450edef68
2018-05-31 13:19:12 +00:00
Jim Jagielski
a7f818f5e3 Merge r1341905, r1342065, r1341930, r1345147, r1344712, r1814465 from trunk:
suexec: Add support for logging to syslog as an alternative to a
logfile.

* support/suexec.c (err_output) [AP_LOG_SYSLOG]: Log to syslog.
  (main): Close syslog fd if open, before execv.  Add -V output
  for AP_LOG_SYSLOG.

* configure.in: Add --with-suexec-syslog argument; allow
  --without-suexec-logfile to omit definition of AP_LOG_EXEC.


suexec: Support use of setgid/setuid capability bits on Linux, a
weaker set of privileges than the full setuid/setgid root binary.

* configure.in: Add --enable-suexec-capabilites flag.

* Makefile.in: If configured, use setcap instead of chmod 7555 on
  installed suexec binary.

* modules/arch/unix/mod_unixd.c (unixd_pre_config): Drop test for
  setuid bit if capability bits are used.

* docs/manual/: Add docs.


* docs/manual/suexec.html.en: Update for syslog logging.


* configure.in: Correct handling of --with-suexec-logfile in r1341905,
  thanks to rpluem.


* support/suexec.c: Define AP_LOG_FACILITY.
  (err_output): Use AP_LOG_FACILITY for syslog facility.

Suggested by: kbrand


* configure.in: Fix help text for --with-suexec-syslog.

Submitted by: jorton
Reviewed by: jorton, ylavic, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1832565 13f79535-47bb-0310-9956-ffa450edef68
2018-05-30 19:09:00 +00:00
Jim Jagielski
2a4c6d8942 Merge r1534895, r1534896, r1534914 from trunk:
rotatelogs: Use apr_psprintf() with %pm instead of a constant length buffer for
errors.

* support/rotatelogs.c
  (post_rotate, doRotate): Switch to using apr_psprintf() with %pm.

Suggested by: rpluem


rotatelogs: Remove another use of a consant length buffer for errors.

* support/rotatelogs.c
  (doRotate): Use apr_psprintf() and %pm.  Move the destruction of the pool
    after we're done with the error message so the error string stays allocated
    long enough.


rotatelogs: Remove last constant length error buffer.

* support/rotatelogs.c
  (ERRMSGSZ): Remove.
  (rotate_status): Remove errbuff member.
  (truncate_and_write_error): Accept the error message as an argument.
  (doRotate): Shift the pool destruction slightly later and use it to generate
    the error message to pass truncate_and_write_error().
  (main): In case of write errors create a pool to generate the error message,
    since the other pools available may never been freed.  Adjust to pass
    message directly to truncate_and_write_error().

Submitted by: breser
Reviewed by: rjung, ylavic, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1828739 13f79535-47bb-0310-9956-ffa450edef68
2018-04-09 15:37:44 +00:00
Jim Jagielski
a71d8fea48 Merge r1533810, r1533935, r1666417 from trunk:
Add an option to autocreate directories to rotatelogs.

* support/rotatelogs.c
  (rotate_config): Remove const from szLogRoot since we'll be passing it to
    apr_filepath_merge.  Add create_path member.
  (usage, dumpConfig): Update to reflect new -d option.
  (doRotate): Add code that knows how to create the directories a log file
    is going to go into.
  (main): Add the -d option and canonicalize the incoming path with
    apr_filepath_merge() so that the code in doRotate can work properly.

* docs/man/rotatelogs.8,
  docs/manual/programs/rotatelogs.html.en: Update for -d option.

PR: 46669
Submitted by: Philippe Lantin <plantin cobaltgroup.com>
              (which was actually a patch written by myself when I worked there)
Tweaked by: breser (ported to trunk and changed option from -p to -d)



Followup to r1533810: Put the rotatelogs docs in the right place.

* docs/man/rotatelogs.8,
  docs/manual/programs/rotatelogs.html.en: Remove changes from r1533810.

* docs/manual/programs/rotatelogs.xml: Adjust docs for new -d option. 


Choose "-D" instead of "-d" for the rotatelogs
option that creates the path to the log file.

I want to use "-d" for another directory related
option next where (I think) the "directory" "d"
makes more sense.

"-d" has not yet been backported, so changing
to "-D" is not a real compatibility issue.

Submitted by: breser, rjung
Reviewed by: rjung, ylavic, niq


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1828738 13f79535-47bb-0310-9956-ffa450edef68
2018-04-09 15:36:59 +00:00
Jim Jagielski
b834bf95c0 Merge r1666415, r1780308 from trunk:
Small changes to rotatelogs:
- add "-n num" to help text
- clarify in help text, that "program is invoked"
  is the "-p" case
- prevent crash with "-v" (verbose) if no
  "-p prog" is used
- add one space for formatting


rotatelogs: fix -n help text

this closes #24

Submitted By: Isaac Boukris <iboukris gmail.com>


Submitted by: rjung, covener
Reviewed by: rjung, ylavic, niq, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1828736 13f79535-47bb-0310-9956-ffa450edef68
2018-04-09 15:34:20 +00:00
Rainer Jung
10b279096b Merge 1710403 from trunk:
htpasswd/htdigest: Disable support for bcrypt on EBCDIC platforms.
apr-util's bcrypt implementation doesn't tolerate EBCDIC.

Submitted by: rjung
Reviewed by: rjung, covener, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826892 13f79535-47bb-0310-9956-ffa450edef68
2018-03-15 23:05:58 +00:00
Rainer Jung
2660d26fc9 Merge 1626956 and 1628388 from trunk:
ab: try all destination socket addresses returned by apr_sockaddr_info_get
instead of failing on first one when not available.
Needed for instance if localhost resolves to both ::1 and 127.0.0.1
e.g. if both are in /etc/hosts.

ab: Use only one connection to determine working destination socket address.

Submitted by: rjung
Reviewed by: rjung, covener, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826891 13f79535-47bb-0310-9956-ffa450edef68
2018-03-15 23:02:58 +00:00
Rainer Jung
ab4b175253 Merge 1781516 fro trunk:
htpasswd/htdbm: report the right limit when get_password()
overflows.

Submitted by: rjung
Reviewed by: rjung, covener, jailletc36


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826888 13f79535-47bb-0310-9956-ffa450edef68
2018-03-15 22:56:40 +00:00
Rainer Jung
3458fc6c09 Merge 1812756 from trunk:
htpasswd: Don't fail in -v mode if password file is unwritable.
PR 61631.

Submitted by: rjung
Reviewed by: rjung, ylavic, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826887 13f79535-47bb-0310-9956-ffa450edef68
2018-03-15 22:53:42 +00:00
Rainer Jung
9c8b7cd801 Merge 1781509 from trunk:
htpasswd: don't point to (unused) stack memory on output
to make static analysers happy.  PR 60634.

Submitted by: rjung
Reviewed by: rjung, ylavic, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826886 13f79535-47bb-0310-9956-ffa450edef68
2018-03-15 22:51:29 +00:00
Rainer Jung
522747c688 Merge 1821767 from trunk:
LibreSSL doesn't have or require applink.c

Submitted by: rjung
Reviewed by: rjung, ylavic, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826885 13f79535-47bb-0310-9956-ffa450edef68
2018-03-15 22:46:27 +00:00
Joe Orton
912a194b07 Merge r1617913 from trunk:
* support/ab.c: Fix crash caused by integer overflow when printing stats with
lot of requests (for example -n 500000000).

Submitted by: jkaluza
Reviewed by: jorton, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826310 13f79535-47bb-0310-9956-ffa450edef68
2018-03-09 09:24:30 +00:00
Joe Orton
a67e53d5e3 Merge r1532281, r1532289, r1537718 from trunk:
* support/rotatelogs.c (get_now): Return the offset applied to the
  Unix time as a parameter.
  (doRotate): When exploding the time for strtfime formatting, iff in
  -l mode, subtract the offset and explode the real Unix time as a
  local time so %Z etc works correctly.

* support/rotatelogs.c (get_now): Fix the NULL ptr dereferences 
  added in r1532281.

* support/rotatelogs.c: Introduce an adjusted_time_t type to store the
  weird "adjusted time since epoch" type returned by get_now().
  Switch from int to long to fix an unnecessary Y2K38 issue.  Adjust
  use throughout and clean up other type issues.  No functional change
  intended apart from fixing Y2K38.

Submitted by: jorton
Reviewed by: jorton, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826306 13f79535-47bb-0310-9956-ffa450edef68
2018-03-09 09:09:38 +00:00
Eric Covener
120ceb9301 ab: Fix send length calculation
... for the non-blocking connect case introduced in 2.4.30. 

Submitted By: jorton
Reviewed By: ylavic, druggeri, covener




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1825839 13f79535-47bb-0310-9956-ffa450edef68
2018-03-04 22:56:42 +00:00
Jim Jagielski
1bd6dd3133 Merge r1745863, r1745864 from trunk:
Fix segfault with logresolve -c and IPv6

Due to a logic error, there could be a NULL pointer dereference.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=823259


Fix comment typo

Submitted by: sf
Reviewed by: jailletc36, minfrin, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1824239 13f79535-47bb-0310-9956-ffa450edef68
2018-02-14 13:20:01 +00:00
Joe Orton
127a7c63d3 Merge r1816534 from trunk:
* support/Makefile.in, acinclude.m4: Add OpenSSL libraries at the end of the
  ab link line, not the start.

[too boring for CHANGES]

Submitted by: jorton
Reviewed by: jorton, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1823624 13f79535-47bb-0310-9956-ffa450edef68
2018-02-09 10:17:30 +00:00
Stefan Eissing
2b9b086839 On the 2.4.x branch:
Merged /httpd/httpd/trunk:r1811649,1811664,1814118

  *) ab: Make the TLS layer aware that the underlying socket is nonblocking,
     and use/handle POLLOUT where needed to avoid busy IOs and recover write
     errors when appropriate.  [Yann Ylavic]

  *) ab: Keep reading nonblocking to exhaust TCP or SSL buffers when previous
     read was incomplete (the SSL case can cause the next poll() to timeout
     since data are buffered already).  PR 61301 [Luca Toscano, Yann Ylavic]




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1814468 13f79535-47bb-0310-9956-ffa450edef68
2017-11-07 09:01:59 +00:00
Jim Jagielski
fde15ad27b Merge r1808008, r1808085 from trunk:
htdigest: prevent buffer overflow when strings in lines are too long.

Reported by: Hanno Böck
PR: 61511



Update CHANGES after r1808008
Submitted by: elukey
Reviewed by: elukey, icing, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1808853 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 10:14:01 +00:00
Yann Ylavic
5d7c48237a Merge r1803392, r1803396, r1803398 from trunk:
mod_ssl: we can't use SSL_COMP_free_compression_methods() if OPENSSL_NO_COMP
is defined.  PR 61206.

Submitted by: Michael Schlenker <msc contact.de>


mod_ssl, ab: compatibility with LibreSSL.  PR 61184.

LibreSSL defines OPENSSL_VERSION_NUMBER = 2.0, but is not compatible with
all of the latest OpenSSL 1.1 API.

Address this by defining MODSSL_USE_OPENSSL_PRE_1_1_API which is true for
anything but OpenSSL >= 1.1 (for now).

Proposed by: Bernard Spil <brnrd freebsd.org>
Reviewed by: ylavic


Follow up to r1803396: CHANGES entry.


Reviewed by: ylavic, jim, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1807734 13f79535-47bb-0310-9956-ffa450edef68
2017-09-08 12:20:16 +00:00
Jim Jagielski
d395400e1a Merge r1800594 from trunk:
* Do not apply the strict permissions of the temporary file to a possibly
  existing passwd file.
  This long standing bug was triggered by fixing a bug in APR in r1791029.

PR: 61240

Submitted by: rpluem
Reviewed by: rpluem, ylavic, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1800775 13f79535-47bb-0310-9956-ffa450edef68
2017-07-04 12:35:11 +00:00
Rainer Jung
a188dcfa90 Merge r1796493 from trunk:
ab: enable option processing for setting a custom
HTTP method also for non-SSL builds.

Submitted by: rjung
Reviewed by: rjung, covener, gsmith


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1796539 13f79535-47bb-0310-9956-ffa450edef68
2017-05-28 21:15:41 +00:00
Jim Jagielski
0894e574f1 Merge r1795830 from trunk:
ab: don't call malloc_init for OpenSSL 1.1.0

Patch by rjung.

The 1.1.0 compatibility macro for OpenSSL_malloc_init() causes problems
when mixed with procedure linkage stubs with some toolchains (e.g. GCC).
OpenSSL's malloc implementation doesn't recognize that the PLT stub
points back to it, which leads to infinite recursion.

Since the 1.1.0 documentation states that calling this function
explicitly is no longer necessary except "in certain shared-library
situations"(?), get rid of it.
Submitted by: jchampion
Reviewed by: jchampion, ylavic, gsmith


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1795907 13f79535-47bb-0310-9956-ffa450edef68
2017-05-23 12:49:02 +00:00
Gregg Lewis Smith
c7844d9ef2 add custom build step in abs to place an copy of
ms/applink.c in proper location.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1792152 13f79535-47bb-0310-9956-ffa450edef68
2017-04-20 21:17:55 +00:00
Gregg Lewis Smith
b921686415 revert r1791192, doesn't work
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1791294 13f79535-47bb-0310-9956-ffa450edef68
2017-04-13 18:17:24 +00:00
Gregg Lewis Smith
59736db4e8 Add another include since applink.c has been moved in
the OpenSSL source. More info:
http://marc.info/?t=149192864300001&r=1&w=2


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1791192 13f79535-47bb-0310-9956-ffa450edef68
2017-04-12 22:31:15 +00:00
Gregg Lewis Smith
e53fcafd61 revert portion of r1790999 concerning ab.c
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1791061 13f79535-47bb-0310-9956-ffa450edef68
2017-04-12 02:24:20 +00:00
Gregg Lewis Smith
e540e58735 Retro win32 command-line build
allow building with OpenSSL 1.1.0

ab.c (abs)
----------
applink.c has been moved in this version of OpenSSL


dsw/dsp
-------
use srclib\apr\build\cvtdsp.pl -ossl11
from apr-1.6.x




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1790999 13f79535-47bb-0310-9956-ffa450edef68
2017-04-11 16:36:25 +00:00