aboutsummaryrefslogtreecommitdiffstats
path: root/test/test-umask.sh
blob: e4e366b527f588b933ffc50ea02f682164d00158 (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
35
36
37
#!/bin/bash
#
# SPDX-License-Identifier: LGPL-2.1-only
#

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