Page MenuHomeFreeBSD

D35410.id106661.diff
No OneTemporary

D35410.id106661.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
@@ -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

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)

Event Timeline