Require CAP_DELETE on directory descriptor for unlinkat(2).
Sponsored by: FreeBSD Foundation MFC after: 2 weeks
This commit is contained in:
parent
4816885ff1
commit
1d5d62ac36
@ -1881,8 +1881,8 @@ kern_unlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg,
|
||||
|
||||
restart:
|
||||
bwillwrite();
|
||||
NDINIT_AT(&nd, DELETE, LOCKPARENT | LOCKLEAF | MPSAFE | AUDITVNODE1,
|
||||
pathseg, path, fd, td);
|
||||
NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | MPSAFE |
|
||||
AUDITVNODE1, pathseg, path, fd, CAP_DELETE, td);
|
||||
if ((error = namei(&nd)) != 0)
|
||||
return (error == EINVAL ? EPERM : error);
|
||||
vfslocked = NDHASGIANT(&nd);
|
||||
|
Loading…
Reference in New Issue
Block a user