bug-cfengine
[Top][All Lists]
Advanced

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

Re: Weird bugs


From: Jason Kim
Subject: Re: Weird bugs
Date: Thu, 6 Oct 2005 16:36:55 -0400
User-agent: KMail/1.8.2

On Thursday 06 October 2005 08:36, Mark Burgess wrote:
> > * When cfexecd sends email, the from address can be (in some
> > circumstances) set differently in the smtp 'MAIL FROM:' and the 'From:'
> > header set in the message data. Is this behavior desired? If not, I offer
> > to help fix it. If so, there seem to be some oddities which I would like
> > to clarify.
>
> If this is related to the email patch you sent, then it is presumably
> fixed in 2.1.16, unless I have misunderstood. Please check.
>
I'm looking directly at the latest subversion now, and yes, the email patch I 
sent was already fixed, thanks and I apologize. I will from now on check the 
latest subversion code before filing a bug. (BTW, is there a way I can check 
out the code directly? Or should I rely on the latest snapshot tar file?)

However there is the other question of the different 'from' addresses. Looking 
at cfexecd.c, lines 991-1011, cfexecd sends an smtp 'MAIL FROM: <address>' 
command which could be different from the 'From: address' sent in the message 
body, lines 1052-1061. This leads to (in my case at least) a Reply-To header 
being set that is different from the from address. A simple fix would be to 
just settle on a method and duplicate it.

> > * There are extraneous cfengine.*.runlog files getting generated. I have
> > studied the code extensively, and have come to the conclusion that
> > cfexecd has some flaws in the way it resolves hostnames. Assuming you
> > agree to this conclusion, I can offer a possible resolution, including a
> > patch if you do not have the time to provide assistance. All I ask is
> > some guidance in understanding your original intent.
>
> The problem here is that VUQNAME is set too late. A possible fix would
> be to assume that VSYSNAME.nodename is VUQNAME until it discovers better
> some other way. Would this solve the problem for you.
>
Unfortunately if I set my hostname to be unqualified, cfexecd then cannot 
deduce the domain correctly. This leads to correct runlog files, but email 
subject lines of '(testy./10.1.9.9)' instead of 
'(testy.mgmt.advance.net/10.1.9.9)'.

> I don't care whether people use fully qualified names a their hostnames.
> Personally I think it is wrong, but that can be discussed. The main
> thing is to distinguish between VQ and UQ names -- and that is actually
> impossible to do with certainty, unless you have already declared the
> domain name.
>
I don't much care either :) I'm in a mainly RedHat/CentOS shop, so per their 
docs the hostname should be fully qualified. I've also run machines with 
unqualified hostnames, and as long as there's an /etc/hosts entry for the 
full name things seem to go ok as well. Regardless, I believe (as I hope you 
do) that cfexecd/cfagent should work consistently in either case...

> What is your suggested resolution of the problem?
>
I propose: a) querying cfagent for the correct VUQNAME/VDOMAIN from within 
GetCfStuff (it already queries for VFQNAME) instead of using calls to 
GetNameInfo(), and b) possibly making the 'domain' variable mandatory within 
all cfagent confs. My reasoning for this is that according to my tests, 
cfagent will always come to the correct name/domain conclusions _as long as_ 
a 'domain' var is set, regardless of whether or not the hostname is fully 
qualified or not.

One possible issue with this is that GetNameInfo() seems to set certain 
classes as a side effect, and I'm not sure whether this behavior is required 
in cfexecd. I didn't see any obvious need for it, but I'm sure I don't know 
the code as well as you...

That's it. Again, thanks for your time and help.
-JayKim




reply via email to

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