Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksa Sarai <asarai@suse.de>
  • Loading branch information
cyphar committed Feb 19, 2019
1 parent 1923297 commit 786c672
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libcontainer/nsenter/cloned_binary.c
Expand Up @@ -261,7 +261,7 @@ static int make_execfd(int *fdtype, int allowed)
if (*fdtype & allowed) {
fd = mkostemp(template, O_CLOEXEC);
if (fd >= 0) {
if (!unlink(template))
if (unlink(template) >= 0)
return fd;
close(fd);
}
Expand Down Expand Up @@ -314,7 +314,7 @@ static int clone_binary(void)
allowed &= ~EFD_MEMFD;

memfd = make_execfd(&fdtype, allowed);
if (memfd < 0)
if (memfd < 0 || fdtype == EFD_NONE)
return -ENOTRECOVERABLE;

binfd = open("/proc/self/exe", O_RDONLY | O_CLOEXEC);
Expand Down

0 comments on commit 786c672

Please sign in to comment.