From 62816f400965c0d6ad6a06fb1bcb4fdad07cc3aa Mon Sep 17 00:00:00 2001 From: Robert Dahlem Date: Tue, 6 Jan 2026 11:49:41 +0100 Subject: [PATCH] fix mk_postgres.py to run su with '-s /bin/sh' to make it work even if the users shell is /sbin/nologin --- agents/plugins/mk_postgres.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agents/plugins/mk_postgres.py b/agents/plugins/mk_postgres.py index 0a40a6483b6..09df3968c0a 100755 --- a/agents/plugins/mk_postgres.py +++ b/agents/plugins/mk_postgres.py @@ -784,7 +784,8 @@ def _run_sql_as_db_user( # type: (str, str, str, bool, bool) -> str base_cmd_list = [ "su", - "-", + "-s", + "/bin/sh", self.db_user, "-c", r"""PGPASSFILE=%s %s -X %s -A0 -F'%s' -f %s""",