From 81de69d8cb12dac3b056922a1fe86e4f1e1e42c8 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Mon, 18 Mar 2024 11:57:00 -0300 Subject: [PATCH] Further improvements to shared local users --- abra.sh | 2 +- entrypoint.sh.tmpl | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/abra.sh b/abra.sh index 06c9c6d..20bf968 100644 --- a/abra.sh +++ b/abra.sh @@ -1,4 +1,4 @@ -export CUSTOM_ENTRYPOINT_VERSION=v16 +export CUSTOM_ENTRYPOINT_VERSION=v17 export OIDC_CONF_VERSION=v1 export PAM_EXEC_OAUTH2_YAML_VERSION=v1 export PAM_SCRIPT_AUTH_VERSION=v7 diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index 7b74ffc..9d88316 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -28,9 +28,21 @@ cp /opt/users/group /etc/group || true copy_users() { while true; do - cp -u /etc/passwd /opt/users/passwd - cp -u /etc/shadow /opt/users/shadow - cp -u /etc/group /opt/users/group + if [ /etc/passwd -nt /opt/users/passwd ]; then + cp -uv /etc/passwd /opt/users/passwd + else + cp -uv /opt/users/passwd /etc/passwd + fi + if [ /etc/shadow -nt /opt/users/shadow ]; then + cp -uv /etc/shadow /opt/users/shadow + else + cp -uv /opt/users/shadow /etc/shadow + fi + if [ /etc/group -nt /opt/users/group ]; then + cp -uv /etc/group /opt/users/group + else + cp -uv /opt/users/group /etc/group + fi sleep 60 done }