You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ben Laurie <be...@gonzo.ben.algroup.co.uk> on 1996/05/18 13:08:30 UTC

Good deed for the day?

Chaps,

In httpd/patches/for_Apache_misc/rprintf.tar.gz is a first stab at an rprintf()
plus patches to mod_status.c to use it.

Note, pre-release copyright notices ... I stole the code from FastCGI, as
suggested. I did initially try to port a proper printf but the floating point
support is a nightmare, probably even less portable than vnsprintf... dunno
what the copyrights should be for final release ... ideas?

So, we have ended up with a length-check+sprintf model. I haven't checked that
the length checking stuff actually works (yet) but mod_status seems to have
no problems.

Apologies for the use of malloc/free ... I'll fix that for the next release.

Check it out!

Cheers,

Ben.

-- 
Ben Laurie                  Phone: +44 (181) 994 6435
Freelance Consultant and    Fax:   +44 (181) 994 6472
Technical Director          Email: ben@algroup.co.uk
A.L. Digital Ltd,           URL: http://www.algroup.co.uk
London, England.

Re: Good deed for the day?

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Mon, 27 May 1996, Brian Behlendorf wrote:

> On Sat, 18 May 1996 dirkx@elect6.jrc.it wrote:
> > A few suggestions:
> > 
> >  - Would it be an idea to put, by default *ON*, an 'Authorative'
> >    directive in each auth module; which ensures that if the module 
> >    cannot find the user, or if the password mismatches, etc for that
> >    module, an AUTH_REQUIRED is returned, unless the admin has
> >     specifically swithced off this authorative keyword.
> >  - Would it be an idea to make any problem with the access checking or
> >    inconsistencies, missing informaion,e tc, such as not being able to open
> >     afile in the gdb, etc  lead to a SERVER_ERROR
> >   - I.e. be really hesitant to give a DECLINE.
> 
> This all sounds right.  Also sounds like the time might be right for a 
> "guide to module writers", since writing a good module is more than just 
> coding to the API.

This is a good point. And as it happens, an auth module should *not*
be hesitant to give return DECLINED, it should do so at every
opportunity. The reason for this is that if, for example, the DBM
module can't find a user, or the password doesn't match, maybe the
regular auth module knows something about it, and so it passes it
on. You'll note that mod_auth almost never DECLINEs.

[snip]

> Hmm, given the action in mod_info I'd say the latter is preferred, but I 
> think either can be derived from the other, so I'm not sure it matters a 
> whole lot.

Actually, it does, IMO. Where those things are used are, for example,
when you have illegal syntax, like 

AddType foo

which will get you, when you start Apache:

Syntax error on line 1 of ../conf/srm.conf:
AddType requires at least two arguments, a mime type followed by one
or more file extensions

The command_rec entry for AddType is:

{ "AddType", add_type, NULL, OR_FILEINFO, ITERATE2,
    "a mime type followed by one or more file extensions" },

Apache adds the "AddType requires at least two arguments," all by
itself. That's why the error strings are all (or should be) sentance
fragments and tend not to be gramatically correct on their own. It's
not the place to put a whole sentance, just a noun.

-- 
________________________________________________________________________
Alexei Kosut <ak...@nueva.pvt.k12.ca.us>      The Apache HTTP Server
URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/
 
      "War does not determine who is right, only who is left."


Re: Good deed for the day?

Posted by Brian Behlendorf <br...@organic.com>.
On Sat, 18 May 1996 dirkx@elect6.jrc.it wrote:
> A few suggestions:
> 
>  - Would it be an idea to put, by default *ON*, an 'Authorative'
>    directive in each auth module; which ensures that if the module 
>    cannot find the user, or if the password mismatches, etc for that
>    module, an AUTH_REQUIRED is returned, unless the admin has
>     specifically swithced off this authorative keyword.
>  - Would it be an idea to make any problem with the access checking or
>    inconsistencies, missing informaion,e tc, such as not being able to open
>     afile in the gdb, etc  lead to a SERVER_ERROR
>   - I.e. be really hesitant to give a DECLINE.

This all sounds right.  Also sounds like the time might be right for a 
"guide to module writers", since writing a good module is more than just 
coding to the API.

