Why 'fallocate' clear the file's SUID flag?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I found that the 'xfs_update_prealloc_flags' function is called
during the ‘fallocate’ syscall and the SUID flag is cleared
when the 'XFS_PREALLOC_INVISIBLE' flag is not set.
I am a beginner and have some questions about it.

1. What does XFS_PREALLOC_INVISIBLE mean and
why should the SUID flag be cleared
when XFS_PREALLOC_INVISIBLE is not set?

2. The behavior of XFS in handling the fallocate syscall is
a bit strange and not quite the same as other file systems,
such as ext4 and btrfs.

Here is an example:
foo is a normal file.
chmod set the SUID and SGID flag.
The last two parameters of fallocate are irrelevant to this problem.
After running, ext4 and btrfs set mode o6000, but xfs set mode o2000.
```
int fd = open("foo", 2, 0);
chmod("foo", o6000);
fallocate(fd, 3, 6549, 1334);
fsync(fd);
```

Can you give me some help?

Best wishes.




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux