Re: parameter value overflow in main.cf

This is a discussion on Re: parameter value overflow in main.cf within the mailing.postfix.users forums, part of the Mail Servers and Related category; On 2004-02-03 14:56, Victor.Duchovni@morganstanley.com wrote: >>I noticed that postfix doesn't say ...


Go Back   Usenet Forums > Mail Servers and Related > mailing.postfix.users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-03-2004
Marcin Gryszkalis
 
Posts: n/a
Default Re: parameter value overflow in main.cf

On 2004-02-03 14:56, Victor.Duchovni@morganstanley.com wrote:
>>I noticed that postfix doesn't say a word if value of integer parameter
>>in main.cf is too big. The int variable is silently overflowed.


> Known issue, and providing sensible inputs in *configuration* files is the
> administrator's responsibility. Postfix is careful when processing data
> received from untrusted sources, but the administrator is expected to not
> screw up.


nice assumption :)

>>It seems that
>>static int convert_mail_conf_int(const char *name, int *intval)
>>should be rewritten to check for overflows (possibly use
>>strtoll instead of sscanf etc.)

>
> strtoll() is not available on some platforms supported by Postfix. Fixing
> this requires Postfix to use its own conversion functions or, to convert
> the value back to a string and compare the strings. It is apparent that
> the effort is justified in this case.


I looked at the code and I think that it would be pretty nice to
add mail_conf_size.c (we already have bool, int, raw, str and time).
It would accept k, m and g as units.
I would also add overflow check there.

It would require changes in many places to switch from int to size
but it can be done later.

What do you think about it?

regards
--
Marcin Gryszkalis
jabber jid:mg@chrome.pl
gg:2532994
http://fork.pl
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:58 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0