Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid explicit /tmp in favor of $TMPDIR #578

Merged
merged 1 commit into from
Mar 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions test/integration/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
#!/bin/sh
test ! -e /tmp/folder && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we want to start this file with a quick check for the existence of TMPDIR, defaulting it to /tmp/ if it doesn't otherwise exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added changes

mkdir /tmp/folder
chmod 0567 /tmp/folder

echo -n 'hello world' > /tmp/file
test ! -e /tmp/symlink && \
ln -s /tmp/file /tmp/symlink
chmod 0777 /tmp/symlink
chmod 0765 /tmp/file
tmpdir=${TMPDIR:-/tmp}

echo -n 'hello suid/sgid/sticky' > /tmp/sfile
chmod 7765 /tmp/sfile
test ! -e $tmpdir/folder && \
mkdir $tmpdir/folder
chmod 0567 $tmpdir/folder

echo -n 'hello space' > /tmp/spaced\ file
echo -n 'hello world' > $tmpdir/file
test ! -e $tmpdir/symlink && \
ln -s $tmpdir/file /tmp/symlink
chmod 0777 $tmpdir/symlink
chmod 0765 $tmpdir/file

test ! -e /tmp/pipe && \
mkfifo /tmp/pipe
echo -n 'hello suid/sgid/sticky' > $tmpdir/sfile
chmod 7765 $tmpdir/sfile

test ! -e /tmp/block_device && \
mknod /tmp/block_device b 7 7
chmod 0666 /tmp/block_device
echo -n 'hello space' > $tmpdir/spaced\ file

test ! -e $tmpdir/pipe && \
mkfifo $tmpdir/pipe

test ! -e $tmpdir/block_device && \
mknod $tmpdir/block_device b 7 7
chmod 0666 $tmpdir/block_device