diff options
author | jilles <jilles@FreeBSD.org> | 2015-04-04 21:47:54 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2015-04-04 21:47:54 +0000 |
commit | 308eebbd5279282c90e55ee7f684a7f62a7a24c1 (patch) | |
tree | 56404244506c2cb0568991a8c22e51c2cc2b4003 | |
parent | e636228296406069e15eb7958a48ccd2341701fc (diff) | |
download | FreeBSD-src-308eebbd5279282c90e55ee7f684a7f62a7a24c1.zip FreeBSD-src-308eebbd5279282c90e55ee7f684a7f62a7a24c1.tar.gz |
utimensat: Correct Capsicum required capability rights.
-rw-r--r-- | sys/kern/vfs_syscalls.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 14be379..76a540f 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -3294,6 +3294,7 @@ kern_utimensat(struct thread *td, int fd, char *path, enum uio_seg pathseg, { struct nameidata nd; struct timespec ts[2]; + cap_rights_t rights; int error, flags; if (flag & ~AT_SYMLINK_NOFOLLOW) @@ -3301,8 +3302,9 @@ kern_utimensat(struct thread *td, int fd, char *path, enum uio_seg pathseg, if ((error = getutimens(tptr, tptrseg, ts, &flags)) != 0) return (error); - NDINIT_AT(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : - FOLLOW) | AUDITVNODE1, pathseg, path, fd, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : + FOLLOW) | AUDITVNODE1, pathseg, path, fd, + cap_rights_init(&rights, CAP_FUTIMES), td); if ((error = namei(&nd)) != 0) return (error); /* |