View | Details | Raw Unified | Return to bug 57585
Collapse All | Expand All

(-)server/config.c (+15 lines)
Lines 1971-1976 Link Here
1971
        return NULL;
1971
        return NULL;
1972
    }
1972
    }
1973
    else if (optional) {
1974
        /* If the optinal flag is set (like for IncludeOptional) we can
1975
         * tolerate that no file or directory is present and bail out.
1976
         */
1977
        apr_finfo_t finfo;
1978
        if (apr_stat(&finfo, fname, APR_FINFO_TYPE, ptemp) != APR_SUCCESS
1979
            || finfo.filetype == APR_NOFILE)
1980
            return NULL;
1981
    }
1973
    return ap_process_resource_config(s, fname, conftree, p, ptemp);
1982
    return ap_process_resource_config(s, fname, conftree, p, ptemp);
1974
}
1983
}
Lines 2021-2026 Link Here
2021
     */
2030
     */
2022
    rv = apr_dir_open(&dirp, path, ptemp);
2031
    rv = apr_dir_open(&dirp, path, ptemp);
2023
    if (rv != APR_SUCCESS) {
2032
    if (rv != APR_SUCCESS) {
2033
        /* If the directory doesn't exist and the optional flag is set
2034
         * there is no need to return an error.
2035
         */
2036
        if (rv == APR_ENOENT && optional) {
2037
            return NULL;
2038
        }
2024
        return apr_psprintf(p, "Could not open config directory %s: %pm",
2039
        return apr_psprintf(p, "Could not open config directory %s: %pm",
2025
                            path, &rv);
2040
                            path, &rv);
2026
    }
2041
    }

Return to bug 57585