]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-lua-exit-chroot-correctly.patch
- compress debuginfo sections with zlib (reduce /usr/lib/debug size).
[packages/rpm.git] / rpm-lua-exit-chroot-correctly.patch
1 --- rpm-4.5/lib/psm.c   2010-05-08 14:14:22.817080224 +0200
2 +++ rpm-4.5/lib/psm.c   2010-05-08 14:14:03.063343062 +0200
3 @@ -469,6 +469,7 @@
4         /*@modifies psm, fileSystem, internalState @*/
5  {
6      const rpmts ts = psm->ts;
7 +    int pwdFdno = -1;
8      int rootFdno = -1;
9      const char *n, *v, *r;
10      rpmRC rc = RPMRC_OK;
11 @@ -487,9 +488,12 @@
12  
13      /* Save the current working directory. */
14  /*@-nullpass@*/
15 -    rootFdno = open(".", O_RDONLY, 0);
16 +    pwdFdno = open(".", O_RDONLY, 0);
17  /*@=nullpass@*/
18  
19 +    /* Save the current root directory. */
20 +    rootFdno = open("/", O_RDONLY, 0);
21 +
22      /* Get into the chroot. */
23      if (!rpmtsChrootDone(ts)) {
24         const char *rootDir = rpmtsRootDir(ts);
25 @@ -554,10 +558,12 @@
26         /*@=superuser =noeffect @*/
27             xx = rpmtsSetChrootDone(ts, 0);
28         }
29 +       xx = fchdir(pwdFdno);
30      } else
31 -       xx = fchdir(rootFdno);
32 +       xx = fchdir(pwdFdno);
33  
34      xx = close(rootFdno);
35 +    xx = close(pwdFdno);
36  
37      return rc;
38  }
This page took 0.025086 seconds and 3 git commands to generate.