--- rpm-4.16.0/lib/rpminstall.c.orig 2020-05-28 12:04:25.040136702 +0200 +++ rpm-4.16.0/lib/rpminstall.c 2020-10-03 09:46:49.369707250 +0200 @@ -4,6 +4,8 @@ #include "system.h" +#include + #include #include #include /* rpmReadPackageFile, vercmp etc */ @@ -114,8 +116,15 @@ Fclose(fd); fd = NULL; } - } else + } else { + long oldfl; 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); + } + } return (void *)fd; break;