Bug#922137: x2gobroker: please make the build reproducible

Chris Lamb lamby at debian.org
Tue Feb 12 14:32:35 GMT 2019


Source: x2gobroker
Version: 0.0.4.0-3
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that x2gobroker could not be built reproducibly as it had a uuid
in the "defaults" config dictionary.

Patch attached. It doesn't look like this would work initially but
base_broker.py has:

     # instead of returning None here, we invent a cookie and return that
     return str(uuid.uuid4())

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org 🍥 chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/1004_reproducible-build.patch	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/1004_reproducible-build.patch	2019-02-12 15:30:47.262281724 +0100
@@ -0,0 +1,23 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2019-02-12
+
+--- x2gobroker-0.0.4.0.orig/x2gobroker/defaults.py
++++ x2gobroker-0.0.4.0/x2gobroker/defaults.py
+@@ -32,7 +32,6 @@ X2Go Session Brokers uses many hard-code
+ 
+ # modules
+ import os
+-import uuid
+ import socket
+ import pwd, grp
+ 
+@@ -233,7 +232,7 @@ X2GOBROKER_CONFIG_DEFAULTS = {
+         'pre_auth_scripts': [],
+         'post_auth_scripts': [],
+         'select_session_scripts': [],
+-        'my-cookie': uuid.uuid4(),
++        'my-cookie': None,
+         'my-cookie-file': '/etc/x2go/broker/x2gobroker.authid',
+         'enable-plain-output': True,
+         'enable-json-output': True,
--- a/debian/patches/series	2019-02-12 15:20:12.436323632 +0100
--- b/debian/patches/series	2019-02-12 15:30:45.930269022 +0100
@@ -2,3 +2,4 @@
 1002_man-page-spelling-fixes.patch
 1003_handle-offline-builds.patch
 0001_sbin-x2gobroker-keygen-Fix-call-to-x2gobroker.utils..patch
+1004_reproducible-build.patch
--- a/x2gobroker/brokers/base_broker.py	2019-02-12 15:20:12.440323670 +0100
--- b/x2gobroker/brokers/base_broker.py	2019-02-12 15:31:33.806725926 +0100
@@ -82,6 +82,7 @@
 
         self._dynamic_cookie_map = {}
         self._client_address = None
+        self._cookie = None
 
     def __del__(self):
         """\
@@ -199,6 +200,8 @@
         my_cookie = unconfigured_my_cookie
 
         deprecated_my_cookie = self.config.get_value('global', 'my-cookie')
+        if deprecated_my_cookie is None:
+            deprecated_my_cookie = uuid.uuid4()
         my_cookie_file = self.config.get_value('global', 'my-cookie-file')
 
         if os.path.isfile(my_cookie_file):


More information about the Reproducible-bugs mailing list