summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5bf0fc8)
raw | patch | inline | side by side (parent: 5bf0fc8)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 28 May 2010 04:55:14 +0000 (04:55 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 28 May 2010 04:55:14 +0000 (04:55 +0000) |
program/src/rrd_client.c | patch | blob | history |
index 308965e22a802c768d447a2fabafc5a23a34f711..18dd0dde44be11f85277a9310353b65f3fe4b8e4 100644 (file)
--- a/program/src/rrd_client.c
+++ b/program/src/rrd_client.c
|| (strncmp ("unix:", sd_path, strlen ("unix:")) == 0))
is_unix = 1;
- if (*path == '/') /* absolute path */
+ if (is_unix)
{
- if (! is_unix)
- {
- rrd_set_error ("absolute path names not allowed when talking "
- "to a remote daemon");
- return (NULL);
- }
- /* else: nothing to do */
+ ret = realpath(path, resolved_path);
+ if (ret == NULL)
+ rrd_set_error("realpath(%s): %s", path, rrd_strerror(errno));
+ return ret;
}
- else /* relative path */
+ else
{
- if (is_unix)
+ if (*path == '/') /* not absolute path */
{
- realpath (path, resolved_path);
- ret = resolved_path;
+ rrd_set_error ("absolute path names not allowed when talking "
+ "to a remote daemon");
+ return NULL;
}
- /* else: nothing to do */
}
- return (ret);
+
+ return path;
} /* }}} char *get_path */
/* One must hold `lock' when calling `close_connection'. */