Skip to content

Commit d2affc7

Browse files
committed
Insert rebinder at the head of the (possibly empty) LD_PRELOAD pathlist,
required for use cases relying on other preloaded libraries e.g. nss_wrapper.
1 parent 27ee353 commit d2affc7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

websockify/websocketproxy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,11 @@ def __init__(self, RequestHandlerClass=ProxyRequestHandler, *args, **kwargs):
325325
self.target_port = sock.getsockname()[1]
326326
sock.close()
327327

328+
# Insert rebinder at the head of the (possibly empty) LD_PRELOAD pathlist
329+
ld_preloads = filter(None, [ self.rebinder, os.environ.get("LD_PRELOAD", None) ])
330+
328331
os.environ.update({
329-
"LD_PRELOAD": self.rebinder,
332+
"LD_PRELOAD": os.pathsep.join(ld_preloads),
330333
"REBIND_OLD_PORT": str(kwargs['listen_port']),
331334
"REBIND_NEW_PORT": str(self.target_port)})
332335

0 commit comments

Comments
 (0)