You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
freshtomato-arm/docker/nss_wrapper

23 lines
448 B
Bash

#!/bin/bash
# Set current user in nss_wrapper
USER_ID=$(id -u)
GROUP_ID=$(id -g)
if [ x"$USER_ID" != x"0" ]; then
NSS_WRAPPER_PASSWD=/tmp/passwd
NSS_WRAPPER_GROUP=/etc/group
cat /etc/passwd > $NSS_WRAPPER_PASSWD
echo "default:x:${USER_ID}:${GROUP_ID}:Default Build User:${HOME}:/bin/bash" >> $NSS_WRAPPER_PASSWD
export NSS_WRAPPER_PASSWD
export NSS_WRAPPER_GROUP
export LD_PRELOAD=libnss_wrapper.so
fi
exec "$@"