File: setup-document-saver.sh

package info (click to toggle)
pluma 1.28.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,932 kB
  • sloc: ansic: 51,222; python: 6,822; xml: 3,421; makefile: 923; sh: 102; perl: 78
file content (27 lines) | stat: -rw-r--r-- 668 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

# This script is used to setup some special directory structures, permissions
# for the saver test

UNOWNED_DIRECTORY="/tmp/pluma-document-saver-unowned"
UNOWNED_FILE="/tmp/pluma-document-saver-unowned/pluma-document-saver-test.txt"

UNOWNED_GROUP="/tmp/pluma-document-saver-unowned-group.txt"

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"