[PATCH 1/3] rrd_client.c: modified getpath() to use realpath(path, NULL)
instead of realpath(path, resolved_path).
Index: rrdtool-1.4.8.new/src/rrd_client.c
===================================================================
--- rrdtool-1.4.8.new.orig/src/rrd_client.c	2013-08-05 16:36:39.000000000 +0200
+++ rrdtool-1.4.8.new/src/rrd_client.c	2013-08-05 16:39:33.000000000 +0200
@@ -68,12 +68,12 @@
  * are not allowed, since path name translation is done by the server.
  *
  * One must hold `lock' when calling this function. */
-static const char *get_path (const char *path, char *resolved_path) /* {{{ */
+static const char *get_path (const char *path) /* {{{ */
 {
   const char *ret = path;
   int is_unix = 0;
 
-  if ((path == NULL) || (resolved_path == NULL) || (sd_path == NULL))
+  if ((path == NULL) || (sd_path == NULL))
     return (NULL);
 
   if ((*sd_path == '/')
@@ -82,7 +82,7 @@
 
   if (is_unix)
   {
-    ret = realpath(path, resolved_path);
+    ret = realpath(path, NULL);
     if (ret == NULL)
       rrd_set_error("realpath(%s): %s", path, rrd_strerror(errno));
     return ret;
@@ -583,7 +583,6 @@
   rrdc_response_t *res;
   int status;
   int i;
-  char file_path[PATH_MAX];
 
   memset (buffer, 0, sizeof (buffer));
   buffer_ptr = &buffer[0];
@@ -594,7 +593,7 @@
     return (ENOBUFS);
 
   pthread_mutex_lock (&lock);
-  filename = get_path (filename, file_path);
+  filename = get_path (filename);
   if (filename == NULL)
   {
     pthread_mutex_unlock (&lock);
@@ -644,7 +643,6 @@
   size_t buffer_size;
   rrdc_response_t *res;
   int status;
-  char file_path[PATH_MAX];
 
   if (filename == NULL)
     return (-1);
@@ -658,7 +656,7 @@
     return (ENOBUFS);
 
   pthread_mutex_lock (&lock);
-  filename = get_path (filename, file_path);
+  filename = get_path (filename);
   if (filename == NULL)
   {
     pthread_mutex_unlock (&lock);
_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers

Reply via email to