You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@worldgate.com> on 1997/11/12 23:18:00 UTC

before 1.3b3...

strtoul should be fixed

Hmm.  BSD is easy enough to steal and reasonably clean, but I don't like
the copyright issues.  

fnmatch.c has the same things I guess.  I'm not sure we comply with the
licensing terms though.  And any third party product (eg. Stronghold)
would certainly need to include:

 *      This product includes software developed by the University of
 *      California, Berkeley and its contributors.

even if we could sneak by without it.

Re: before 1.3b3...

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Thu, Nov 13, 1997 at 10:52:39AM -0700, Marc Slemko wrote:
> > So... What do you suggest? Replacing strtoul by strtol in the sources
> > rather than via a #ifdef SUNOS4 #define?
> 
> Yes.  I see no need for strtoul, and we have no idea what platforms it
> isn't on...

+0.9
    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: before 1.3b3...

Posted by Marc Slemko <ma...@worldgate.com>.
On Thu, 13 Nov 1997, Martin Kraemer wrote:

> On Thu, Nov 13, 1997 at 08:28:10AM -0700, Marc Slemko wrote:
> > 
> > Problem is that I doubt we know all platforms where strtoul is around.
> > 
> > Why not just check what strtol returns and, if it is negative, say "gaa!"?
> > Gives better checking than strtoul.  In fact, check for 0 <= octet <=
> > 255...
> 
> So... What do you suggest? Replacing strtoul by strtol in the sources
> rather than via a #ifdef SUNOS4 #define?

Yes.  I see no need for strtoul, and we have no idea what platforms it
isn't on...

> 
>     Martin
> -- 
> | S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
> | ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
> | N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
> ~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
> 


Re: before 1.3b3...

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Thu, Nov 13, 1997 at 08:28:10AM -0700, Marc Slemko wrote:
> 
> Problem is that I doubt we know all platforms where strtoul is around.
> 
> Why not just check what strtol returns and, if it is negative, say "gaa!"?
> Gives better checking than strtoul.  In fact, check for 0 <= octet <=
> 255...

So... What do you suggest? Replacing strtoul by strtol in the sources
rather than via a #ifdef SUNOS4 #define?

    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: before 1.3b3...

Posted by Ben Laurie <be...@algroup.co.uk>.
Ben Laurie wrote:
> 
> Leo Zancani wrote:
> >
> > Ben Laurie wrote:
> > >
> > > Leo Zancani wrote:
> > > >
> > > > Ben,
> > > >
> > > > just a quick one about the IDtoID table:
> > > >
> > > > the table has the following fields:
> > > >
> > > > IDtoIDID
> > > > Lifetime
> > > > DomainID
> > > > FromAcountID
> > > > ToAccountID
> > > >
> > > > Since the IDtoID struct carries the from account and to account as a
> > > > pair of Account structs, it has two domain ids. Are we ignoring
> > > > interdomain ID mappings and assuming that both the domain ids will be
> > > > the same (and that therefore it does not matter which one is used in the
> > > > DBFiller method for this mapping)? This seems reasonable...
> > >
> > > That is what I was thinking at the time, but I realise it is silly -
> > > interdomain mappings _should_ be possible. So, we need to do
> > > FromDomainID and ToDomainID instead.
> > >
> >
> > Cool, in that case, can you fix the data base so that the fields in the
> > IDtoID table are:
> >
> > IDtoIDID
> > Lifetime
> > FromDomainID
> > FromAcountID
> > ToDomainID
> > ToAccountID
> 
> Done - not actually run the db creation, but all files updated
> (including Policy_impl.cc).

Ahem. Dunno how on Earth this ended up here, but please ignore it!

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Re: before 1.3b3...

Posted by Ben Laurie <be...@algroup.co.uk>.
Leo Zancani wrote:
> 
> Ben Laurie wrote:
> >
> > Leo Zancani wrote:
> > >
> > > Ben,
> > >
> > > just a quick one about the IDtoID table:
> > >
> > > the table has the following fields:
> > >
> > > IDtoIDID
> > > Lifetime
> > > DomainID
> > > FromAcountID
> > > ToAccountID
> > >
> > > Since the IDtoID struct carries the from account and to account as a
> > > pair of Account structs, it has two domain ids. Are we ignoring
> > > interdomain ID mappings and assuming that both the domain ids will be
> > > the same (and that therefore it does not matter which one is used in the
> > > DBFiller method for this mapping)? This seems reasonable...
> >
> > That is what I was thinking at the time, but I realise it is silly -
> > interdomain mappings _should_ be possible. So, we need to do
> > FromDomainID and ToDomainID instead.
> >
> 
> Cool, in that case, can you fix the data base so that the fields in the
> IDtoID table are:
> 
> IDtoIDID
> Lifetime
> FromDomainID
> FromAcountID
> ToDomainID
> ToAccountID

Done - not actually run the db creation, but all files updated
(including Policy_impl.cc).

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Re: before 1.3b3...

