-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dryrun keyless ignore config #91
Conversation
@@ -374,6 +376,9 @@ keyfile_read(const char * filename, uint64_t * machinenum, int keys) | |||
goto err0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it's begging for a if (errno == ENOENT) goto notfound;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about
[EACCES]
Search permission is denied for a component of the path prefix.
I mean, should that also count as file-not-found?
0367d68
to
545ed9b
Compare
Updated with cleaned-up code. Behaviour is now:
|
f702310
to
c3ccde0
Compare
tarsnap.conf.sample comes with a default location for the keyfile, but there is no keyfile there until the user runs tarsnap-keygen, so $ tarsnap --dry-run -c ~/backup fails. Users could avoid this problem by specifying --no-default-config on the command-line, but it would be nicer if tarsnap itself could forgive having an non-existent / non-readable keyfile specified in the config file (but only the config file, not the command-line!).
c3ccde0
to
dd4558f
Compare
Updated to continue a dryrun despite any keyfile-reading error.
|
Addresses #89
I went back and forth half a dozen times between handling
fromconffile
inload_keys()
vs.dooption()
. In the end, I went withload_keys()
sincedooption()
is already pretty long, and each option isn't very long. But I wimped out on doing everything inload_keys()
; I leftbsdtar->have_keys = 1
indooption()
since that's where it was originally. I think it might be better to move that intoload_keys()
; if we did that,load_keys()
could go back to beingvoid
instead of theint
that I changed it to.Basically: adding the functionality was trivial. Trying to make it match the desired style was not. :|