]> git.pld-linux.org Git - packages/rpm.git/blame_incremental - rpm-scripts-closefds.patch
add support for %{arm}
[packages/rpm.git] / rpm-scripts-closefds.patch
... / ...
CommitLineData
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 @@
13 Fclose(fd);
14 fd = NULL;
15 }
16- } else
17+ } else {
18+ long oldfl;
19 fd = fdLink(fd);
20+ oldfl=Fcntl(fd, F_GETFD, 0);
21+ if(oldfl >= 0) {
22+ oldfl |= FD_CLOEXEC; /* scripts shouldn't inherit rpm file descriptor */
23+ Fcntl(fd, F_SETFD, (void*)oldfl);
24+ }
25+ }
26 return (void *)fd;
27 break;
28
This page took 0.027399 seconds and 4 git commands to generate.