poldek -r broken again?

Przemyslaw Iskra sparky at pld-linux.org
Sun May 2 21:14:36 CEST 2010


On Sun, May 02, 2010 at 02:57:39PM -0400, Jeff Johnson wrote:
> 
> > chroot(".")                             = 0
> >  -- chroots back to /tmp !
> >     This way /tmp becomes new root.
> > 
> 
> ... which re-establishes the cwd before embedded lua was run.

It also establishes /tmp as new /, so now when you use path:
/tmp/rpm/something it points to /tmp/tmp/rpm/something in real root.


Please, google for "breaking out of chroot", some of those tutorials
are nicely explained.

> My guess is that you want a deterministic chdir("/") when running
> opaque embedded lua scripts. You certainly can do chdir("/") within
> the lua script if you wish.
> 
> The disagreement seems largely to be what you expect RPM to do vs. what
> should be done in embedded scriptlets. And there's truly so few embedded
> scripts in *.rpm that noone (certainly not me) has ever tried
> to pin down the execution environment precisely.

I have no idea why it doesn't work in this case, but works in all
others. Are %post and %pre scripts run as separate processes ?

> > To exit chroot it should fchdir to old /, chroot there, and
> > fchdir to old working directory.
> > 
> 
> And your old working directory is (in fact) /tmp which was restored by fchdir(2).

/tmp also becomes new /, which brakes full paths (ones starting with /).


-- 
 ____  Sparky{PI] -- Przemyslaw _  ___  _  _  ........... LANG...Pl..Ca..Es..En
/____) ___  ___  _ _ || Iskra  |  | _ \| |  | : WWW........ppcrcd.pld-linux.org
\____\| -_)'___| ||^'||//\\// <   |  _/| |  | : JID......sparky<at>jabberes.org
(____/||   (_-_|_||  ||\\ ||   |_ |_|  |_| _| : Mail....sparky<at>pld-linux.org


More information about the pld-devel-en mailing list