From 4816885ff16f345a6e3c35cbfce66fedc724eeb0 Mon Sep 17 00:00:00 2001 From: pjd Date: Tue, 25 Sep 2012 20:59:12 +0000 Subject: [PATCH] Require CAP_CREATE on directory descriptor for symlinkat(2). Sponsored by: FreeBSD Foundation MFC after: 2 weeks --- sys/kern/vfs_syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index c9a28d4b5a2e..f6e38938b3d1 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1719,8 +1719,8 @@ kern_symlinkat(struct thread *td, char *path1, int fd, char *path2, AUDIT_ARG_TEXT(syspath); restart: bwillwrite(); - NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, - segflg, path2, fd, td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | + AUDITVNODE1, segflg, path2, fd, CAP_CREATE, td); if ((error = namei(&nd)) != 0) goto out; vfslocked = NDHASGIANT(&nd);