MCPcopy Create free account
hub / github.com/F-Stack/f-stack / change_dir

Function change_dir

freebsd/kern/vfs_syscalls.c:1005–1021  ·  view source on GitHub ↗

* Common routine for chroot and chdir. Callers must provide a locked vnode * instance. */

Source from the content-addressed store, hash-verified

1003 * instance.
1004 */
1005int
1006change_dir(struct vnode *vp, struct thread *td)
1007{
1008#ifdef MAC
1009 int error;
1010#endif
1011
1012 ASSERT_VOP_LOCKED(vp, "change_dir(): vp not locked");
1013 if (vp->v_type != VDIR)
1014 return (ENOTDIR);
1015#ifdef MAC
1016 error = mac_vnode_check_chdir(td->td_ucred, vp);
1017 if (error != 0)
1018 return (error);
1019#endif
1020 return (VOP_ACCESS(vp, VEXEC, td->td_ucred, td));
1021}
1022
1023static __inline void
1024flags_to_rights(int flags, cap_rights_t *rightsp)

Callers 4

do_jail_attachFunction · 0.85
sys_fchdirFunction · 0.85
kern_chdirFunction · 0.85
sys_chrootFunction · 0.85

Calls 1

mac_vnode_check_chdirFunction · 0.85

Tested by

no test coverage detected