File: private-tmp

package info (click to toggle)
xchpst 0.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 304 kB
  • sloc: ansic: 2,792; sh: 75; makefile: 47
file content (14 lines) | stat: -rwxr-xr-x 236 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

set -e -o pipefail

r1=$RANDOM
r2=$(( $r1 + 1))

f1=/tmp/test-isolation-$r1
f2=/tmp/test-isolation-$r2

touch $f1

xchpst --user-ns --private-tmp sh -c "ls $f1 2>/dev/null; touch $f2" >&2
stat $f1 && ! stat $f2 2>/dev/null