4 # Simple permission check on hard links.
6 # Overlayfs had a bug that hardlinks don't share inode, if chmod/chown/etc.
7 # is performed on one of the links then the inode belonging to the other
8 # one won't be updated. The following patch fixed this issue
10 # 51f7e52 ovl: share inode for hard link
12 #-----------------------------------------------------------------------
13 # Copyright (c) 2016 Red Hat Inc. All Rights Reserved.
15 # This program is free software; you can redistribute it and/or
16 # modify it under the terms of the GNU General Public License as
17 # published by the Free Software Foundation.
19 # This program is distributed in the hope that it would be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with this program; if not, write the Free Software Foundation,
26 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 #-----------------------------------------------------------------------
31 seqres=$RESULT_DIR/$seq
32 echo "QA output created by $seq"
36 status=1 # failure is the default!
37 trap "_cleanup; exit \$status" 0 1 2 3 15
45 # get standard environment, filters and checks
49 # remove previous $seqres.full before test
52 # real QA test starts here
54 _supported_os IRIX Linux
58 # Setup testfile and its hardlink
59 testfile=$TEST_DIR/testfile.$seq
60 testlink=$testfile.hardlink
61 rm -f $testfile $testlink
62 echo "You should not see this" >$testfile
63 ln $testfile $testlink
65 # remove read permission from testfile and unprivileged user should have no
66 # permission to read testfile and hardlink
68 _user_do "cat $testfile"
69 _user_do "cat $testlink"