aboutsummaryrefslogtreecommitdiffstats
path: root/test/test-umask.sh
blob: 8ca49637631737f70a70e8cafad4ad1a3a82aa3e (plain)
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
28
29
30
31
32
33
34
#!/bin/bash

mode() {
	ls -l "$1" | awk '{ print $1 }'
}

rm -f a b

# Verify normal operation...
umask 022
touch a
umask 0
touch b

case $(mode a) in
-rw-r--r--*)	;;
*)	exit 1;;
esac
case $(mode b) in
-rw-rw-rw-*)	;;
*)	exit 1;;
esac

export PSEUDO_DISABLED=1

case $(mode a) in
-rw-r--r--*)	;;
*)	exit 1;;
esac
case $(mode b) in
-rw-r--r--*)	;;
*)	exit 1;;
esac