]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-scripts-closefds.patch
- updated x32 patch
[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                 Fclose(fd);
5                 fd = NULL;
6             }
7 -       } else
8 +       } else {
9 +           long oldfl;
10             fd = fdLink(fd);
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         return (void *)fd;
18         break;
19  
This page took 0.023463 seconds and 3 git commands to generate.