]>
Commit | Line | Data |
---|---|---|
3dbbfd10 JB |
1 | diff -Nur rpm-4.0.2.orig/lib/rpminstall.c rpm-4.0.2/lib/rpminstall.c |
2 | --- rpm-4.0.2.orig/lib/rpminstall.c Sat Feb 10 15:07:16 2001 | |
3 | +++ rpm-4.0.2/lib/rpminstall.c Sun Sep 9 00:33:52 2001 | |
4 | @@ -87,6 +87,13 @@ | |
5 | case RPMCALLBACK_INST_OPEN_FILE: | |
6 | fd = Fopen(filename, "r.ufdio"); | |
7 | fd = fdLink(fd, "persist (showProgress)"); | |
8 | + { | |
9 | + int oldfl=Fcntl(fd, F_GETFD, 0); | |
10 | + if(oldfl >= 0) { | |
11 | + oldfl |= FD_CLOEXEC; /* scripts shouldn't inherit rpm file descriptor */ | |
12 | + Fcntl(fd, F_SETFD, oldfl); | |
13 | + } | |
14 | + } | |
15 | return fd; | |
16 | ||
17 | case RPMCALLBACK_INST_CLOSE_FILE: | |
18 | diff -Nur rpm-4.0.2.orig/lib/uninstall.c rpm-4.0.2/lib/uninstall.c | |
19 | --- rpm-4.0.2.orig/lib/uninstall.c Mon Jan 22 16:59:13 2001 | |
20 | +++ rpm-4.0.2/lib/uninstall.c Sat Sep 8 23:58:22 2001 | |
21 | @@ -388,6 +388,9 @@ | |
22 | if (Fileno(ts->scriptFd) > STDERR_FILENO) { | |
23 | Fclose (ts->scriptFd); | |
24 | } | |
25 | + } else { | |
26 | + if (Fileno(out) > STDERR_FILENO) | |
27 | + Fclose (out); | |
28 | } | |
29 | ||
30 | { const char *ipath = rpmExpand("PATH=%{_install_script_path}", NULL); |