poldek -r broken again?

Jeff Johnson n3npq at mac.com
Sun May 2 20:22:03 CEST 2010


On May 2, 2010, at 2:11 PM, Przemyslaw Iskra wrote:

> On Sun, May 02, 2010 at 05:38:14PM +0200, Paweł Zuzelski wrote:
>> or I'm missing something?
>> 
>> mkdir /th
>> poldek --update --upa
>> rpm --initdb -r /th
>> poldek -r /th
>> poldek> install geninitrd
>> (...)
>> error: open of /root/tmp/poldek-cache-root/http_ftp.sk.pld-linux.org.dists.th.PLD.i686.RPMS/ldconfig-2.11.1-5.i686.rpm failed: No such file or directory
>> error: open of /root/tmp/poldek-cache-root/http_ftp.sk.pld-linux.org.dists.th.PLD.i686.RPMS/filesystem-3.0-34.i686.rpm failed: No such file or directory
> ^^^
> This part exactly:
> 
> %if "%{pld_release}" != "ac"
> %pretrans -p <lua>
> -- this needs to be a dir
> if posix.stat("/usr/include/X11", "type") == "link" then
> 	-- feel free to write in pure lua, but success on first install is not important.
> 	os.execute("umask 022; mv -f /usr/include/X11{,.rpmsave}; mkdir -m755 -p /usr/include/X11 && mv -f /usr/include/X11.rpmsave/*
> /usr/include/X11")
> end
> %endif
> 
> Makes rpm lose track of current root directory. That is, it is unnable
> to exit the chroot correctly before continuing instalation.
> 

Well the actual details aren't quite that simple even if the
flaw is (demonstrably and de facto) associated with using embedded
lua in %posttrans in the fhs package.

RPM for quite some years now (patch originally was from SuSE)
opens's the root directory, runs embedded lua, and then does fchdir(2)
to restore the root directory after lua is through doing whatever.

I haven't looked at rpm-4.5 for some years, but there's only a
single instance where fchdir(2) is used in RPM code so it should
not be hard to find.

73 de Jeff


More information about the pld-devel-en mailing list