Commit d5287868 authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

Log something nicer than "Internal error: pcfg_openfile() called

with NULL filename" if no password file is configured


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070096 13f79535-47bb-0310-9956-ffa450edef68
parent 29f6bce4
Loading
Loading
Loading
Loading
+12 −0
Changes for modules/aaa/mod_authn_file.c: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -75,6 +75,12 @@ static authn_status check_password(request_rec *r, const char *user,
    apr_status_t status;
    char *file_password = NULL;

    if (!conf->pwfile) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "AuthUserFile not specified in the configuration");
        return AUTH_GENERAL_ERROR;
    }

    status = ap_pcfg_openfile(&f, r->pool, conf->pwfile);

    if (status != APR_SUCCESS) {
@@ -124,6 +130,12 @@ static authn_status get_realm_hash(request_rec *r, const char *user,
    apr_status_t status;
    char *file_hash = NULL;

    if (!conf->pwfile) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "AuthUserFile not specified in the configuration");
        return AUTH_GENERAL_ERROR;
    }

    status = ap_pcfg_openfile(&f, r->pool, conf->pwfile);

    if (status != APR_SUCCESS) {