NICMx / FORT-validator

RPKI cache validator
MIT License
47 stars 22 forks source link

The validator deletes .../repository/CACHEDIR.TAG on upgrades #104

Closed rfc1036 closed 6 months ago

rfc1036 commented 7 months ago

The Debian package creates /var/lib/fort/CACHEDIR.TAG to prevent backup programs from wasting time and storage storing generations of cached data which could be trivially downloaded again.

Starting with 1.6.0, fort on upgrades deletes the whole directory and the CACHEDIR.TAG file too:

invalid_cache:
       pr_op_info("The cache appears to have been built by a different version of Fort. I'm going to clear it, just to be safe.");
       file_rm_rf(config_get_local_repository());

Possible solutions:

lukastribus commented 7 months ago

have fort itself create the CACHEDIR.TAG file when initializing the repository

I think this would be the most straightforward approach.

ydahhrk commented 7 months ago

Interesting. I didn't know about this file, and reading up on it, I also agree with

  • have fort itself create the CACHEDIR.TAG file when initializing the repository

to provide the solution even outside of Debian.

I'll add it today.


Starting with 1.6.0, fort on upgrades deletes the whole directory and the CACHEDIR.TAG file too:

Actually, this bug is specific to the issue103 branch. The code does not exist in 1.6.0.


I don't know if this is viable, but if you run into this situation again (with a different package), I would suggest a fourth option:

Since the file was being managed by the package, not the program.

ydahhrk commented 7 months ago

New branch.

ydahhrk commented 6 months ago

Sorry; I'd left a bug that prevented Fort from creating CACHEDIR.TAG when it flushed the cache. I just pushed the patch to both issue104 and main.