#!/bin/sh # SPDX-License-Identifier: CC0-1.0 # Copyright (C) 2022 Wojtek Kosior # # Available under the terms of Creative Commons Zero v1.0 Universal. set -e SHELL_TO_USE="$1" USER_ID_TO_USE="$2" GROUP_ID_TO_USE="$3" mount --bind hosts /etc/hosts; mount -t tmpfs dummy /var/run/nscd 2>/dev/null || true; unshare --map-user="$USER_ID_TO_USE" --map-group="$GROUP_ID_TO_USE" \ "$SHELL_TO_USE"