xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [OSSTEST PATCH 1/3] ts-depriv-audit-qemu: Create complete /run/user in appropriate root
@ 2018-11-19 16:27 Ian Jackson
  2018-11-19 16:27 ` [OSSTEST PATCH 2/3] ts-depriv-audit-qemu: chmod +x qemu's chroot Ian Jackson
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ian Jackson @ 2018-11-19 16:27 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, George Dunlap

* Use mkdir -p, rather than trying to only create /run/user/$uid.
  That helps if /run and/or /run/user do not exist, as they do in
  libxl-made chroots with recent libxl (which gets qemu to chroot).

* Do all of this in the root directory of the qemu process, not our
  own root directory.  So it works if qemu is chrooted.

CC: George Dunlap <george.dunlap@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-depriv-audit-qemu | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ts-depriv-audit-qemu b/ts-depriv-audit-qemu
index 5d09350..4e07d76 100755
--- a/ts-depriv-audit-qemu
+++ b/ts-depriv-audit-qemu
@@ -48,9 +48,10 @@ END
         qpid=$(xenstore-read /local/domain/$domid/image/device-model-pid)
         uid=$(id -u xen-qemuuser-range-base)
         uid=$(( $uid + $domid ))
-        test -d /run/user || mkdir -m 2755 /run/user
-        if mkdir -m 2700 /run/user/$uid; then
-            chown $uid:root /run/user/$uid
+        qroot=$(readlink /proc/8123/root)
+        mkdir -pm 2755 $qroot/run/user
+        if mkdir -m 2700 $qroot/run/user/$uid; then
+            chown $uid:root $qroot/run/user/$uid
         fi
         osstest-depriv-fd-collector $qpid \
         /usr/local/lib/xen/bin/depriv-fd-checker
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-11-19 17:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-19 16:27 [OSSTEST PATCH 1/3] ts-depriv-audit-qemu: Create complete /run/user in appropriate root Ian Jackson
2018-11-19 16:27 ` [OSSTEST PATCH 2/3] ts-depriv-audit-qemu: chmod +x qemu's chroot Ian Jackson
2018-11-19 16:27 ` [OSSTEST PATCH 3/3] productionc-config*: Update to fishdescriptor with chroot bugfix Ian Jackson
2018-11-19 16:45 ` [OSSTEST PATCH 1/3] ts-depriv-audit-qemu: Create complete /run/user in appropriate root George Dunlap
2018-11-19 16:53   ` Ian Jackson
2018-11-19 16:58     ` George Dunlap
2018-11-19 17:04       ` Ian Jackson
2018-11-19 17:24 ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).