From 87fd6b39fd8f19ca4d48dfa3614431b2aab7422d Mon Sep 17 00:00:00 2001 From: Orionis312050 Date: Tue, 13 Oct 2026 15:18:08 +0000 Subject: [PATCH] =?UTF-8?q?:wrench:=20Entr=C3=A9e=20passwd=20pour=20PUID:?= =?UTF-8?q?=20MakeMKV=20r=C3=A9sout=20sa=20conf=20via=20getpwuid,=20pas=20?= =?UTF-8?q?$HOME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/entrypoint.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docker/entrypoint.py b/docker/entrypoint.py index bad20ba..1dfac28 100644 --- a/docker/entrypoint.py +++ b/docker/entrypoint.py @@ -25,6 +25,19 @@ if os.geteuid() == 0 and puid: subprocess.run( ["chown", "-R", f"{puid}:{pgid or puid}", config_dir], check=False ) + # Entree passwd pour PUID: certains binaires (MakeMKV) resolvent le + # repertoire utilisateur via getpwuid et non via $HOME. Sans entree, + # makemkvcon ne trouve pas sa configuration (/config/.MakeMKV). + try: + with open("/etc/passwd", encoding="utf-8") as handle: + known_uids = {line.split(":")[2] for line in handle if ":" in line} + if str(puid) not in known_uids: + with open("/etc/passwd", "a", encoding="utf-8") as handle: + handle.write( + f"mkvtool:x:{puid}:{pgid or puid}::{config_dir}:/usr/sbin/nologin\n" + ) + except OSError: + pass os.setgroups([pgid] if pgid else []) if pgid: os.setgid(pgid)