You are not logged in.

#1 2016-11-16 20:11:29

HarveyK
Member
Registered: 2015-10-05
Posts: 37

Captive portal corrupting package databases

Sometimes I forget to log in to our company's wifi hotspot, so its captive portal is redirecting every http request to the login page. When I run "pacman -Syu" in this situation, /var/lib/pacman/sync/core.db etc. get filled with the portal's html code, not the expected db content.

As a result, the upgrade fails with

:: Starting full system upgrade...
error: could not open file /var/lib/pacman/sync/core.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/core.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/extra.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/extra.db: Unrecognized archive format
[...]

Even after a login to the portal (with an active transparent internet connection), a subsequent "pacman -Syu" fails.

Of course one can easily recover by deleting everything in /var/lib/pacman/sync/, but when I saw this for the first time, it looked quite alarming.

I wonder if pacman could do some basic checks before overwriting the database files (or if there is an option I should know..)

Offline

#2 2016-11-16 20:35:48

apg
Developer
Registered: 2012-11-10
Posts: 211

Re: Captive portal corrupting package databases

Offline

#3 2016-11-17 04:58:17

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Captive portal corrupting package databases

IIRC from having the same problem, the subsequent `pacman -Syu` fails because the "database" is more recent on account of actually being a brand-new HTML page. So adding another `y` should fix things.

If you have to login often, you could create a curl script which automatically logs you in. smile


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB