diff options
author | pjd <pjd@FreeBSD.org> | 2012-09-25 20:58:15 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2012-09-25 20:58:15 +0000 |
commit | 5ca6c6bd61d591677610ab46457d1a07f70e469e (patch) | |
tree | b9bc832603b8b381c63c4bf070123fbd3846deaf /sys/kern | |
parent | 76c124139fab4f40b1949989f2ea84b3c11ad84c (diff) | |
download | FreeBSD-src-5ca6c6bd61d591677610ab46457d1a07f70e469e.zip FreeBSD-src-5ca6c6bd61d591677610ab46457d1a07f70e469e.tar.gz |
Require CAP_CREATE on directory descriptor for linkat(2).
Sponsored by: FreeBSD Foundation
MFC after: 2 weeks
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index e518d58..c9a28d4 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1622,8 +1622,8 @@ kern_linkat(struct thread *td, int fd1, int fd2, char *path1, char *path2, VFS_UNLOCK_GIANT(vfslocked); return (error); } - NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE2, - segflg, path2, fd2, td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | + AUDITVNODE2, segflg, path2, fd2, CAP_CREATE, td); if ((error = namei(&nd)) == 0) { lvfslocked = NDHASGIANT(&nd); if (nd.ni_vp != NULL) { |