aboutgitcode
diff options
context:
space:
mode:
-rwxr-xr-xmbuto9
1 files changed, 8 insertions, 1 deletions
diff --git a/mbuto b/mbuto
index 7530c72..0609e7e 100755
--- a/mbuto
+++ b/mbuto
@@ -1210,7 +1210,14 @@ usage() {
# If we're not running as root, re-run with fakeroot
-if [ "${LD_PRELOAD}" != "libfakeroot-sysv.so" ] && [ "$(id -u)" -ne 0 ]; then
+if [ "$(id -u)" -eq 0 ] && \
+ [ "$(cat /proc/self/uid_map)" = " 0 0 4294967295" ]; then
+ __as_root=1
+else
+ __as_root=0
+fi
+
+if [ "${LD_PRELOAD}" != "libfakeroot-sysv.so" ] && [ ${__as_root} -eq 0 ]; then
if ! FAKEROOT="$(command -v fakeroot)"; then
__fakeroot_missing="y"
else