]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-scripts-closefds.patch
- use DSA for package signatures for temporary compatibility with antique crap
[packages/rpm.git] / rpm-scripts-closefds.patch
1 --- rpm-4.1/lib/rpminstall.c.wiget      Mon Sep 16 21:06:08 2002
2 +++ rpm-4.1/lib/rpminstall.c    Thu Sep 19 00:03:36 2002
3 @@ -126,8 +126,15 @@
4                 xx = Fclose(fd);
5                 fd = NULL;
6             }
7 -       } else
8 +       } else {
9 +           long oldfl;
10             fd = fdLink(fd, "persist (showProgress)");
11 +           oldfl=Fcntl(fd, F_GETFD, 0);
12 +           if(oldfl >= 0) {
13 +               oldfl |= FD_CLOEXEC; /* scripts shouldn't inherit rpm file descriptor */
14 +               Fcntl(fd, F_SETFD, (void*)oldfl);
15 +           }
16 +       }
17  
18  #if defined(POSIX_FADV_WILLNEED)
19         (void) Fadvise(fd, 0, 0, POSIX_FADV_WILLNEED);
This page took 0.023152 seconds and 3 git commands to generate.