]> git.ipfire.org Git - thirdparty/FORT-validator.git/commit
Automatically download if file is an rsync URL
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Fri, 10 May 2024 21:05:30 +0000 (15:05 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Fri, 10 May 2024 21:05:30 +0000 (15:05 -0600)
commit2b3ed8c6c10694cd7acc4ea9164e6568e49f3753
tree9a6ffc571136facf8c1a2205613b228b58fef8a0
parentcc17e139ab30cc1fcbcd3c06f5e32813027b1159
Automatically download if file is an rsync URL

rsync cannot download into standard output... which means rsync'd files
cannot be elegantly piped as standard output to --mode=print. So either
the rsync has to be done manually by the user... or --mode=print has to
do it internally by itself.

And looking at the code that resulted... I now wish I had gone with the
former option. Because of the long overdue cache refactors, the user
needs to include --tal for this rsync to be compatible with the cache.
This sucks.

As a workaround, Fort will rsync into /tmp if --tal and/or --local-cache
aren't supplied:

$ fort --mode=print \
--validation-log.enabled \
--validation-log.level debug \
rsync://a.b.c/d/CRL.crl
...
May 10 13:32:44 DBG [Validation]: Executing rsync:
May 10 13:32:44 DBG [Validation]:     rsync
May 10 13:32:44 DBG [Validation]:     ...
May 10 13:32:44 DBG [Validation]:     rsync://a.b.c/d/CRL.crl
May 10 13:32:44 DBG [Validation]:     /tmp/fort-Q7tMhz/CRL.crl
...
{
"tbsCertList": {
"version": 1,
...
src/cache/local_cache.c
src/print_file.c
src/rsync/rsync.c
src/rsync/rsync.h