Skip to content

Commit

Permalink
NAS-132639 / 24.10.2 / Add empty /etc/default/locale file to be rea…
Browse files Browse the repository at this point in the history
…d by `/etc/pam.d/sshd` (by yocalebo) (#15088)

* Add empty `/etc/default/locale` file to be read by `/etc/pam.d/sshd`

We should not have any default locale as https://wiki.debian.org/Locale suggests
("If you have users who access the system through ssh, it is recommended that you
  choose None as your default locale")

(cherry picked from commit 9afe99a)

* add test

(cherry picked from commit 1952025)

* expand comment

(cherry picked from commit 8093942)

---------

Co-authored-by: themylogin <[email protected]>
Co-authored-by: caleb <[email protected]>
  • Loading branch information
3 people authored Dec 3, 2024
1 parent 46fcb78 commit adedbe0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Empty file added src/freenas/etc/default/locale
Empty file.
11 changes: 11 additions & 0 deletions tests/api2/test_default_locale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from middlewared.test.integration.utils import call


def test_default_locale_exists():
# it's important we keep this empty file
# since it causes error like these if its missing
# root@truenas[~]# tail -1 /var/log/error
# Nov 20 21:17:01 truenas CRON[399613]: pam_env(cron:session): \
# Unable to open env file: /etc/default/locale: No such file or directory
rv = call("filesystem.stat", "/etc/default/locale")
assert rv, rv

0 comments on commit adedbe0

Please sign in to comment.