github.com/openshift/installer@v1.4.17/images/libvirt/mock-nss.sh (about)

     1  #!/bin/bash
     2  
     3  # mock passwd and group files
     4  (
     5    exec 2>/dev/null
     6    username="${NSS_USERNAME:-$(id -un)}"
     7    uid="${NSS_UID:-$(id -u)}"
     8  
     9    groupname="${NSS_GROUPNAME:-$(id -gn)}"
    10    gid="${NSS_GID:-$(id -g)}"
    11  
    12    echo "${username}:x:${uid}:${uid}:gecos:${HOME}:/bin/bash" > "${NSS_WRAPPER_PASSWD}"
    13    echo "${groupname}:x:${gid}:" > "${NSS_WRAPPER_GROUP}"
    14  )
    15  
    16  # wrap command
    17  export LD_PRELOAD=/usr/lib64/libnss_wrapper.so
    18  exec "$@"