Add modification field in database - pee - Pee a password manager;Pee - because… | |
git clone git://vernunftzentrum.de/pee.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit d8d114a7059a8e42ebc2fcb1b03cc5c87aad5b64 | |
parent 9eebb7ec201f158d40f10e5a5f38903577998ef7 | |
Author: Christian Kellermann <[email protected]> | |
Date: Sun, 10 Jan 2016 21:32:29 +0100 | |
Add modification field in database | |
The field is the last in the entry list and represents seconds since the | |
epoch. The time written on listing entries is converted to local time. | |
Diffstat: | |
pee.scm | 9 +++++---- | |
todo.org | 2 +- | |
2 files changed, 6 insertions(+), 5 deletions(-) | |
--- | |
diff --git a/pee.scm b/pee.scm | |
@@ -239,10 +239,11 @@ | |
(printf "~a Version ~a -- ~a~%" program-name program-version program-descrip… | |
(define (print-without-password e) | |
- (printf "Account: ~a\tUser: ~a\tComment: ~a~%" | |
+ (printf "Account: ~a\tUser: ~a\tComment: ~a\tLast changed: ~a~%" | |
(first e) | |
(second e) | |
- (fourth e))) | |
+ (fourth e) | |
+ (time->string (seconds->local-time (fifth e)) "%Y-%M-%d %H:%M:%S"))) | |
(define (do-add db-name db p e) | |
(when (alist-ref e db equal?) | |
@@ -252,7 +253,7 @@ | |
(password (new-password)) | |
(comment (prompt-for "Comment"))) | |
(encrypt-file db-name | |
- (cons (list e user password comment) db) | |
+ (cons (list e user password comment (current-seconds)) db) | |
p) | |
(print "Entry for " e " added."))) | |
@@ -265,7 +266,7 @@ | |
(new-password) | |
(second e)))) | |
(encrypt-file db-name | |
- (alist-update account (list user password comment) … | |
+ (alist-update account (list user password comment (… | |
p) | |
(print "Entry '" account "' has been updated.")))) | |
(else (print "Error: Entry for '" account "' not found.") | |
diff --git a/todo.org b/todo.org | |
@@ -2,4 +2,4 @@ | |
** Do we need to feed arc4random into tweetnacl for better randomness? | |
** initialise-db should not overwrite the file so easily | |
** Add a version counter to the file, so we can make assumptions about the fil… | |
-** Add a last modified date to entries, this should make it easier when mergin… | |
+ |