Re: Re: problem compiling KDar with libdar CVS
Johnathan Burchill <[email protected]> Sun, 07 Nov 2004 10:01:39 -0700
| Newsgroups | gmane.comp.sysutils.backup.dar.libdar |
|---|---|
| Message-ID | <[email protected]> |
Hi Denis, On Thursday 04 November 2004 10:47, Denis Corbin wrote: > Johnathan Burchill wrote: > | On Thursday 04 November 2004 02:27, Denis Corbin wrote: > |>Johnathan Burchill wrote: > | > |[...] > | > |>| 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 ? > | > | I didn't expect libdar to continue where it left off after issuing > | Epassword(). Just that it would be a way to inform the application to > | ask the user for a password and try again to read the archive from the > | beginning. > | > | However, your idea of using user_interaction::pause looks promising. I > > did > > | not think of that one because the current implementation seems to be > | able to handle boolean questions, not arbitrary responses. > > Yes you are right. user_interaction::pause() is only able to handle > boolean questions. Thus I had to add a new method to user_interaction > class: > > ~ std::string get_string(const std::string & message, bool echo); > I'd like to get your opinion on confirming passwords. When a user needs to enter a password to encrypt a file, I think he/she should be asked to confirm what they entered. If the password is for decryption, no confirmation should be required. Is this something that the application or libdar should be concerned about? If the application has to keep track of whether an archive is being created or read, that is okay, but means repetitive coding for everyone who uses libdar, and more complicated code at the application level. I'd rather let libdar decide whether to confirm passwords, with a method like std::string get_string( const std::string & message, bool echo, bool confirm ); What do you think? [...] JB -- Johnathan K. Burchill, Ph.D. [email protected]
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBBjlT4rXMSOtiWrO4RAi6vAJ9KVFc47X5WKwMNWEu7o57/pCe5bQCgyhBj c4TlGR+rLT5pFlXFZuwCW78= =oK27 -----END PGP SIGNATURE-----