Skip to content

Commit

Permalink
Add chahgelogs for saltstack#64141 and saltstack#64158
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed May 2, 2023
1 parent 40c15d6 commit b223395
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog/64141.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make salt user's home /opt/saltstack/salt
1 change: 1 addition & 0 deletions changelog/64158.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Salt minion runs with salt group permissions
2 changes: 1 addition & 1 deletion pkg/debian/salt-common.preinst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ case "$1" in
# 3. create user if not existing
if ! getent passwd | grep -q "^$SALT_USER:"; then
echo -n "Adding system user $SALT_USER.."
adduser --quiet \
useradd --quiet \
--system \
--ingroup $SALT_GROUP \
--no-create-home \
Expand Down
4 changes: 2 additions & 2 deletions pkg/rpm/salt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ test -d %{_SALT_HOME} || mkdir -p %{_SALT_HOME}
# 3. create user if not existing
# -g %{_SALT_GROUP} \
if ! getent passwd | grep -q "^%{_SALT_USER}:"; then
adduser --system \
useradd --system \
--no-create-home \
-s /sbin/nlogin \
-s /sbin/nologin \
-g %{_SALT_GROUP} \
%{_SALT_USER} 2>/dev/null || true
fi
Expand Down
6 changes: 4 additions & 2 deletions pkg/tests/integration/test_salt_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def test_salt_user_home(install_salt):
"""
Test the correct user is running the Salt Master
"""
proc = subprocess.run(["getent", "salt"], check=False, capture_output=True)
proc = subprocess.run(
["getent", "passwd", "salt"], check=False, capture_output=True
)
assert proc.returncode == 0
home = ""
try:
Expand All @@ -47,7 +49,7 @@ def test_salt_user_group(install_salt):
in_group = False
try:
for group in proc.stdout.decode().split(" "):
if group == "salt":
if "salt" in group:
in_group = True
except:
pass
Expand Down

0 comments on commit b223395

Please sign in to comment.