From aaca60bfc58bbb5f28109dfd8f47fec8118070f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 21 Aug 2024 15:45:15 +0200 Subject: [PATCH] Don't use shadow.info It relies on Python's spwd module which has been removed in Python 3.13. Call `getent shadow` instead. QubesOS/qubes-issues#9402 --- pillar/qvm/sys-gui-gpu.sls | 4 ++-- pillar/qvm/sys-gui-vnc.sls | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pillar/qvm/sys-gui-gpu.sls b/pillar/qvm/sys-gui-gpu.sls index e9a5494..931399d 100644 --- a/pillar/qvm/sys-gui-gpu.sls +++ b/pillar/qvm/sys-gui-gpu.sls @@ -5,7 +5,7 @@ {% set user = salt['group.info']('qubes').get('members')[0] %} # 'password_hash' is obtained from /etc/shadow with corresponding # user set above. -{% set password_hash = salt['shadow.info'](user).get('passwd') %} +{% set password_hash = salt['cmd.run']("getent shadow " + user).split(":")[1] %} # Default password is set to '123456' {% if password_hash == '' %} @@ -18,4 +18,4 @@ qvm: dummy-modules: - psu sys-gui-gpu-vm: - password-hash: {{ password_hash }} \ No newline at end of file + password-hash: {{ password_hash }} diff --git a/pillar/qvm/sys-gui-vnc.sls b/pillar/qvm/sys-gui-vnc.sls index aa1827b..f7f741c 100644 --- a/pillar/qvm/sys-gui-vnc.sls +++ b/pillar/qvm/sys-gui-vnc.sls @@ -5,7 +5,7 @@ {% set user = salt['group.info']('qubes').get('members')[0] %} # 'password_hash' is obtained from /etc/shadow with corresponding # user set above. -{% set password_hash = salt['shadow.info'](user).get('passwd') %} +{% set password_hash = salt['cmd.run']("getent shadow " + user).split(":")[1] %} # Default password is set to '123456' {% if password_hash == '' %}