2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat Inc. All Rights Reserved.
7 # Simple permission check on hard links.
9 # Overlayfs had a bug that hardlinks don't share inode, if chmod/chown/etc.
10 # is performed on one of the links then the inode belonging to the other
11 # one won't be updated. The following patch fixed this issue
13 # 51f7e52 ovl: share inode for hard link
16 seqres=$RESULT_DIR/$seq
17 echo "QA output created by $seq"
21 status=1 # failure is the default!
22 trap "_cleanup; exit \$status" 0 1 2 3 15
30 # get standard environment, filters and checks
34 # remove previous $seqres.full before test
37 # real QA test starts here
43 # Setup testfile and its hardlink
44 testfile=$TEST_DIR/testfile.$seq
45 testlink=$testfile.hardlink
46 rm -f $testfile $testlink
47 echo "You should not see this" >$testfile
48 ln $testfile $testlink
50 # remove read permission from testfile and unprivileged user should have no
51 # permission to read testfile and hardlink
53 _user_do "cat $testfile"
54 _user_do "cat $testlink"