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

Function kern_fchmodat

freebsd/kern/vfs_syscalls.c:2867–2884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2865}
2866
2867int
2868kern_fchmodat(struct thread *td, int fd, const char *path,
2869 enum uio_seg pathseg, mode_t mode, int flag)
2870{
2871 struct nameidata nd;
2872 int error;
2873
2874 AUDIT_ARG_MODE(mode);
2875 NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_SYMLINK_NOFOLLOW |
2876 AT_RESOLVE_BENEATH) | AUDITVNODE1, pathseg, path, fd,
2877 &cap_fchmod_rights, td);
2878 if ((error = namei(&nd)) != 0)
2879 return (error);
2880 NDFREE_NOTHING(&nd);
2881 error = setfmode(td, td->td_ucred, nd.ni_vp, mode);
2882 vrele(nd.ni_vp);
2883 return (error);
2884}
2885
2886/*
2887 * Change mode of a file given a file descriptor.

Callers 3

sys_chmodFunction · 0.85
sys_fchmodatFunction · 0.85
sys_lchmodFunction · 0.85

Calls 5

at2cnpflagsFunction · 0.85
nameiFunction · 0.85
NDFREE_NOTHINGFunction · 0.85
setfmodeFunction · 0.85
vreleFunction · 0.70

Tested by

no test coverage detected