Re: problem compiling KDar with libdar CVS

Denis Corbin <[email protected]> Thu, 04 Nov 2004 10:27:02 +0100
Newsgroups gmane.comp.sysutils.backup.dar.libdar
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Johnathan Burchill wrote:

Hello Johnathan,

| On Wednesday 03 November 2004 13:08, Denis Corbin wrote:
|
|>Denis Corbin wrote:
|>|[...]
|[...]
| As far as I can tell from the latest cvs API, when I read an existing
| archive with the archive "read" constructor, I need to give it a "const
| std::string &pass" argument, i.e. the password. So it seems that the
| application has to know beforehand whether the user is opening an
| encrypted archive or an unencrypted archive.

In my point of view, the user has to know if the archive he tends to
open is encrypted or not and if so it has to know too the password. The
pass argument may be an empty string, or any other value, the given
value will only be used if the archive has a flag set in the header of
the archive telling that the archive has been encrypted (no information
about the algorithm used or the block size used --- or the password of
course --- is present in the header). Note that the pass has the
structure described in the dar man page (option -K), "[algo:]pass" .
where algo is bf, blowfish, scram or scrambling (more will follow I hope
before the end of november) with "bf" = "blowfish", "scram" =
"scrambling". If the password must contain a ':' the algo must be
specified (in the form <algo>:<password_with_column>), so you can safely
always specify the cypher used.

A warning is issued if an encrypted archive is openned, because the
diagnostic of a wrong password, is not easy to diagnostic neither for
the user nor for libdar.

|
| I see that archive::archive calls "macro_tools_open_archive" which in
turn
| calls dialog.warning(...) if the archive is encrypted and no password is
| given. Perhaps if "macro_tools_open_archive" could throw an Epassword()
| exception, that could be caught by the application, which could
| transparently ask the user for a password and try the read again.

I like the idea, but throwing an exception is not a reversible operation
~ from the stack point of view (you cannot continue execution where it
has been thrown). I suppose you mean that libdar should rather use a the
user_interaction::pause(...) method to ask the password to the user, it
the pass argument was something like "bf:" or "scram:" where just the
algorithm (the cypher) is given ?

This is what I was looking for, to implement the password out of
command-line for dar. Libdar could interactively ask the user for
password when the user gives "-K bf:" or maybe just "-K :" where no
password is given and the cypher is blowfish or where nothing is given
at all, so the default cypher (bf actually) is used and no password is used.

Thanks for the idea ! :-)

|
| Or, is there a way in the API to check the archive, before opening it, to
| see whether it is encrypted?

well, it may have implications for the user if openning the archive once
just to see if the archive is encrypted and a second time to open it for
real. Implications can be extra change of disk for example.

|
| Cheers,
| JB
|
|

Cheers,
Denis.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBifXmpC5CI8gYGlIRArVsAJ9cIMUSRMbDISUFOTKf0oFFAbrCXgCePP/4
8u5/JizTPNvTX56PZM/OrVA=
=+UQ4
-----END PGP SIGNATURE-----



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click