Your message dated Sat, 1 Feb 2014 08:02:02 -0600
with message-id <[email protected]>
has caused the   report #737308,
regarding rserve: FTBFS on hurd-i386
to be marked as having been forwarded to the upstream software
author(s) [email protected]

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
737308: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737308
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Svante,

Thanks, passing this on to upstream.  A little tedious, but probably worth
the pain.

Dirk

On 1 February 2014 at 14:40, Svante Signell wrote:
| Source: rserve
| Version: 1.7-3-1
| Severity: important
| Tags: patch
| User: [email protected]
| Usertags: hurd
| 
| Hi,
| 
| rserve fails to build from source on GNU/Hurd since PATH_MAX is not
| defined. The following change solves this problem.
| 
| src/Rserv.c: Use strlen() to find the string length needed (and
| allocating space for / and the terminating \0).
| 
| A patch is attached.
| 
| Thanks!
| 
| 
| 
| 
| ----------------------------------------------------------------------
| --- a/src/Rserv.c.orig        2013-08-21 23:09:33.000000000 +0200
| +++ b/src/Rserv.c     2014-01-31 21:22:28.000000000 +0100
| @@ -2206,14 +2206,17 @@ static void rm_rf(const char *what) {
|               chmod(what, st.st_mode | ((st.st_mode & S_IFDIR) ? S_IRWXU : 
S_IWUSR));
|               if (st.st_mode & S_IFDIR) { /* dirs need to be deleted 
recursively */
|                       DIR *dir = opendir(what);
| -                     char path[PATH_MAX];
| +                     char *path = NULL;
|                       if (dir) {
|                               struct dirent *d;
|                               while ((d = readdir(dir))) {
|                                       if (!strcmp(d->d_name, ".") || 
!strcmp(d->d_name, ".."))
|                                               continue;
| -                                     snprintf(path, sizeof(path), "%s/%s", 
what, d->d_name);
| +                                     int len = strlen(what) + 1 + 
strlen(d->d_name) + 1;
| +                                     path = (char*)malloc(len);
| +                                     snprintf(path, len, "%s/%s", what, 
d->d_name);
|                                       rm_rf(path);
| +                                     free(path);
|                               }
|                               closedir(dir);
|                       }

-- 
Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com

--- End Message ---

Reply via email to