[OE-core] [PATCH] rpm: Avoid leaking temporary scriplet files

Alexander Kanavin alex.kanavin at gmail.com
Sat Jun 30 06:37:07 UTC 2018


2018-06-30 1:53 GMT+02:00 Olof Johansson <olof.johansson at axis.com>:
>> As scriptlets are executed outside of rpm's chroot, they are being
>> written into system's /var/tmp, not rootfs's. This patch should
>> probably be amended to prepend the rootfs path when scriptlets are
>> written out, and then we should be sorted.
>
> Is that not a more invasive change than just removing the tmp
> files unconditionally (especially in terms of maintainability)?
> I'm not even sure how exactly to do that, but I'm obviously
> missing something. For instance, is there a way to manipulate the
> global rpmMacroContext temporarily?

Removing the tmp files unconditionally is a *workaround* for the fact
that they are written into an incorrect location, due to a different
patch removing the use of chroots (so that scriptlets can use native
tools in a cross-install situation), but not amending temporary
scriptlet file paths otherwise. The correct location would be the
/var/tmp directory inside the rootfs.

The files are created here:

lib/rpmscript.c:    FD_t fd = rpmMkTempFile("/", &fn);

Ideally, "/" should've been replaced with rpmtsRootDir(ts), but ts is
not accessible from the function, or from its parent, or parent
parent. So yes, I concede this would be too invasive to pass that down
the call stack. So if you can amend the above patch of mine with your
change, commit message, and SOB, that should be best. These changes
really belong together, as a custom fix for the oe build environment.

Alex



More information about the Openembedded-core mailing list