Skip to content

Commit ca79f4d

Browse files
committed
fix wrong nss_wrapper behavior when used with --userns=keep-id
Fixes: #339
1 parent f879502 commit ca79f4d

File tree

1 file changed

+1
-1
lines changed
  • src/root/usr/share/container-scripts/postgresql

1 file changed

+1
-1
lines changed

src/root/usr/share/container-scripts/postgresql/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function generate_postgresql_recovery_config() {
178178
function generate_passwd_file() {
179179
export USER_ID=$(id -u)
180180
export GROUP_ID=$(id -g)
181-
grep -v -e ^postgres -e ^$USER_ID /etc/passwd > "$HOME/passwd"
181+
grep -v -e ^postgres -e ^$USER_ID -e ^$(id -un) /etc/passwd > "$HOME/passwd"
182182
echo "postgres:x:${USER_ID}:${GROUP_ID}:PostgreSQL Server:${HOME}:/bin/bash" >> "$HOME/passwd"
183183
export LD_PRELOAD=libnss_wrapper.so
184184
export NSS_WRAPPER_PASSWD=${HOME}/passwd

0 commit comments

Comments
 (0)