Age | Commit message (Collapse) | Author |
|
Added pathtoabs function to convert relative paths to absolute. This is
used now because we have to change dir contexts to use gpgtar, since it
doesn't support the tar change dir functionality.
Variablized sleep time.
Changed archive write process to a move process. This is safer and
faster (though still somewhat dangerous given we write to memory and
move to storage). Previoiusly, we tarred the /tmp/dec- directory, piped
to gpg, and redirected stdout to the gpg archive. This was incredibly
dangerous, because on larger archives, loss of power or process crash
could yield a corrupted destination archive. Now we encrypte the entire
archive to memory so processing time is minimally a factor, then move to
storage over the old one. This significantly speeds up write operations
for large archives.
|
|
If chdir returns anything other than 0 now, we return errno to indicate
that something went wrong with determination of the absolute path.
Also added errno.h include to handle errno values.
|
|
This now calls mkdtemp to generate a random extraction path. This will
help secure the program, as well as preventing temp dir collisions when
running multiple instances simultaneously.
Added pathtoabs function which converts the specified path to its
absolute path equivelant. This function enables extraction into a temp
dir outside of the start working directory without invalidating relative
paths.
|
|
Return code 1 on failure with a error message.
|
|
|
|
No encryption is supported yet. Only supports archive decompression and
extraction and enumeration.
|
|
This allows the user to open the encrypted archive and detach from the
polling operation. Because of this, the command line syntax has changed
a bit. We now require an action before the archive name: open, close,
and status.
Open (obviously) opens the archive and close the opposite. Status will
tell if the archive is opened or close. It will also detect stale
pidfiles and clean them up of the corresponding process is not running.
Note that default writeback duration is 15 seconds and it not
configurable [yet].
|
|
Previously, we just handled sigint. Now we also trap sigterm, sigkill,
sigquit, and sighup. These will [hopefully] prevent data loss in the
event we receive unexpected signals.
Also removed a couple of messages that printed to stdout.
|
|
Now we write back to encrypted storage on a loop every 15 seconds. We
also catch SIGINT (Ctrl + c) and execute a clean shutdown process. This
will reduce the likelihood of data loss.
|
|
Previously, if the KEY variable was unset, a new archive would be
created and would overwrite the original, losing all data (this is a
brand new script after all).
Now we check not only that KEY is set, but that KEY can be found with
'gpg --list-keys'.
Also added newline on "Re-encrypting for shutdown" message.
|
|
This is just a very basic version. It requires the user to shutdown the
decrypted archive.
It does however write to RAM (/tmp) so the decrypted copies never touch
permanent storage. In the event that it does touch persistent storage,
all of the files are shredded on shutdown of the archive.
|