Posted by Marc Slemko <ma...@worldgate.com>.
On Thu, 13 Nov 1997, Martin Kraemer wrote:

> On Thu, Nov 13, 1997 at 07:43:50AM -0700, Marc Slemko wrote:
> > I was thinking that since the patch uses strtoul, there must be some
> > reason; if that is the case, you can't just change it.
> 
> Since I was the author of the locations where strtoul() is used, maybe I
> should explain:
> 
> No, the reason for strtoul() use was not that the numbers should not
> overflow at the top end, but to document that the input is supposed to
> be _positive_ (i.e., an IP addr like -123.-45.-67.-89 is _not_ regarded
> to be valid input). Both atoi() and strtol() are supposed to accept such
> an input and deliver the results (-123 etc.). Strtoul() IMO should
> not accept negative numbers as valid (though it does on Linux).
> 
> The idea really was to document the intention.
> 
> However, when strtoul() is not available, and the extra (intended) input
> check is not required because the input is valid anyway, then strtol()
> makes a perfect replacement.

Problem is that I doubt we know all platforms where strtoul is around.

Why not just check what strtol returns and, if it is negative, say "gaa!"?
Gives better checking than strtoul.  In fact, check for 0 <= octet <=
255...

> 
>     Martin
> 
> > On Thu, 13 Nov 1997, Martin Kraemer wrote:
> > > Therefore just use this:
> > > 
> > > #ifdef SUNOS4
> > > #define strtoul(numstr,endp,base)  (unsigned long)strtol(numstr,endp,base)
> > > #endif
> -- 
> | S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
> | ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
> | N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
> ~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
> 


Re: before 1.3b3...

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Thu, Nov 13, 1997 at 07:43:50AM -0700, Marc Slemko wrote:
> I was thinking that since the patch uses strtoul, there must be some
> reason; if that is the case, you can't just change it.

Since I was the author of the locations where strtoul() is used, maybe I
should explain:

No, the reason for strtoul() use was not that the numbers should not
overflow at the top end, but to document that the input is supposed to
be _positive_ (i.e., an IP addr like -123.-45.-67.-89 is _not_ regarded
to be valid input). Both atoi() and strtol() are supposed to accept such
an input and deliver the results (-123 etc.). Strtoul() IMO should
not accept negative numbers as valid (though it does on Linux).

The idea really was to document the intention.

However, when strtoul() is not available, and the extra (intended) input
check is not required because the input is valid anyway, then strtol()
makes a perfect replacement.

    Martin

> On Thu, 13 Nov 1997, Martin Kraemer wrote:
> > Therefore just use this:
> > 
> > #ifdef SUNOS4
> > #define strtoul(numstr,endp,base)  (unsigned long)strtol(numstr,endp,base)
> > #endif
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: before 1.3b3...

Posted by Marc Slemko <ma...@worldgate.com>.
I was thinking that since the patch uses strtoul, there must be some
reason; if that is the case, you can't just change it.

I can find none.  I can find no reason why this requires an unsigned long.
If someone is silly enough to put something too big to put in a signed
long, then it ain't an IP address anyway.

Why not just convert it to longs?  Is there some point in using unsigned
longs?

On Thu, 13 Nov 1997, Martin Kraemer wrote:

> On Wed, Nov 12, 1997 at 03:18:00PM -0700, Marc Slemko wrote:
> > strtoul should be fixed
> 
> When grepping thru the source, I see that strtol() must be available
> even on SUNOS4 ;-)
> 
> Therefore just use this:
> 
> #ifdef SUNOS4
> #define strtoul(numstr,endp,base)  (unsigned long)strtol(numstr,endp,base)
> #endif
> 
>     Martin
> PS: ... this comes with a very liberal copyright ;-)
> -- 
> 


Re: before 1.3b3...

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Wed, Nov 12, 1997 at 03:18:00PM -0700, Marc Slemko wrote:
> strtoul should be fixed

When grepping thru the source, I see that strtol() must be available
even on SUNOS4 ;-)

Therefore just use this:

#ifdef SUNOS4
#define strtoul(numstr,endp,base)  (unsigned long)strtol(numstr,endp,base)
#endif

    Martin
PS: ... this comes with a very liberal copyright ;-)
-- 

Re: before 1.3b3...

Posted by Dean Gaudet <dg...@arctic.org>.
True, if someone has another alternative that's fine with me.  I just
didn't want to re-implement the wheel when I needed to fix our
wildcarding.

Dean

On Wed, 12 Nov 1997, Marc Slemko wrote:

> strtoul should be fixed
> 
> Hmm.  BSD is easy enough to steal and reasonably clean, but I don't like
> the copyright issues.  
> 
> fnmatch.c has the same things I guess.  I'm not sure we comply with the
> licensing terms though.  And any third party product (eg. Stronghold)
> would certainly need to include:
> 
>  *      This product includes software developed by the University of
>  *      California, Berkeley and its contributors.
> 
> even if we could sneak by without it.
>