>   - As a minor legacy problem, we have in the 'require user x y z' spaces
>    as the separators, same for groups, whih prohibit spaces in the
>   userIDs. 

Hmm, does it work if you say "require valid-user"?

> Furthermore two of those 'require user' lines give unexpected
>   results. How about allowing multiple lines ? or require user= multiple
> lines.

I'd support that.

>  - Furthermore, in the 'err' msql in the command_rc block, should that
>    be a human readble string for the API-self documenting page, or should that
>    really bedesigned for an error message; it seems that some modules
>    have an explanotory string, others have a typical error strong:
> 
> command_rec msql_auth_cmds[] = {
> { "Auth_MSQLhost", msql_set_string_slot,
>     (void*)XtOffsetOf(msql_auth_config_rec, auth_msql_host),
>     OR_AUTHCFG, TAKE1, "Auth_MSQLhost: The mSQL Host must be set to 
> value; Syntax:  Auth_MSQLhost < IP address | FQHN | localhost >" },
>     
> { "Auth_MSQLhost", msql_set_string_slot,
>     (void*)XtOffsetOf(msql_auth_config_rec, auth_msql_host),
>     OR_AUTHCFG, TAKE1, "The Host with the mSQL database (or localhost)" },
> 
> what is best ?

Hmm, given the action in mod_info I'd say the latter is preferred, but I 
think either can be derived from the other, so I'm not sure it matters a 
whole lot.

	Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  |  We're hiring!  http://www.organic.com/Home/Info/Jobs/


Re: Good deed for the day?

Posted by di...@elect6.jrc.it.
I've just ben going through about 8 weeks of 'bug' reports
for the mod_auth_msql and the various other auth modules which
have ended up on my box for no aparent reason (that should
teach me puting an email address in the source). Just some
observations from these 30+ messages:

 - People do not RTFM
 - The mod_auth_msql and friends need a manual. See next msg
 - The interation between the 3 or 4 auth modules of
   apache is unclear
 - The 'decline' versus AUTH_REQUIRED behaviour needs
  cleaning up
 - There is a second, older, auto_msql from Vitek qhich sparks
  questions (6 out of the 28), this should be addresses by the next
   mesg with a backward compatibility #define mode.
 - A lot of the 'holes' in the security people perceive are
  realy confiuguration errors.

A few suggestions:

 - Would it be an idea to put, by default *ON*, an 'Authorative'
   directive in each auth module; which ensures that if the module 
   cannot find the user, or if the password mismatches, etc for that
   module, an AUTH_REQUIRED is returned, unless the admin has
    specifically swithced off this authorative keyword.
 - Would it be an idea to make any problem with the access checking or
   inconsistencies, missing informaion,e tc, such as not being able to open
    afile in the gdb, etc  lead to a SERVER_ERROR
  - I.e. be really hesitant to give a DECLINE.
  - As a minor legacy problem, we have in the 'require user x y z' spaces
   as the separators, same for groups, whih prohibit spaces in the
  userIDs. Furthermore two of those 'require user' lines give unexpected
  results. How about allowing multiple lines ? or require user= multiple
lines.

If this does not spark off a lot ofcritique, I'll upload some patches which
accomplish this.

 - Furthermore, in the 'err' msql in the command_rc block, should that
   be a human readble string for the API-self documenting page, or should 
that
   really bedesigned for an error message; it seems that some modules
   have an explanotory string, others have a typical error strong:

command_rec msql_auth_cmds[] = {
{ "Auth_MSQLhost", msql_set_string_slot,
    (void*)XtOffsetOf(msql_auth_config_rec, auth_msql_host),
    OR_AUTHCFG, TAKE1, "Auth_MSQLhost: The mSQL Host must be set to 
value; Syntax:  Auth_MSQLhost < IP address | FQHN | localhost >" },
    
{ "Auth_MSQLhost", msql_set_string_slot,
    (void*)XtOffsetOf(msql_auth_config_rec, auth_msql_host),
    OR_AUTHCFG, TAKE1, "The Host with the mSQL database (or localhost)" },

what is best ?
That is all for now

Dw