packages: rpm/rpm-lua-exit-chroot-correctly.patch (NEW) - chroot back to ol...

sparky sparky at pld-linux.org
Sat May 8 14:32:07 CEST 2010


Author: sparky                       Date: Sat May  8 12:32:07 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- chroot back to old root, not to old pwd

---- Files affected:
packages/rpm:
   rpm-lua-exit-chroot-correctly.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/rpm/rpm-lua-exit-chroot-correctly.patch
diff -u /dev/null packages/rpm/rpm-lua-exit-chroot-correctly.patch:1.1
--- /dev/null	Sat May  8 14:32:07 2010
+++ packages/rpm/rpm-lua-exit-chroot-correctly.patch	Sat May  8 14:32:02 2010
@@ -0,0 +1,38 @@
+--- rpm-4.5/lib/psm.c	2010-05-08 14:14:22.817080224 +0200
++++ rpm-4.5/lib/psm.c	2010-05-08 14:14:03.063343062 +0200
+@@ -469,6 +469,7 @@
+ 	/*@modifies psm, fileSystem, internalState @*/
+ {
+     const rpmts ts = psm->ts;
++    int pwdFdno = -1;
+     int rootFdno = -1;
+     const char *n, *v, *r;
+     rpmRC rc = RPMRC_OK;
+@@ -487,9 +488,12 @@
+ 
+     /* Save the current working directory. */
+ /*@-nullpass@*/
+-    rootFdno = open(".", O_RDONLY, 0);
++    pwdFdno = open(".", O_RDONLY, 0);
+ /*@=nullpass@*/
+ 
++    /* Save the current root directory. */
++    rootFdno = open("/", O_RDONLY, 0);
++
+     /* Get into the chroot. */
+     if (!rpmtsChrootDone(ts)) {
+ 	const char *rootDir = rpmtsRootDir(ts);
+@@ -554,10 +558,12 @@
+ 	/*@=superuser =noeffect @*/
+ 	    xx = rpmtsSetChrootDone(ts, 0);
+ 	}
++	xx = fchdir(pwdFdno);
+     } else
+-	xx = fchdir(rootFdno);
++	xx = fchdir(pwdFdno);
+ 
+     xx = close(rootFdno);
++    xx = close(pwdFdno);
+ 
+     return rc;
+ }
================================================================


More information about the pld-cvs-commit mailing list