[lxc-devel] [lxc/master] Make /tmp accessible to any user

Rachid-Koucha on Github lxc-bot at linuxcontainers.org
Wed Jun 5 11:04:32 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 393 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190605/20040bdc/attachment.bin>
-------------- next part --------------
From a725bbc4b7637c54bbf29f6c7bf03996bb7bdb1c Mon Sep 17 00:00:00 2001
From: Rachid Koucha <47061324+Rachid-Koucha at users.noreply.github.com>
Date: Wed, 5 Jun 2019 13:04:11 +0200
Subject: [PATCH] Make /tmp accessible to any user

/tmp created with "rwxrwxrwt" mode

Signed-off-by: Rachid Koucha <rachid.koucha at gmail.com>
---
 templates/lxc-busybox.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
index 0d5d9ccf13..c9f39872e3 100644
--- a/templates/lxc-busybox.in
+++ b/templates/lxc-busybox.in
@@ -99,6 +99,9 @@ ${rootfs}/usr/lib64"
     mknod -m 666 "${rootfs}/dev/zero" c 1 5      || res=1
     mknod -m 666 "${rootfs}/dev/urandom" c 1 9   || res=1
   fi
+  
+  # make /tmp accessible to any user (with sticky bit)
+  chmod 1777 "${rootfs}/tmp" || return 1
 
   # root user defined
   cat <<EOF >> "${rootfs}/etc/passwd"


More information about the lxc-devel mailing list