Commit e6b93963 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1551611, r1783765, r1788996, r1788998, r1789000, r1795651 from trunk:

Log a warning when the LDAP authn provider is configured but an AuthLDAPURL 
isn't -- IOW, avoid silently skipping a misconfigured [or buggy?] LDAP provider.



Follow up to r1772919: update APLOGNO().

Save a few cycles.
'apr_pstrcatv' can compute the length of the new string for us.

Improve indentation

Group bit field values in order to save some memory.

Add an explicit NULL to initialise a field in an authn_provider structure, as done in all other places.  PR 60636
Submitted by: covener, ylavic, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed by: jailletc36, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1800268 13f79535-47bb-0310-9956-ffa450edef68
parent b9eb342c
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -116,24 +116,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

   *) Easy proposals:
      - mod_authnz_ldap: Log a warning when the LDAP authn provider is configured
                         but an AuthLDAPURL isn't
      - mod_auth_digest: Follow up to r1772919: update APLOGNO()
      - mod_cache_socache: Save a few cycles
      - mod_cache_socache: Improve indentation
      - mod_cache_socache: Group bit field values in order to save some memory
      - mod_authnz_ldap: Add an explicit NULL to initialise a field in an authn_provider
                         structure
      trunk patch: http://svn.apache.org/r1551611
                   http://svn.apache.org/r1783765
                   http://svn.apache.org/r1788996
                   http://svn.apache.org/r1788998
                   http://svn.apache.org/r1789000
                   http://svn.apache.org/r1795651
      2.4.x patch: svn merge -c 1551611,1783765,1788996,1788998,1789000,1795651 ^/httpd/httpd/trunk .
      +1: jailletc36, jim, ylavic


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+1 −1
Original line number Diff line number Diff line
@@ -842,7 +842,7 @@ static long gc(server_rec *s)

            if (err) {
                /* Nothing we can really do but log... */
                ap_log_error(APLOG_MARK, APLOG_ERR, err, s, APLOGNO()
                ap_log_error(APLOG_MARK, APLOG_ERR, err, s, APLOGNO(10007)
                             "Failed to free auth_digest client allocation");
            }
        }
+4 −0
Original line number Diff line number Diff line
@@ -490,6 +490,9 @@ static authn_status authn_ldap_check_password(request_rec *r, const char *user,
     * Basic sanity checks before any LDAP operations even happen.
     */
    if (!sec->have_ldap_url) {
        ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(02558) 
                      "no AuthLDAPURL");

        return AUTH_GENERAL_ERROR;
    }

@@ -1865,6 +1868,7 @@ static int authnz_ldap_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *
static const authn_provider authn_ldap_provider =
{
    &authn_ldap_check_password,
    NULL,
};

static const authz_provider authz_ldapuser_provider =
+11 −10
Original line number Diff line number Diff line
@@ -77,13 +77,13 @@ typedef struct cache_socache_object_t
    cache_socache_info_t socache_info; /* Header information. */
    apr_size_t body_offset; /* offset to the start of the body */
    apr_off_t body_length; /* length of the cached entity body */
    unsigned int newbody :1; /* whether a new body is present */
    apr_time_t expire; /* when to expire the entry */

    const char *name; /* Requested URI without vary bits - suitable for mortals. */
    const char *key; /* On-disk prefix; URI with Vary bits (if present) */
    apr_off_t offset; /* Max size to set aside */
    apr_time_t timeout; /* Max time to set aside */
    unsigned int newbody :1; /* whether a new body is present */
    unsigned int done :1; /* Is the attempt to cache complete? */
} cache_socache_object_t;

@@ -270,7 +270,8 @@ static apr_status_t store_table(apr_table_t *table, unsigned char *buffer,
}

static const char* regen_key(apr_pool_t *p, apr_table_t *headers,
        apr_array_header_t *varray, const char *oldkey)
                             apr_array_header_t *varray, const char *oldkey,
                             apr_size_t *newkeylen)
{
    struct iovec *iov;
    int i, k;
@@ -322,7 +323,7 @@ static const char* regen_key(apr_pool_t *p, apr_table_t *headers,
    iov[k].iov_len = strlen(oldkey);
    k++;

    return apr_pstrcatv(p, iov, k, NULL);
    return apr_pstrcatv(p, iov, k, newkeylen);
}

static int array_alphasort(const void *fn1, const void *fn2)
@@ -526,7 +527,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
            return DECLINED;
        }

        nkey = regen_key(r->pool, r->headers_in, varray, key);
        nkey = regen_key(r->pool, r->headers_in, varray, key, &len);

        /* attempt to retrieve the cached entry */
        if (socache_mutex) {
@@ -542,7 +543,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
        buffer_len = sobj->buffer_len;
        rc = conf->provider->socache_provider->retrieve(
                conf->provider->socache_instance, r->server,
                (unsigned char *) nkey, strlen(nkey), sobj->buffer,
                (unsigned char *) nkey, len, sobj->buffer,
                &buffer_len, r->pool);
        if (socache_mutex) {
            apr_status_t status = apr_global_mutex_unlock(socache_mutex);
@@ -869,7 +870,7 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r,
            }

            obj->key = sobj->key = regen_key(r->pool, sobj->headers_in, varray,
                    sobj->name);
                                             sobj->name, NULL);
        }
    }