Tizen 2.0 Release
[external/tizen-coreutils.git] / tests / umask-check
1 # -*- sh -*-
2 # Disable the current test if umask doesn't work as usual.
3
4 # Copyright (C) 2005 Free Software Foundation, Inc.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
19
20 # This test should be run in the temporary directory that ends
21 # up being removed via the trap commands.
22
23 umask 022
24 touch file1 file2
25 chmod 644 file2
26 perms=`ls -l file1 file2 | sed 's/ .*//' | uniq`
27 rm -f file1 file2
28
29 case $perms in
30 *'
31 '*)
32   cat <<EOF >&2
33 $0: Since it looks like you're running this test in a directory with
34 something other than the usual umask semantics, we're skipping this test.
35 EOF
36   (exit 77); exit 77
37 esac