diff options
author | gutteridge <gutteridge@pkgsrc.org> | 2021-10-09 23:20:24 +0000 |
---|---|---|
committer | gutteridge <gutteridge@pkgsrc.org> | 2021-10-09 23:20:24 +0000 |
commit | af644b1afbadc8f04abbc6b3d6458c757dc51ad2 (patch) | |
tree | 1dabafe5eca8d71d14701ea6e5b2ad78f49d6631 /devel | |
parent | 62438021b6ab89ff8d98504412362988c477d5e8 (diff) | |
download | pkgsrc-af644b1afbadc8f04abbc6b3d6458c757dc51ad2.tar.gz |
py-jupyter_client: set sticky bit only on the directory
Addresses PR pkg/56437 from Chavdar Ivanov, who also supplied the patch
that has already been integrated upstream (but not yet in a release
branch).
Diffstat (limited to 'devel')
-rw-r--r-- | devel/py-jupyter_client/Makefile | 3 | ||||
-rw-r--r-- | devel/py-jupyter_client/distinfo | 3 | ||||
-rw-r--r-- | devel/py-jupyter_client/patches/patch-jupyter__client_connect.py | 44 |
3 files changed, 48 insertions, 2 deletions
diff --git a/devel/py-jupyter_client/Makefile b/devel/py-jupyter_client/Makefile index 7ad6e6f8a80..ae4298b2640 100644 --- a/devel/py-jupyter_client/Makefile +++ b/devel/py-jupyter_client/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.20 2021/06/29 09:23:30 nia Exp $ +# $NetBSD: Makefile,v 1.21 2021/10/09 23:20:24 gutteridge Exp $ DISTNAME= jupyter_client-6.1.12 PKGNAME= ${PYPKGPREFIX}-${DISTNAME} +PKGREVISION= 1 CATEGORIES= devel python MASTER_SITES= ${MASTER_SITE_PYPI:=j/jupyter_client/} diff --git a/devel/py-jupyter_client/distinfo b/devel/py-jupyter_client/distinfo index ab3accc40ff..cf2917e2845 100644 --- a/devel/py-jupyter_client/distinfo +++ b/devel/py-jupyter_client/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.16 2021/10/07 13:43:18 nia Exp $ +$NetBSD: distinfo,v 1.17 2021/10/09 23:20:24 gutteridge Exp $ RMD160 (jupyter_client-6.1.12.tar.gz) = 1e2bf8a6a8ec37e0744a7d5cb85895224636b43e SHA512 (jupyter_client-6.1.12.tar.gz) = f31ff1a24b264c32d35d07491785e1d77935cdb463243e90e4aadcb0a093a074cdce75f01662591766588f39b146077639ca697f71157309dc92f12ae04d5cdd Size (jupyter_client-6.1.12.tar.gz) = 301499 bytes +SHA1 (patch-jupyter__client_connect.py) = 0fd1aeeff32eb89d270324aada38f91d5decefb6 diff --git a/devel/py-jupyter_client/patches/patch-jupyter__client_connect.py b/devel/py-jupyter_client/patches/patch-jupyter__client_connect.py new file mode 100644 index 00000000000..3696b709660 --- /dev/null +++ b/devel/py-jupyter_client/patches/patch-jupyter__client_connect.py @@ -0,0 +1,44 @@ +$NetBSD: patch-jupyter__client_connect.py,v 1.1 2021/10/09 23:20:24 gutteridge Exp $ + +Set sticky bit only on the directory. +https://github.com/jupyter/jupyter_client/pull/711/ + +--- jupyter_client/connect.py.orig 2021-03-14 00:34:45.000000000 +0000 ++++ jupyter_client/connect.py +@@ -137,31 +137,20 @@ def write_connection_file(fname=None, sh + f.write(json.dumps(cfg, indent=2)) + + if hasattr(stat, 'S_ISVTX'): +- # set the sticky bit on the file and its parent directory +- # to avoid periodic cleanup +- paths = [fname] ++ # set the sticky bit on the parent directory of the file ++ # to ensure only owner can remove it + runtime_dir = os.path.dirname(fname) + if runtime_dir: +- paths.append(runtime_dir) +- for path in paths: +- permissions = os.stat(path).st_mode ++ permissions = os.stat(runtime_dir).st_mode + new_permissions = permissions | stat.S_ISVTX + if new_permissions != permissions: + try: +- os.chmod(path, new_permissions) ++ os.chmod(runtime_dir, new_permissions) + except OSError as e: +- if e.errno == errno.EPERM and path == runtime_dir: ++ if e.errno == errno.EPERM: + # suppress permission errors setting sticky bit on runtime_dir, + # which we may not own. + pass +- else: +- # failed to set sticky bit, probably not a big deal +- warnings.warn( +- "Failed to set sticky bit on %r: %s" +- "\nProbably not a big deal, but runtime files may be cleaned up periodically." % (path, e), +- RuntimeWarning, +- ) +- + return fname, cfg + + |