portupgrade regression?
Jon Noack
noackjr at alumni.rice.edu
Thu Apr 21 23:44:30 PDT 2005
Ever since the security fix for CAN-2005-0610, portupgrade and company
have been behaving oddly for me. The root cause of this seems to be
that the pkgdb is being updated needlessly with every operation:
[root:~] $ portversion -v | grep -v "="
[Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 208
packages found (-0 +0) done]
[root:~] $ portupgrade -a
[Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 208
packages found (-0 +0) done]
[root:~] $ portversion -v | grep -v "="
[Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 208
packages found (-0 +0) done]
[root:~] $
One side effect is that it is no longer possible to run portversion as a
normal user:
[noackjr:~] $ portversion -v | grep -v "="
The pkgdb must be updated. Please run 'pkgdb -u' as root.
[noackjr:~] $
I have deleted and rebuilt /var/db/pkg/pkgdb.db and /usr/ports/INDEX.db
with no change in behavior.
I reversed the patch in pkgdb.rb, changing the @db_dir for pkgdb.fixme
back to @tmp_dir. After one pkgdb update, everything works again:
[root:~] $ portversion -v | grep -v "="
[Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 208
packages found (-0 +0) done]
[root:~] $ portversion -v | grep -v "="
[root:~] $
It's even fine for a normal user:
[noackjr:~] $ portversion -v | grep -v "="
[noackjr:~] $
After reinstalling a stock portupgrade from ports, things start
misbehaving again as soon as a port is changed or I rebuild the db files.
I don't quite understand the CAN-2005-0610 patch. Why are we ignoring
@tmp_dir? I have no problem with @tmp_dir defaulting to a secure
location, but why can't I configure it so that my normal user account
can use portversion? Heck, I don't even really know what the
pkgdb.fixme file is used for, just that changing its path breaks
portversion. I have set PKG_TMPDIR to a location where my normal user
account has write access (as mentioned in the VuXML entry:
http://www.vuxml.org/freebsd/22f00553-a09d-11d9-a788-0001020eed82.html),
but with @tmp_dir being ignored it has no effect.
Am I trying to do something that I shouldn't? What is the correct
behavior here?
Thanks,
Jon
More information about the freebsd-ports
mailing list