DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42690>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42690

           Summary: realm is not set for each configured directory when
                    digest authentication is used
           Product: Apache httpd-2
           Version: 2.2.3
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_auth_digest
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


When the following configuration is set in httpd.conf file:

<Directory "/var/www/webapps/*/cgi-bin">
        AllowOverride None
        Order allow,deny
        Allow from all
        AuthType Digest
        AuthDigestDomain /var/www/webapps/*/cgi-bin/
        AuthName My_Realm
        AuthUserFile /etc/apache/.htdigest
        AuthGroupFile /etc/apache/.htgroups
        Require group users
    </Directory>

    <Directory "/var/www/webapps/admin/cgi-bin">
        AuthDigestDomain /admin/cgi-bin/
        Require group admins
    </Directory>

"Segmentation fault (11)" is logged in Apache error log because realm (AuthName)
for /var/www/webapps/admin/cgi-bin directory is not initialized.
When AuthDigestDomain directive is not set for this directory then Apache work
correctly. Here is gdb output:

# gdb httpd -d /source/
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-hardhat-linux"...
(gdb) b create_digest_dir_config
Breakpoint 1 at 0x10051998: file mod_auth_digest.c, line 405.
(gdb) b set_uri_list
Breakpoint 2 at 0x100521d0: file mod_auth_digest.c, line 581.
(gdb) b set_realm
Breakpoint 3 at 0x10051a88: file mod_auth_digest.c, line 423.
(gdb) b authenticate_digest_user
Breakpoint 4 at 0x10054be0: file mod_auth_digest.c, line 1594.
(gdb) run -X  -f /etc/apache/httpd.conf
Starting program: /usr/sbin/httpd -X  -f /etc/apache/httpd.conf

Breakpoint 1, create_digest_dir_config (p=0x10114968, dir=0x0) at
mod_auth_digest.c:405
405         if (dir == NULL) {
(gdb) c
Continuing.

Breakpoint 1, create_digest_dir_config (p=0x10114968, dir=0x101ab0e8
"/var/www/webapps/*/cgi-bin/") at mod_auth_digest.c:405
405         if (dir == NULL) {
(gdb) c
Continuing.

Breakpoint 2, set_uri_list (cmd=0x7ffffcf0, config=0x101ab498, uri=0x101ab550
"/var/www/webapps/*/cgi-bin/") at mod_auth_digest.c:581
581         digest_config_rec *c = (digest_config_rec *) config;
(gdb) c
Continuing.

Breakpoint 3, set_realm (cmd=0x7ffffcf0, config=0x101ab498, realm=0x101ab5a8
"My_Realm") at mod_auth_digest.c:423
423         digest_config_rec *conf = (digest_config_rec *) config;
(gdb) c
Continuing.

Breakpoint 1, create_digest_dir_config (p=0x10114968, dir=0x101ab9d0
"/var/www/webapps/admin/cgi-bin/") at mod_auth_digest.c:405
405         if (dir == NULL) {
(gdb) c
Continuing.

Breakpoint 2, set_uri_list (cmd=0x7ffffcf0, config=0x101abba8, uri=0x101abc60
"/admin/cgi-bin/") at mod_auth_digest.c:581
581         digest_config_rec *c = (digest_config_rec *) config;
(gdb) c
Continuing.
Detaching after fork from child process 3115.
cDetaching after fork from child process 3117.

Breakpoint 1, create_digest_dir_config (p=0x10114968, dir=0x0) at
mod_auth_digest.c:405
405         if (dir == NULL) {
(gdb) c
Continuing.

Breakpoint 1, create_digest_dir_config (p=0x10114968, dir=0x1018f510
"/var/www/webapps/*/cgi-bin/") at mod_auth_digest.c:405
405         if (dir == NULL) {
(gdb) c
Continuing.

Breakpoint 2, set_uri_list (cmd=0x7ffffcf0, config=0x1018f8a8, uri=0x1018f960
"/var/www/webapps/*/cgi-bin/") at mod_auth_digest.c:581
581         digest_config_rec *c = (digest_config_rec *) config;
(gdb) c
Continuing.

Breakpoint 3, set_realm (cmd=0x7ffffcf0, config=0x1018f8a8, realm=0x1018f9b8
"My_Realm") at mod_auth_digest.c:423
423         digest_config_rec *conf = (digest_config_rec *) config;
(gdb) c
Continuing.

Breakpoint 1, create_digest_dir_config (p=0x10114968, dir=0x101af8f0
"/var/www/webapps/admin/cgi-bin/") at mod_auth_digest.c:405
405         if (dir == NULL) {
(gdb) c
Continuing.

Breakpoint 2, set_uri_list (cmd=0x7ffffcf0, config=0x101afac8, uri=0x101afb80
"/admin/cgi-bin/") at mod_auth_digest.c:581
581         digest_config_rec *c = (digest_config_rec *) config;
(gdb) c
Continuing.
Detaching after fork from child process 3119.
Detaching after fork from child process 3121.

Breakpoint 4, authenticate_digest_user (r=0x10214d30) at mod_auth_digest.c:1594
1594        if (!(t = ap_auth_type(r)) || strcasecmp(t, "Digest")) {
(gdb) n
1598        if (!ap_auth_name(r)) {
(gdb) n
1607        mainreq = r;
(gdb) n
1608        while (mainreq->main != NULL) {
(gdb) n
1611        while (mainreq->prev != NULL) {
(gdb) n
1614        resp = (digest_header_rec *)
ap_get_module_config(mainreq->request_config,
(gdb) n
1616        resp->needed_auth = 1;
(gdb) n
1621        conf = (digest_config_rec *) ap_get_module_config(r->per_dir_config,
(gdb) n
1627        if (resp->auth_hdr_sts != VALID) {
(gdb) n
1644        r->user         = (char *) resp->username;
(gdb) n
1645        r->ap_auth_type = (char *) "Digest";
(gdb) n
1649        if (strcmp(resp->uri, resp->raw_request_uri)) {
(gdb) n
1737        if (resp->opaque && resp->opaque_num == 0) {
(gdb) n
1745        if (strcmp(resp->realm, conf->realm)) {
(gdb) p conf->realm
$1 = 0x0
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x0fb0aba4 in strcmp () from /lib/libc.so.6
(gdb) where
#0  0x0fb0aba4 in strcmp () from /lib/libc.so.6
#1  0x10055204 in authenticate_digest_user (r=0x10214d30) at 
mod_auth_digest.c:1745
#2  0x100363f0 in ap_run_check_user_id (r=0x10214d30) at request.c:71
#3  0x1003751c in ap_process_request_internal (r=0x10214d30) at request.c:194
#4  0x10087eb0 in ap_process_request (r=0x10214d30) at http_request.c:256
#5  0x10084248 in ap_process_http_connection (c=0x1020eeb0) at http_core.c:184
#6  0x10048dc4 in ap_run_process_connection (c=0x1020eeb0) at connection.c:43
#7  0x100493d0 in ap_process_connection (c=0x1020eeb0, csd=0x1020ed18) at
connection.c:178
#8  0x100c4040 in child_main (child_num_arg=0) at prefork.c:640
#9  0x100c415c in make_child (s=0x1011b028, slot=0) at prefork.c:680
#10 0x100c48b0 in ap_mpm_run (_pconf=0x10114968, plog=0x10158a78, s=0x1011b028)
at prefork.c:956
#11 0x1001e608 in main (argc=4, argv=0x7ffffe24) at main.c:717
#12 0x0faad6cc in __libc_start_main () from /lib/libc.so.6
(gdb) q
#

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to