objects.cache : CGI fails if line longer than 64K characters (2.0 b3)

Fran=?utf-8?B?w6c=?=ois Laupretre francois.laupretre-prestataire at calyon.com
Mon May 23 16:47:10 CEST 2005


Andreas Ericsson wrote :

> That would be mmap_fgets. I've got a feeling you're about to discover 
> that 65536 is the magic roof of the length of member-lists in 
> service-descriptions. Perhaps there is an unsigned short somewhere in 
> there which causes this weird limit.

Got it. Actually, it is not mmap_fgets. Mmap_fgets returns a buffer of 80 K
chars without problems. But, in xodtemplate_add_object_property, there is a
f... line that says :

	/* truncate if necessary */
	if(strlen(input)>MAX_XODTEMPLATE_INPUT_BUFFER)
		input[MAX_XODTEMPLATE_INPUT_BUFFER-1]='\x0';

And MAX_XODTEMPLATE_INPUT_BUFFER is defined as 65535 !

After defining it to 16*65535, everything works well...

This limit is right when we read from a primary config file and it was
certainly put here when the cache file did not exist yet, but something
should be done not to enforce it when we read from the objects cache file,
because it contains some aggregation of host & service group members, and
these lines can easily be longer than the limit of 64 K.

There is still a mistery : it is the fact that, after being truncated, the
resulting string (used for registration) is not null-terminated, as the code
above would suggest. I have already lost one day and I won't spend more on
the subject but it can be interesting to investigate.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20050523/b199c445/attachment.html>
-------------- next part --------------
Ce message et ses pièces jointes (le "message") est destiné à l'usage    
exclusif de son destinataire.                                            
Si vous recevez ce message par erreur, merci d'en aviser immédiatement   
l'expéditeur  et de le détruire ensuite. Le présent message  pouvant  
être altéré à notre insu,  CALYON Corporate and Investment Bank                              
ne peut pas être engagé par son contenu. Tous droits réservés. 
          
This message and/or any  attachments (the "message") is intended for     
the sole use of its addressee.                                            
If you are not the addressee, please immediately notify the sender and    
then destroy the message.  As this message and/or any attachments may 
have been altered without our knowledge,  its content  is not legally 
binding on CALYON Corporate and Investment Bank. All rights reserved.                                                                


More information about the Developers mailing list