Opened 18 years ago

Closed 8 years ago

#224 closed defect (invalid)

chroot breaks /@unixroot rewrite

Reported by: ydario 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 ydario 18 years ago.
libc debug log

Download all attachments as: .zip

Change History (4)

Changed 18 years ago by ydario

libc debug log

comment:1 Changed 18 years ago by ydario

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

  • Status changed from new to assigned

comment:3 Changed 8 years ago by bird

  • Resolution set to invalid
  • Status changed from assigned to closed

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.