It looks like you're exactly right.. I'll submit a patch shortly.<br><br>Thanks!<br><br>-kb<br><br><div class="gmail_quote">On Tue, May 25, 2010 at 4:53 PM, Eduardo Bragatto <span dir="ltr"><<a href="mailto:eduardo@bragatto.com">eduardo@bragatto.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">On May 25, 2010, at 6:14 PM, Eduardo Bragatto wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On May 25, 2010, at 5:28 PM, kevin brintnall wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
The symbolic link should work. Can you verify whether realpath(2)<br>
on your system reports the correct path in the symlink case? If<br>
realpath(2) is right and the client is still not providing the right<br>
file name, then there is definitely a problem.<br>
</blockquote>
<br>
realpath(3) does work.<br>
<br>
I have used this little wrapper:<br>
<br>
<a href="http://yost.com/computers/compileAndGo/realpath.html" target="_blank">http://yost.com/computers/compileAndGo/realpath.html</a><br>
<br>
And after compiling and running it, I do get the real path:<br>
<br>
# ./test_realpath /usr/local/rrd/stable-crm2/repository/manager.nbg/<br>
switches/whk2s1/10146.rrd<br>
/usr/local/rrd/stable-crm2/rrd/switches/whk2s1/10146.rrd<br>
<br>
However calling "rrd_graph" to read "/usr/local/rrd/stable-crm2/<br>
repository/manager.nbg/switches/whk2s1/10146.rrd" does not cause it to<br>
flush to disk.<br>
</blockquote>
<br></div></div>
Hi,<br>
<br>
I have checked the code from rrd_client.c and indeed there was a problem there, starting on line #75 (rrdtool 1.4.3 stable):<br>
<br>
if (*path == '/') /* absolute path */<br>
{<br>
if (! is_unix)<br>
{<br>
rrd_set_error ("absolute path names not allowed when talking "<br>
"to a remote daemon");<br>
return (NULL);<br>
}<br>
}<br>
else /* relative path */<br>
{<br>
if (is_unix)<br>
{<br>
realpath (path, resolved_path);<br>
ret = resolved_path;<br>
}<br>
/* else: nothing to do */<br>
}<br>
return (ret);<br>
<br>
As we can see there, realpath is only called if using relative paths.<br>
<br>
realpath should also be called if it's an absolute path AND we are talking to a unix socket. Patching the code as follows has resolved the issue with symlinks:<br>
<br>
if (*path == '/') /* absolute path */<br>
{<br>
if (! is_unix)<br>
{<br>
rrd_set_error ("absolute path names not allowed when talking "<br>
"to a remote daemon");<br>
return (NULL);<br>
}<br>
/**** started adding here ***/<br>
else<br>
{<br>
realpath (path, resolved_path);<br>
ret = resolved_path;<br>
}<br>
/**** stopped adding here ***/<br>
}<br>
else /* relative path */<br>
{<br>
if (is_unix)<br>
{<br>
realpath (path, resolved_path);<br>
ret = resolved_path;<br>
}<br>
/* else: nothing to do */<br>
}<br>
<br>
Thank you all for your assistance. I hope to see this fix in a future stable release.<br><font color="#888888">
<br>
- Eduardo Bragatto.<br>
</font></blockquote></div><br><br clear="all"><br>-- <br> kevin brintnall =~ /<a href="http://kbrint@rufus.net/">kbrint@rufus.net/</a><br><br>