Skip to content

Commit

Permalink
Don't use shadow.info
Browse files Browse the repository at this point in the history
It relies on Python's spwd module which has been removed in Python 3.13.
Call `getent shadow` instead.

QubesOS/qubes-issues#9402
  • Loading branch information
marmarek committed Aug 21, 2024
1 parent 12eac39 commit aaca60b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pillar/qvm/sys-gui-gpu.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 == '' %}
Expand All @@ -18,4 +18,4 @@ qvm:
dummy-modules:
- psu
sys-gui-gpu-vm:
password-hash: {{ password_hash }}
password-hash: {{ password_hash }}
2 changes: 1 addition & 1 deletion pillar/qvm/sys-gui-vnc.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 == '' %}
Expand Down

0 comments on commit aaca60b

Please sign in to comment.