[Rpm-maint] [rpm-software-management/rpm] rpm fails to exit chroot on FreeBSD (#1374)

yuri@FreeBSD notifications at github.com
Sun Sep 27 17:48:20 UTC 2020


```chroot``` fails at this point:
```
149│     /* "refcounted" return from chroot */
150│     if (rootState.chrootDone > 1) {
151│         rootState.chrootDone--;
152│     } else if (rootState.chrootDone == 1) {
153│         rpmlog(RPMLOG_DEBUG, "exiting chroot %s\n", rootState.rootDir);
154├───────> if (chroot(".") == 0 && fchdir(rootState.cwd) == 0) {
155│             rootState.chrootDone = 0;
156│         } else {
157│             rpmlog(RPMLOG_ERR, _("Unable to restore root directory: %m\n"));
158│             rc = -1;
159│         }
160│     }
```

Callstack:
```
(gdb) bt
#0  chroot () at chroot.S:3
#1  0x00000008026ec6da in rpmChrootOut () at rpmchroot.c:154
#2  0x00000008026e6e34 in rpmtsPrepare (ts=0x80701b000) at transaction.c:1506
#3  0x00000008026e7543 in rpmtsRun (ts=0x80701b000, okProbs=0x0, ignoreSet=66) at transaction.c:1716
#4  0x000000080570dd3a in rpmts_Run (s=0x806f89830, args=0x806f98640, kwds=0x0) at rpmts-py.c:603
#5  0x000000080036ad9f in _PyMethodDef_RawFastCallKeywords () at /usr/local/lib/libpython3.7m.so.1.0
#6  0x0000000800370af2 in _PyMethodDescr_FastCallKeywords () at /usr/local/lib/libpython3.7m.so.1.0
#7  0x000000080042daaa in  () at /usr/local/lib/libpython3.7m.so.1.0
```

Error: Operation not permitted.
User that started the process: root (through sudo)

The rpm code is called by ```libdnf-0.48.0``` (from dnf-4.2.23).
```dnf``` was called with ```--installroot /compat/linux``` and ```install``` arguments.

rpm-4.15.1
FreeBSD 12.2


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1374
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200927/9e5bd8ae/attachment.html>


More information about the Rpm-maint mailing list