Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144328495
D35410.id106661.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
678 B
Referenced Files
None
Subscribers
None
D35410.id106661.diff
View Options
diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c
--- a/sys/fs/fdescfs/fdesc_vnops.c
+++ b/sys/fs/fdescfs/fdesc_vnops.c
@@ -519,9 +519,15 @@
/*
* Allow setattr where there is an underlying vnode.
+ * For O_PATH descriptors, disallow truncate.
*/
- error = getvnode(td, fd,
- cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp);
+ if (vap->va_size != VNOVAL) {
+ error = getvnode(td, fd,
+ cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp);
+ } else {
+ error = getvnode_path(td, fd,
+ cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp);
+ }
if (error) {
/*
* getvnode() returns EINVAL if the file descriptor is not
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 8, 9:16 PM (12 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28498580
Default Alt Text
D35410.id106661.diff (678 B)
Attached To
Mode
D35410: fdescfs: allow chown/utime etc on fdescfs fd for underlying files opened with O_PATH
Attached
Detach File
Event Timeline
Log In to Comment