X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm.git;a=blobdiff_plain;f=rpm-scripts-closefds.patch;h=84c3d298360b79ee3a61124d10287a2c24e1a325;hp=98a95cc9f054dfcb6f732eb022068153e867f24b;hb=7d12560fd069642deb3d3a719ba6b44159768e79;hpb=7c316649510c4959c4df996c25934e3f914a22d0 diff --git a/rpm-scripts-closefds.patch b/rpm-scripts-closefds.patch index 98a95cc..84c3d29 100644 --- a/rpm-scripts-closefds.patch +++ b/rpm-scripts-closefds.patch @@ -1,19 +1,19 @@ --- rpm-4.1/lib/rpminstall.c.wiget Mon Sep 16 21:06:08 2002 +++ rpm-4.1/lib/rpminstall.c Thu Sep 19 00:03:36 2002 @@ -126,8 +126,15 @@ - xx = Fclose(fd); + Fclose(fd); fd = NULL; } - } else + } else { + long oldfl; - fd = fdLink(fd, "persist (showProgress)"); + fd = fdLink(fd); + oldfl=Fcntl(fd, F_GETFD, 0); + if(oldfl >= 0) { + oldfl |= FD_CLOEXEC; /* scripts shouldn't inherit rpm file descriptor */ + Fcntl(fd, F_SETFD, (void*)oldfl); + } + } - /*@=type@*/ - return fd; - /*@notreached@*/ break; + return (void *)fd; + break; +