Skip to content

Commit

Permalink
Ensure nspawn never tries to bindmount /etc/localtime
Browse files Browse the repository at this point in the history
It shouldn't actually try that according to the docs, but I've seen it
happen twice now, and so did others. So let's just enforce a safe
default.

Resolves: #36
  • Loading branch information
ximion committed Dec 22, 2023
1 parent a032c9f commit 04d9a83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions debspawn/nspawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ def _execute_sdnspawn(
for v_name, v_value in env_vars.items():
cmd.extend(['-E', '{}={}'.format(v_name, v_value)])

# never try to bindmount /etc/localtime
cmd.append('--timezone=copy')

# add custom parameters
cmd.extend(parameters)

if nowait:
Expand Down

0 comments on commit 04d9a83

Please sign in to comment.