File: test-umask.sh

package info (click to toggle)
pseudo 1.8.1%2Bgit20161012-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,804 kB
  • ctags: 927
  • sloc: ansic: 11,729; sh: 760; python: 749; makefile: 158
file content (32 lines) | stat: -rwxr-xr-x 354 bytes parent folder | download
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
#!/bin/bash

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

# 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