[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    Re: [OE-core] [PATCH] rpm: Avoid leaking temporary scriplet files
From:       Alexander Kanavin <alex.kanavin () gmail ! com>
Date:       2018-06-30 6:37:07
Message-ID: CANNYZj_t-68JsYddLZDu+8JMBCDggtNLKEEMFLpafDFfwn1WgQ () mail ! gmail ! com
[Download RAW message or body]

2018-06-30 1:53 GMT+02:00 Olof Johansson <olof.johansson@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
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic