| 2737 | } |
| 2738 | |
| 2739 | static int |
| 2740 | kern_chflagsat(struct thread *td, int fd, const char *path, |
| 2741 | enum uio_seg pathseg, u_long flags, int atflag) |
| 2742 | { |
| 2743 | struct nameidata nd; |
| 2744 | int error; |
| 2745 | |
| 2746 | AUDIT_ARG_FFLAGS(flags); |
| 2747 | NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(atflag, AT_SYMLINK_NOFOLLOW | |
| 2748 | AT_RESOLVE_BENEATH) | AUDITVNODE1, pathseg, path, fd, |
| 2749 | &cap_fchflags_rights, td); |
| 2750 | if ((error = namei(&nd)) != 0) |
| 2751 | return (error); |
| 2752 | NDFREE_NOTHING(&nd); |
| 2753 | error = setfflags(td, nd.ni_vp, flags); |
| 2754 | vrele(nd.ni_vp); |
| 2755 | return (error); |
| 2756 | } |
| 2757 | |
| 2758 | /* |
| 2759 | * Change flags of a file given a file descriptor. |
no test coverage detected