Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/vfs_syscalls.c
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
#include <security/audit/audit.h> | #include <security/audit/audit.h> | ||||
#include <security/mac/mac_framework.h> | #include <security/mac/mac_framework.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_object.h> | #include <vm/vm_object.h> | ||||
#include <vm/vm_page.h> | #include <vm/vm_page.h> | ||||
#include <vm/uma.h> | #include <vm/uma.h> | ||||
#include <fs/devfs/devfs.h> | |||||
#include <ufs/ufs/quota.h> | #include <ufs/ufs/quota.h> | ||||
MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); | MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); | ||||
static int kern_chflagsat(struct thread *td, int fd, const char *path, | static int kern_chflagsat(struct thread *td, int fd, const char *path, | ||||
enum uio_seg pathseg, u_long flags, int atflag); | enum uio_seg pathseg, u_long flags, int atflag); | ||||
static int setfflags(struct thread *td, struct vnode *, u_long); | static int setfflags(struct thread *td, struct vnode *, u_long); | ||||
static int getutimes(const struct timeval *, enum uio_seg, struct timespec *); | static int getutimes(const struct timeval *, enum uio_seg, struct timespec *); | ||||
▲ Show 20 Lines • Show All 4,110 Lines • ▼ Show 20 Lines | #endif | ||||
error = VOP_GETATTR(vp, &vattr, td->td_ucred); | error = VOP_GETATTR(vp, &vattr, td->td_ucred); | ||||
if (error != 0) | if (error != 0) | ||||
goto out; | goto out; | ||||
if (td->td_ucred->cr_uid != vattr.va_uid) { | if (td->td_ucred->cr_uid != vattr.va_uid) { | ||||
error = priv_check(td, PRIV_VFS_ADMIN); | error = priv_check(td, PRIV_VFS_ADMIN); | ||||
if (error != 0) | if (error != 0) | ||||
goto out; | goto out; | ||||
} | } | ||||
if (vp->v_usecount > 1 || vcount(vp) > 1) | if (devfs_usecount(vp) > 0) | ||||
VOP_REVOKE(vp, REVOKEALL); | VOP_REVOKE(vp, REVOKEALL); | ||||
out: | out: | ||||
vput(vp); | vput(vp); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* Convert a user file descriptor to a kernel file entry and check that, if it | * Convert a user file descriptor to a kernel file entry and check that, if it | ||||
▲ Show 20 Lines • Show All 684 Lines • Show Last 20 Lines |