help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cut of final 'f'


From: Patrice GUERLAIS
Subject: Cut of final 'f'
Date: Tue, 29 Nov 2005 10:08:48 +0100 (CET)

Hi all,

I'm in the process of upgrading all my clients from 2.0.7p3 to 2.1.17. But 
before that upgrade, I'm conducting some tests to ensure everything is ok, and 
I've found a strange behaviour.
I've encapsulated the use of cfengine in a Perl application, which generates 
some cfrun commands. The call of cfrun is done with parameters (in a -Dxxx 
way), so as to inform the client of what has to be done. Nothing fantastic in 
that use of cfengine.
What becomes strange is that when the class is exactly 'cfengine_conf', the 
last 'f' is lost between cfrun and cfservd. I tried a lot of other strings to 
figure out what's going on. The conclusion is that any string which ends with 
an 'f' looses this last character. Any other last character I tried (g, h, ...) 
has been kept...

For example :
/usr/local/cfengine/sbin/cfrun -f /tmp/cfrun.hosts.16229 -T -v -- -v -Daf   
<----------------- the final 'f' is present
<cut>
cfrun(0):         .......... [ Hailing <client_ip> ] ..........
Connecting to server <client_ip> to port 0 with options  -v -Daf            
<----------------- the final 'f' is still present

(Non privileged user...)

Loaded /home/patrice/.cfengine/ppkeys/root-<client_ip>.pub
Connect to <client_ip> = <client_ip> on port cfengine

(Non privileged user...)

Loaded /home/patrice/.cfengine/ppkeys/root-<client_ip>.pub
cfrun:calao.france.airfrance.fr: Strong authentication of server=<client_ip> 
connection confirmed
<client_ip> replies..


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

cfservd Executing /usr/local/cfengine/sbin/cfagent --no-splay --inform -v -Da   
<---------------- the final 'f' has been lost
</cut>

I've found in cfservd.c the lines which are responsible of the elimination of 
the 'f' at the end of an identifier. More generally, every 'f' at the end of a 
word and followed by a blank is discarded, I don't know on which purpose. It 
looks as if the involved section of code has been forgotten in the development 
process :-(

The comment just above the incriminated line says "Blank out -K -f". But indeed 
it blanks out -K, -f, and any 'f' followed by a blank :-( Just suppress the 
blanking of 'f<blank>' and my problem disappears, but I can't figure if it 
doesn't create another problem elsewhere...

<2.1.17, cfservd.c #1620>
1620c1620
<    if ((strncmp(sp,"-K",2) == 0) || (strncmp(sp,"-f",2) == 0))
---
>    if ((strncmp(sp,"-K",2) == 0) || (strncmp(sp,"-f",2) == 0) || 
> (strncmp(sp,"f ",2) == 0))
</2.1.17 cfservd.c #1620>

I've checked in 2.1.16, the same line exists.
Is it on purpose, or a relic of the development ? Does anybody can explain to 
me the how and why ?

Thanks
Patrice






reply via email to

[Prev in Thread] Current Thread [Next in Thread]