From 77e83d4b17306ea1fc9c57100b881bc7a837f326 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 6 Mar 2015 07:39:31 +0100 Subject: [PATCH] xbps-uunshare: for compat with uchroot, use the uid/gid of the calling process. ... rather than setting this up for uid/gid 0. --- bin/xbps-uunshare/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/xbps-uunshare/main.c b/bin/xbps-uunshare/main.c index 75f4d860..c964c373 100644 --- a/bin/xbps-uunshare/main.c +++ b/bin/xbps-uunshare/main.c @@ -142,7 +142,7 @@ main(int argc, char **argv) */ if ((fd = open("/proc/self/uid_map", O_RDWR)) == -1) die("failed to open /proc/self/uidmap rw"); - if (write(fd, buf, snprintf(buf, sizeof buf, "0 %u 1\n", uid)) == -1) + if (write(fd, buf, snprintf(buf, sizeof buf, "%u %u 1\n", uid, uid)) == -1) die("failed to write to /proc/self/uid_map"); close(fd); @@ -156,7 +156,7 @@ main(int argc, char **argv) if ((fd = open("/proc/self/gid_map", O_RDWR)) == -1) die("failed to open /proc/self/gid_map rw"); - if (write(fd, buf, snprintf(buf, sizeof buf, "0 %u 1\n", gid)) == -1) + if (write(fd, buf, snprintf(buf, sizeof buf, "%u %u 1\n", gid, gid)) == -1) die("failed to write to /proc/self/setgroups"); close(fd);