RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 13-Aug-2008 18:43:15
Branch: rpm-5_1 Handle: 2008081316431401
Modified files: (Branch: rpm-5_1)
rpm CHANGES
rpm/lib psm.c
Log:
- jbj: lua: don't exit chroot if already within running script.
Summary:
Revision Changes Path
1.2288.2.75 +1 -0 rpm/CHANGES
2.298.2.3 +5 -2 rpm/lib/psm.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.2288.2.74 -r1.2288.2.75 CHANGES
--- rpm/CHANGES 12 Aug 2008 20:29:32 -0000 1.2288.2.74
+++ rpm/CHANGES 13 Aug 2008 16:43:14 -0000 1.2288.2.75
@@ -1,4 +1,5 @@
5.1.4 -> 5.1.5:
+ - jbj: lua: don't exit chroot if already within running script.
- jbj: rescusitate "make check".
- jbj: permit building with older libtool-1.5.26 (back port from HEAD).
- bero: Fix hang when using rpmdsSingle and rpm4compat.h from C++
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/psm.c
============================================================================
$ cvs diff -u -r2.298.2.2 -r2.298.2.3 psm.c
--- rpm/lib/psm.c 22 May 2008 20:50:15 -0000 2.298.2.2
+++ rpm/lib/psm.c 13 Aug 2008 16:43:15 -0000 2.298.2.3
@@ -531,6 +531,7 @@
rpmlua lua = NULL; /* Global state. */
rpmluav var;
int * ssp = NULL;
+ int inChroot = 0; /* Are we already in a chroot? */
if (psm->sstates != NULL)
ssp = psm->sstates + tag2slx(psm->scriptTag);
@@ -548,6 +549,7 @@
/* Get into the chroot. */
if (!rpmtsChrootDone(ts)) {
+ inChroot = 0;
const char *rootDir = rpmtsRootDir(ts);
/*@-modobserver @*/
if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') {
@@ -555,7 +557,8 @@
/*@=modobserver @*/
xx = rpmtsSetChrootDone(ts, 1);
}
- }
+ } else
+ inChroot = 1;
/* All lua scripts run with CWD == "/". */
xx = Chdir("/");
@@ -605,7 +608,7 @@
rpmluaDelVar(lua, "arg");
/* Get out of chroot. */
- if (rpmtsChrootDone(ts)) {
+ if (rpmtsChrootDone(ts) && !inChroot) {
const char *rootDir = rpmtsRootDir(ts);
xx = fchdir(rootFdno);
/*@-modobserver@*/
@@ .
Received on Wed Aug 13 18:43:15 2008