Page MenuHomeFreeBSD

D35410.diff
No OneTemporary

D35410.diff

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
@@ -492,9 +492,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

Mime Type
text/plain
Expires
Thu, Aug 13, 2:32 PM (17 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36590973
Default Alt Text
D35410.diff (678 B)

Event Timeline