]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-scripts-closefds.patch
- up to 4.16.0
[packages/rpm.git] / rpm-scripts-closefds.patch
CommitLineData
24b1f498
JR
1--- rpm-4.16.0/lib/rpminstall.c.orig 2020-05-28 12:04:25.040136702 +0200
2+++ rpm-4.16.0/lib/rpminstall.c 2020-10-03 09:46:49.369707250 +0200
3@@ -4,6 +4,8 @@
4
5 #include "system.h"
6
7+#include <fcntl.h>
8+
9 #include <rpm/rpmcli.h>
10 #include <rpm/rpmtag.h>
11 #include <rpm/rpmlib.h> /* rpmReadPackageFile, vercmp etc */
12@@ -114,8 +116,15 @@
6ecfe7c2 13 Fclose(fd);
5b0f0ac9 14 fd = NULL;
3dbbfd10 15 }
5b0f0ac9 16- } else
3dbbfd10 17+ } else {
7c316649 18+ long oldfl;
6ecfe7c2 19 fd = fdLink(fd);
5b0f0ac9
MM
20+ oldfl=Fcntl(fd, F_GETFD, 0);
21+ if(oldfl >= 0) {
22+ oldfl |= FD_CLOEXEC; /* scripts shouldn't inherit rpm file descriptor */
7c316649 23+ Fcntl(fd, F_SETFD, (void*)oldfl);
5b0f0ac9
MM
24+ }
25+ }
6ecfe7c2
JR
26 return (void *)fd;
27 break;
751668e8 28
This page took 0.075177 seconds and 4 git commands to generate.