Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156728778
D39020.id118909.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D39020.id118909.diff
View Options
diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c
--- a/sys/fs/tarfs/tarfs_vfsops.c
+++ b/sys/fs/tarfs/tarfs_vfsops.c
@@ -515,12 +515,12 @@
/* get standard attributes */
num = tarfs_str2int64(hdrp->mode, sizeof(hdrp->mode));
- if (num < 0 || num > ALLPERMS) {
+ if (num < 0 || num > (S_IFMT|ALLPERMS)) {
TARFS_DPF(ALLOC, "%s: invalid file mode at %zu\n",
__func__, TARFS_BLOCKSIZE * (blknum - 1));
mode = S_IRUSR;
} else {
- mode = num;
+ mode = num & ALLPERMS;
}
num = tarfs_str2int64(hdrp->uid, sizeof(hdrp->uid));
if (num < 0 || num > UID_MAX) {
diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh
--- a/tests/sys/fs/tarfs/tarfs_test.sh
+++ b/tests/sys/fs/tarfs/tarfs_test.sh
@@ -59,6 +59,7 @@
atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/short_link)"
atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/long_link)"
atf_check_equal "$(sha256 -q "${mnt}"/sparse_file)" ${sum}
+ atf_check_equal "$(stat -f%p "${mnt}"/sparse_file)" 100644
atf_check_equal "$(stat -f%l "${mnt}"/sparse_file)" 2
atf_check_equal "$(stat -f%l "${mnt}"/hard_link)" 2
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 11:16 PM (44 m, 2 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33147115
Default Alt Text
D39020.id118909.diff (1 KB)
Attached To
Mode
D39020: tarfs: Support tar files which include file modes with permissions.
Attached
Detach File
Event Timeline
Log In to Comment