[Pkg-remote-team] [PATCH] Fix build problem with guacamole-server on unstable

Petter Reinholdtsen pere at hungry.com
Tue Nov 29 06:59:42 UTC 2016


Hi.

I tried to build the guacaole-server source in git on unstable, and it
failed to work.  The code do not work with openssl 1.1 and uses the now
obsolete readdir_r() call.  Here is a patch to work around these issues.

To be able to build the package on Jessie, I reduced the debhelper level
from 10 to 9.  Perhaps an idea for the official debian package?

Here is the patch I used.  I have not tested running the program.
Unless it is multithreaded and resuses the DIR value used by readdir(),
it should work as intended.  I saw no sign of DIR value reuse.

Note, the old code might lead to problems if the d_name struct member is
filled with very long names.

diff --git a/debian/compat b/debian/compat
index f599e28..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-10
+9
diff --git a/debian/control b/debian/control
index 2cb0629..f945cd2 100644
--- a/debian/control
+++ b/debian/control
@@ -5,9 +5,10 @@ Uploaders:
  Dominik George <nik at naturalnet.de>,
 Build-Depends:
  autotools-dev,
- debhelper (>= 10),
+ debhelper (>= 9),
  libcairo-dev,
  libcunit1-dev,
+ libssl1.0-dev,
  libfreerdp-dev (>= 1.0.1),
  libossp-uuid-dev,
  libpango1.0-dev,
diff --git a/src/protocols/rdp/rdp_fs.h b/src/protocols/rdp/rdp_fs.h
index 48cf6ea..cfe251e 100644
--- a/src/protocols/rdp/rdp_fs.h
+++ b/src/protocols/rdp/rdp_fs.h
@@ -221,12 +221,6 @@ typedef struct guac_rdp_fs_file {
     DIR* dir;
 
     /**
-     * The last read dirent structure. This is used if traversing the contents
-     * of a directory.
-     */
-    struct dirent __dirent;
-
-    /**
      * The pattern the check directory contents against, if any.
      */
     char dir_pattern[GUAC_RDP_FS_MAX_PATH];
diff --git a/src/protocols/rdp/rdp_fs.c b/src/protocols/rdp/rdp_fs.c
index e6ccbdf..f9a05a7 100644
--- a/src/protocols/rdp/rdp_fs.c
+++ b/src/protocols/rdp/rdp_fs.c
@@ -560,15 +560,14 @@ const char* guac_rdp_fs_read_dir(guac_rdp_fs* fs, int file_id) {
     }
 
     /* Read next entry, stop if error */
-    if (readdir_r(file->dir, &(file->__dirent), &result))
-        return NULL;
+    result = readdir(file->dir);
 
     /* If no more entries, return NULL */
     if (result == NULL)
         return NULL;
 
     /* Return filename */
-    return file->__dirent.d_name;
+    return result->d_name;
 
 }
 
--
Happy hacking
Petter Reinholdtsen



More information about the Pkg-remote-team mailing list