Opened 22 years ago

Closed 13 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 22 years ago.
libc debug log

Download all attachments as: .zip

Change History (4)

Changed 22 years ago by Yuri Dario

Attachment: libc_0ec4.zip added

libc debug log

comment:1 Changed 22 years ago by Yuri Dario

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 Changed 13 years ago by bird

Status: newassigned

comment:3 Changed 13 years ago by bird

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.