You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2011/10/07 16:38:04 UTC

DO NOT REPLY [Bug 51991] New: Mod_authn_socache seg faults when configured from .htaccess

https://issues.apache.org/bugzilla/show_bug.cgi?id=51991

             Bug #: 51991
           Summary: Mod_authn_socache seg faults when configured from
                    .htaccess
           Product: Apache httpd-2
           Version: 2.3.12-beta
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: mod_authn_socache
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: jan@unixpapa.com
    Classification: Unclassified


First this is 2.3.14-beta, which wasn't an option on the Version select.

I was trying to modify an authentication module I maintain to work with
mod_authn_socache, and set up a test directory with a .htaccess file. Apache
seg faulted every time I hit the directory. Eventually, I took my module out
and tried mod_authn_file instead, using the .htaccess file below:

AuthType Basic
AuthName "This is a test"
AuthBasicProvider socache file
AuthUserFile /home/jan/apache2.3/htdocs/mae2/htpasswd
AuthnCacheProvideFor file
Require valid-user

Still crashed. So, huh, maybe not my module at fault? Looked at it under gdb.
It was crashing because mod_authn_socache's check_password() function was
calling

   rv = socache_provider->retrieve(socache_instance, r->server,
                                    (unsigned char*)key, strlen(key),
                                    val, &vallen, r->pool);

while socache_instance was NULL. This looks like it is supposed to be
initialized from the authn_cache_post_config() function which is called on the
"post_config" hook. Well, yeah, but I have the vague idea that that occurs only
after reading the server config, not after reading .htaccess. So since I had no
AuthnCacheProvideFor directives in the server config, it wouldn't initialize at
that time. It doesn't encounter the AuthnCacheProvideFor directives in my
.htaccess file until later.

So I took the configuration directives out of my .htaccess file, and stuck them
in a <Directory> block in httpd.conf.  No more segmentation fault.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51991] Mod_authn_socache seg faults when configured from .htaccess

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51991

--- Comment #1 from Nick Kew <ni...@webthing.com> 2011-10-07 16:05:14 UTC ---
Good catch, though not 100% right.  The issue is that the post_config hook
tests for "configured", and doesn't set anything up if there's no authn_socache
configuration.

Solution: an extra configuration directive that'll just say "yes, enable me" in
post_config, together with testing "configured" flag in the later functions. 
Bug me if I haven't committed a fix by Sunday.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51991] Mod_authn_socache seg faults when configured from .htaccess

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51991

--- Comment #4 from Tianyin Xu <ti...@cs.ucsd.edu> 2012-03-04 04:44:00 UTC ---
Hi, Jan, did you test and confirm that "if you forget to put 'AuthnCacheEnable'
into the config file, and try to use it from a .htaccess file, then you'd still
get a Segmentation Violation"?

Thanks a lot!

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 51991] Mod_authn_socache seg faults when configured from .htaccess

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51991

Elizabeth Bart <pu...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |purebredfromcinsity@gmail.c
                   |                            |om
         Resolution|---                         |WORKSFORME

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51991] Mod_authn_socache seg faults when configured from .htaccess

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51991

Jan Wolter <ja...@unixpapa.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |
     Ever Confirmed|1                           |0

--- Comment #3 from Jan Wolter <ja...@unixpapa.com> 2011-10-10 02:07:48 UTC ---
Do I understand correctly that to able to use authn_socache from a .htaccess
file, there now needs to be this argumentless "AuthnCacheEnable" command
someplace in the main config file? So if I'm an ISP with thousands of clients
on my servers and I think one of them might someday want to use authn_socache,
then I ought to put "AuthnCacheEnable" in my config files? This seems bizarre.
If I have the mod_authn_socache module installed, then haven't I already
indicated my desire that it be available? Why do I need a directive that says
"Not only do I want you to be installed, I want you to work too!" I don't
understand it.

Philosophy aside, I think there is still a problem. I haven't tested it, just
looked at the code, but it looks to me like if you forget to put
"AuthnCacheEnable" into the config file, and try to use it from a .htaccess
file, then you'd still get a Segmentation Violation.  Wouldn't it be better if
it generated a nice neat "You forgot to put the meaningless AuthnCacheEnable
directive into your config file so I'm going to ignore you, neener neener"
message? Or better yet, just went ahead and initialized itself?

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51991] Mod_authn_socache seg faults when configured from .htaccess

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51991

Nick Kew <ni...@webthing.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Nick Kew <ni...@webthing.com> 2011-10-08 14:54:04 UTC ---
Fixed in r1180384

Introduces AuthnCacheEnable directive to determine whether initialisation
happens so it can be used in .htaccess.  If not enabled, it just fails silently
from htaccess.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51991] Mod_authn_socache seg faults when configured from .htaccess

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51991

Rainer Jung <ra...@kippdata.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.3.12-beta                 |2.3.14-beta

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org