summaryrefslogtreecommitdiffstats
path: root/qa/workunits/fs/misc/dac_override.sh
blob: dfb1a909128dae2b2fe63f1953fae7741ca5705b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh -x

expect_failure() {
	if "$@"; then return 1; else return 0; fi
}

set -e

mkdir -p testdir
file=test_chmod.$$

echo "foo" > testdir/${file}
sudo chmod 600 testdir

# only root can read
expect_failure cat testdir/${file}

# directory read/write DAC override for root should allow read
sudo cat testdir/${file}