1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

s3:modules: VFS CAP symlinkat always fails

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14941

Found by covscan.

Since capnew is initialized by NULL, checking it too early makes the
rest of the function a dead code.

Pair-programmed-with: Andreas Schneider <asn@samba.org>

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 41ebb7f68c5b21492f503afc4cb341a97654a43d)

Autobuild-User(v4-15-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-15-test): Wed Jan 12 12:43:05 UTC 2022 on sn-devel-184
This commit is contained in:
Pavel Filipenský 2022-01-07 13:55:38 +01:00 committed by Jule Anger
parent 76e7fdb70c
commit 680f68a072

View File

@ -448,7 +448,7 @@ static int cap_symlinkat(vfs_handle_struct *handle,
int saved_errno = 0;
int ret;
if (!capold || !capnew) {
if (capold == NULL) {
errno = ENOMEM;
return -1;
}