Opened 23 years ago

Closed 14 years ago

#224 closed defect (invalid)

chroot breaks /@unixroot rewrite

Reported by: Yuri Dario Owned by: bird
Priority: normal Milestone: libc-0.6.4
Component: libc-backend Version: 0.6.2
Severity: normal Keywords:
Cc:

Description

While working at RPM, I discovered some wrong installations when a non UNIXRoot drive was used.

Debug showed that calling chroot("/@unixroot/"), ..., chroot(".") broke the unixroot rewrite.

The logged libc output shows how /@unixroot resolves to D:/ after the two chrooted calls.

Removing the chroot, restored @unixroot behaviour.

Attaching sample log, unable to write a testcase.

Attachments (1)

libc_0ec4.zip (189.9 KB ) - added by Yuri Dario 23 years ago.
libc debug log

Download all attachments as: .zip

Change History (4)

by Yuri Dario, 23 years ago

Attachment: libc_0ec4.zip added

libc debug log

comment:1 by Yuri Dario, 23 years ago

Just for the record, rpmtsPrepare() in lib/transaction.c is the location of the chroot(). Fortunately, this chroot was not required, so rpm works.

comment:2 by bird, 14 years ago

Status: newassigned

comment:3 by bird, 14 years ago

Resolution: invalid
Status: assignedclosed

chroot changes /@unixroot/, that's how it works. What's going wrong in this case is that rpm thinks the pwd is the old unixroot - it does a chdir("/") at timestamp 019f280f. The chroot does not alter the current directory, so the following chroot(".") is probably supposed to undo the previous chroot("/@unixroot/"). I would think that the chdir("/") should be a chdir("/@unixroot") and is something you've missed when porting rpm.

Note: See TracTickets for help on using tickets.