2011-11-07 13:46:58 -06:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This script is used to setup some special directory structures, permissions
|
|
|
|
# for the saver test
|
|
|
|
|
2011-11-07 16:52:18 -06:00
|
|
|
UNOWNED_DIRECTORY="/tmp/pluma-document-saver-unowned"
|
|
|
|
UNOWNED_FILE="/tmp/pluma-document-saver-unowned/pluma-document-saver-test.txt"
|
2011-11-07 13:46:58 -06:00
|
|
|
|
2011-11-07 16:52:18 -06:00
|
|
|
UNOWNED_GROUP="/tmp/pluma-document-saver-unowned-group.txt"
|
2011-11-07 13:46:58 -06:00
|
|
|
|
|
|
|
if [ -f "$UNOWNED_FILE" ]; then
|
|
|
|
sudo rm "$UNOWNED_FILE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "$UNOWNED_DIRECTORY" ]; then
|
|
|
|
sudo rmdir "$UNOWNED_DIRECTORY"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir "$UNOWNED_DIRECTORY"
|
|
|
|
touch "$UNOWNED_FILE"
|
|
|
|
|
|
|
|
sudo chown nobody "$UNOWNED_DIRECTORY"
|
|
|
|
|
|
|
|
sudo touch "$UNOWNED_GROUP"
|
|
|
|
sudo chgrp root "$UNOWNED_GROUP"
|
|
|
|
sudo chmod u+w,g+w,o-rwx "$UNOWNED_GROUP"
|
|
|
|
sudo chown $USER "$UNOWNED_GROUP"
|