Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163585277
D57188.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
D57188.diff
View Options
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -3483,11 +3483,13 @@
}
static bool
-restrict_rights(struct file *fp, struct thread *td)
+restrict_rights(struct filedescent *fde, struct thread *td)
{
struct prison *prison1, *prison2;
- prison1 = fp->f_cred->cr_prison;
+ if ((fde->fde_flags & UF_RESOLVE_BENEATH) != 0)
+ return (true);
+ prison1 = fde->fde_file->f_cred->cr_prison;
prison2 = td->td_ucred->cr_prison;
return (prison1 != prison2 && prison1->pr_root != prison2->pr_root &&
prison2 != &prison0);
@@ -3557,7 +3559,7 @@
fp = fdep[i]->fde_file;
_finstall(fdesc, fp, *fdp, fdflags |
- (restrict_rights(fp, td) ?
+ (restrict_rights(fdep[i], td) ?
O_RESOLVE_BENEATH : 0), &fdep[i]->fde_caps);
unp_externalize_fp(fp);
}
@@ -3794,6 +3796,7 @@
fdep[i]->fde_file = fde->fde_file;
filecaps_copy(&fde->fde_caps,
&fdep[i]->fde_caps, true);
+ fdep[i]->fde_flags = fde->fde_flags;
unp_internalize_fp(fdep[i]->fde_file);
}
FILEDESC_SUNLOCK(fdesc);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 25, 5:42 PM (20 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33455953
Default Alt Text
D57188.diff (1 KB)
Attached To
Mode
D57188: unix: Preserve FD_RESOLVE_BENEATH when passing an fd
Attached
Detach File
Event Timeline
Log In to Comment