Hello community,
here is the log from the commit of package lastpass-cli for openSUSE:Factory checked in at 2017-11-03 16:26:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lastpass-cli (Old)
and /work/SRC/openSUSE:Factory/.lastpass-cli.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lastpass-cli"
Fri Nov 3 16:26:46 2017 rev:6 rq:538304 version:1.2.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/lastpass-cli/lastpass-cli.changes 2017-07-12 19:35:48.226062463 +0200
+++ /work/SRC/openSUSE:Factory/.lastpass-cli.new/lastpass-cli.changes 2017-11-03 16:27:55.057512123 +0100
@@ -1,0 +2,13 @@
+Thu Oct 26 08:48:24 UTC 2017 - mpluskal@suse.com
+
+- Update to version 1.2.2:
+ * lpass ls --format now supports "%al" to show URL
+ * $VISUAL can be used in preference to $EDITOR
+ * lpass edit can now directly edit multiline ssh keys
+ * fields are now preserved when edited with lpass edit
+ * Bugfix: use-after-free in http.c fixed
+ * Bugfix: command-line completion now works for names with spaces
+ * Bugfix: loading attachments from shared folders now works
+ * Documentation updates
+
+-------------------------------------------------------------------
@@ -4 +17 @@
-- Update to version 1.2.0:
+- Update to version 1.2.1:
Old:
----
lastpass-cli-1.2.1.tar.gz
New:
----
lastpass-cli-1.2.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ lastpass-cli.spec ++++++
--- /var/tmp/diff_new_pack.97M2vD/_old 2017-11-03 16:27:55.593492615 +0100
+++ /var/tmp/diff_new_pack.97M2vD/_new 2017-11-03 16:27:55.597492469 +0100
@@ -17,7 +17,7 @@
Name: lastpass-cli
-Version: 1.2.1
+Version: 1.2.2
Release: 0
Summary: LastPass command line interface tool
License: GPL-2.0
++++++ lastpass-cli-1.2.1.tar.gz -> lastpass-cli-1.2.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/.gitignore new/lastpass-cli-1.2.2/.gitignore
--- old/lastpass-cli-1.2.1/.gitignore 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/.gitignore 2017-10-25 22:09:11.000000000 +0200
@@ -7,3 +7,4 @@
certificate.h
tags
build
+test/.lpass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/CHANGELOG.md new/lastpass-cli-1.2.2/CHANGELOG.md
--- old/lastpass-cli-1.2.1/CHANGELOG.md 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/CHANGELOG.md 2017-10-25 22:09:11.000000000 +0200
@@ -1,3 +1,15 @@
+# Version 1.2.2
+ * `lpass ls --format` now supports "%al" to show URL, from Yikai Zhao
+ * $VISUAL can be used in preference to $EDITOR, from Wesley Schwengle
+ * `lpass edit` can now directly edit multiline ssh keys
+ * fields are now preserved when edited with `lpass edit`
+ * Bugfix: use-after-free in http.c fixed, from Björn Ketelaars
+ * Bugfix: command-line completion now works for names with spaces
+ * Bugfix: loading attachments from shared folders now works, from Spencer
+ Whyte
+ * Debian packing updates from Hannes Hörl
+ * Documentation updates from Darragh Grealish and Steven Liekens
+
# Version 1.2.1
* Bugfix: fix regression with ```lpass show``` not displaying all fields
for secure notes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/CMakeLists.txt new/lastpass-cli-1.2.2/CMakeLists.txt
--- old/lastpass-cli-1.2.1/CMakeLists.txt 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/CMakeLists.txt 2017-10-25 22:09:11.000000000 +0200
@@ -93,6 +93,7 @@
add_test(test_add_note_with_notes ${CMAKE_SOURCE_DIR}/test/tests test_add_note_with_notes)
add_test(test_add_ssn_name ${CMAKE_SOURCE_DIR}/test/tests test_add_ssn_name)
add_test(test_add_ssh_key ${CMAKE_SOURCE_DIR}/test/tests test_add_ssh_key)
+add_test(test_edit_ssh_key ${CMAKE_SOURCE_DIR}/test/tests test_edit_ssh_key)
add_test(test_edit_username ${CMAKE_SOURCE_DIR}/test/tests test_edit_username)
add_test(test_edit_field ${CMAKE_SOURCE_DIR}/test/tests test_edit_field)
add_test(test_edit_reprompt ${CMAKE_SOURCE_DIR}/test/tests test_edit_reprompt)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/README.md new/lastpass-cli-1.2.2/README.md
--- old/lastpass-cli-1.2.1/README.md 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/README.md 2017-10-25 22:09:11.000000000 +0200
@@ -18,7 +18,16 @@
### Installing on Linux
#### Arch
-* Binary packages are available in the [Arch User Repository (AUR)](https://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=lastpass-cli). Information about installing packages from the AUR [can be found on the Arch wiki](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_package...).
+* A binary package is available from the community repository, use pacman to simple install lastpass-cli.
+* Can be build from source with the "lastpass-cli-git" *[Arch User Repository (AUR)](https://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=lastpass-cli).
+Information about installing packages from the AUR [can be found on the Arch wiki](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_package...).
+
+```
+# from community repository
+sudo pacman -S lastpass-cli
+# from AUR repository
+packer -S lastpass-cli-git
+```
#### Fedora
@@ -175,3 +184,5 @@
Once installed,
$ man lpass
+
+You can view the full documentation in the manpage, `man lpass` or [view it online](https://lastpass.github.io/lastpass-cli/lpass.1.html).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/agent.c new/lastpass-cli-1.2.2/agent.c
--- old/lastpass-cli-1.2.1/agent.c 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/agent.c 2017-10-25 22:09:11.000000000 +0200
@@ -283,6 +283,11 @@
if (config_exists("plaintext_key"))
return;
+ char *disable_str = getenv("LPASS_AGENT_DISABLE");
+ if (disable_str && !strcmp(disable_str, "1")) {
+ return;
+ }
+
child = fork();
if (child < 0)
die_errno("fork(agent)");
@@ -308,8 +313,6 @@
bool agent_get_decryption_key(unsigned char key[KDF_HASH_LEN])
{
- char *disable_str;
-
if (config_exists("plaintext_key")) {
_cleanup_free_ unsigned char *key_buffer = NULL;
if (config_read_buffer("plaintext_key", &key_buffer) == KDF_HASH_LEN) {
@@ -326,10 +329,7 @@
if (!agent_ask(key)) {
if (!agent_load_key(key))
return false;
- disable_str = getenv("LPASS_AGENT_DISABLE");
- if (!disable_str || strcmp(disable_str, "1")) {
- agent_start(key);
- }
+ agent_start(key);
}
mlock(key, KDF_HASH_LEN);
return true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/blob.c new/lastpass-cli-1.2.2/blob.c
--- old/lastpass-cli-1.2.1/blob.c 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/blob.c 2017-10-25 22:09:11.000000000 +0200
@@ -1167,7 +1167,7 @@
for (start = acc->note; ; ) {
name = value = NULL;
lf = strchrnul(start, '\n');
- if (lf == start)
+ if (lf == start && !field)
goto skip;
line = xstrndup(start, lf - start);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/cmd-show.c new/lastpass-cli-1.2.2/cmd-show.c
--- old/lastpass-cli-1.2.1/cmd-show.c 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/cmd-show.c 2017-10-25 22:09:11.000000000 +0200
@@ -129,6 +129,7 @@
char opt;
char *ptext;
size_t len;
+ char *shareid = NULL;
unsigned char *bytes = NULL;
FILE *fp = stdout;
@@ -138,9 +139,12 @@
if (hex_to_bytes(account->attachkey, &key_bin))
die("Invalid attach key for account %s\n", account->name);
+ if (account->share != NULL)
+ shareid = account->share->id;
+
filename = attachment_filename(account, attach);
- ret = lastpass_load_attachment(session, attach, &result);
+ ret = lastpass_load_attachment(session, shareid, attach, &result);
if (ret)
die("Could not load attachment %s\n", attach->id);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/contrib/lpass_bash_completion new/lastpass-cli-1.2.2/contrib/lpass_bash_completion
--- old/lastpass-cli-1.2.1/contrib/lpass_bash_completion 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/contrib/lpass_bash_completion 2017-10-25 22:09:11.000000000 +0200
@@ -20,7 +20,7 @@
local matches
# matches on full path
- matches=$(lpass ls | egrep "^$cur" | awk '{print $1}')
+ matches=$(lpass ls | egrep "^$cur" | sed -e "s/ \[id.*//g")
# matches on leaves
matches+=$(lpass ls | egrep "/$cur" | sed -e "s/ \[id.*//g" | \
awk -F '/' '{print $NF}')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/debian/changelog new/lastpass-cli-1.2.2/debian/changelog
--- old/lastpass-cli-1.2.1/debian/changelog 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/debian/changelog 2017-10-25 22:09:11.000000000 +0200
@@ -1,3 +1,9 @@
+lastpass-cli (1.2.2) unstable; urgency=medium
+
+ * New upstream 1.2.2
+
+ -- Bob Copeland Wed, 25 Oct 2017 16:07:56 -0400
+
lastpass-cli (1.2.1) unstable; urgency=medium
* New upstream 1.2.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/debian/control new/lastpass-cli-1.2.2/debian/control
--- old/lastpass-cli-1.2.1/debian/control 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/debian/control 2017-10-25 22:09:11.000000000 +0200
@@ -2,7 +2,7 @@
Section: utils
Priority: optional
Maintainer: Troy Heber
-Build-Depends: debhelper (>= 9), quilt (>= 0.47), libssl-dev, libxml2-dev, libcurl4-openssl-dev, asciidoc, xsltproc, docbook-xsl, cmake, pkg-config
+Build-Depends: debhelper (>= 9), quilt (>= 0.47), libssl-dev | libssl1.0-dev, libxml2-dev, libcurl4-openssl-dev, asciidoc, xsltproc, docbook-xsl, cmake, pkg-config
Standards-Version: 3.9.8.0
Package: lastpass-cli
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/edit.c new/lastpass-cli-1.2.2/edit.c
--- old/lastpass-cli-1.2.1/edit.c 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/edit.c 2017-10-25 22:09:11.000000000 +0200
@@ -206,47 +206,100 @@
return 0;
}
+enum note_type get_note_type(struct account *account)
+{
+ struct field *editable_field;
+
+ list_for_each_entry(editable_field, &account->field_head, list) {
+ if (!strcmp(editable_field->name, "NoteType")) {
+ return notes_get_type_by_name(editable_field->value);
+ }
+ }
+ return NOTE_TYPE_NONE;
+}
+
+struct parsed_name_value
+{
+ char *name;
+ char *value;
+ int lineno;
+ struct list_head list;
+};
+
/*
* Read a file representing all of the data in an account.
* We generate this file when editing an account, and parse it back
- * after a user has edited it. Each line, with the exception of the
- * final "notes" label, is parsed from the end of the label to the
- * first newline. In the case of notes, the rest of the file is considered
- * part of the note.
+ * after a user has edited it.
+ *
+ * Multiline values are accepted (though they may not be supported by
+ * lastpass in all cases).
+ *
+ * Once the "Notes:" label is encountered, everything else is concatenated
+ * into the note.
*
* Name: text0
* URL: text1
* [...]
* Notes:
* notes text here
- *
*/
-static void parse_account_file(FILE *input, struct account *account,
- unsigned char key[KDF_HASH_LEN])
+static void parse_account_file(FILE *input, enum note_type note_type,
+ struct list_head *list_head)
{
_cleanup_free_ char *line = NULL;
ssize_t read;
size_t len = 0;
- char *label, *delim, *value;
+ char *name, *delim, *value = NULL;
bool parsing_notes = false;
int ret;
int lineno = 0;
+ struct parsed_name_value *current = NULL;
+
/* parse label: [value] */
while ((read = getline(&line, &len, input)) != -1) {
lineno++;
+
+ line = trim(line);
delim = strchr(line, ':');
- if (!delim)
+ if (!delim) {
+ /* non keyed strings go to existing field (if any) */
+ if (current)
+ xstrappendf(¤t->value, "\n%s", line);
+ continue;
+ }
+
+ name = xstrndup(line, delim - line);
+ value = xstrdup(delim + 1);
+
+ /*
+ * If this is a known notetype, append any non-existent
+ * keys to the existing field. For example, Proc-Type
+ * in the ssh private key field goes into private key,
+ * not a Proc-Type field.
+ */
+ if (note_type != NOTE_TYPE_NONE &&
+ !note_has_field(note_type, name) && current &&
+ note_field_is_multiline(note_type, current->name)) {
+ xstrappendf(¤t->value, "\n%s", line);
+
+ free(name);
+ free(value);
continue;
- *delim = 0;
- value = delim + 1;
- label = line;
+ }
- if (!strcmp(label, "Notes")) {
+ if (!strcmp(name, "Notes")) {
parsing_notes = true;
+ free(name);
+ free(value);
break;
}
- assign_account_value(account, label, value, lineno, key);
+
+ current = new0(struct parsed_name_value, 1);
+ current->name = name;
+ current->value = value;
+ current->lineno = lineno;
+ list_add_tail(¤t->list, list_head);
}
if (!parsing_notes)
@@ -263,7 +316,30 @@
die("Maximum note length is %lu bytes (was %lu)",
MAX_NOTE_LEN, len);
}
- account_set_note(account, value, key);
+
+ current = new0(struct parsed_name_value, 1);
+ current->name = xstrdup("Notes");
+ current->value = value;
+ current->lineno = lineno;
+ list_add_tail(¤t->list, list_head);
+}
+
+static void read_account_file(FILE *input, struct account *account,
+ unsigned char key[KDF_HASH_LEN])
+{
+ LIST_HEAD(fields);
+ struct parsed_name_value *entry, *tmp;
+
+ parse_account_file(input, get_note_type(account), &fields);
+
+ list_for_each_entry_safe(entry, tmp, &fields, list) {
+ assign_account_value(account, entry->name, entry->value,
+ entry->lineno, key);
+ free(entry->name);
+ free(entry->value);
+ list_del(&entry->list);
+ free(entry);
+ }
}
static
@@ -321,18 +397,6 @@
}
}
-enum note_type get_note_type(struct account *account)
-{
- struct field *editable_field;
-
- list_for_each_entry(editable_field, &account->field_head, list) {
- if (!strcmp(editable_field->name, "NoteType")) {
- return notes_get_type_by_name(editable_field->value);
- }
- }
- return NOTE_TYPE_NONE;
-}
-
static int write_account_file(FILE *fp, struct account *account,
unsigned char key[KDF_HASH_LEN])
{
@@ -462,9 +526,9 @@
}
fclose(tmpfile);
- xasprintf(&editcmd, "${EDITOR:-vi} '%s'", tmppath);
+ xasprintf(&editcmd, "${VISUAL:-${EDITOR:-vi}} '%s'", tmppath);
if (system(editcmd) < 0)
- die_unlink_errno("system($EDITOR)", tmppath, tmpdir);
+ die_unlink_errno("system($VISUAL)", tmppath, tmpdir);
tmpfile = fopen(tmppath, "r");
} else
@@ -477,13 +541,12 @@
if (ret)
die_unlink_errno("fread(tmpfile)", tmppath, tmpdir);
} else if (choice == EDIT_ANY) {
- parse_account_file(tmpfile, editable, key);
+ read_account_file(tmpfile, editable, key);
value = NULL;
} else {
- value = NULL;
- len = 0;
- if (getline(&value, &len, tmpfile) < 0)
- die_unlink_errno("getline", tmppath, tmpdir);
+ ret = read_file_buf(tmpfile, &value, &len);
+ if (ret)
+ die_unlink_errno("fread(tmpfile)", tmppath, tmpdir);
}
fclose(tmpfile);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/endpoints.c new/lastpass-cli-1.2.2/endpoints.c
--- old/lastpass-cli-1.2.1/endpoints.c 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/endpoints.c 2017-10-25 22:09:11.000000000 +0200
@@ -90,6 +90,58 @@
upload_queue_enqueue(sync, key, session, "show_website.php", ¶ms);
}
+static char *stringify_field(const struct field *field)
+{
+ char *str, *name, *type, *value, *intermediate;
+ CURL *curl;
+
+ curl = curl_easy_init();
+ if (!curl)
+ return xstrdup("");
+
+ name = curl_easy_escape(curl, field->name, 0);
+ type = curl_easy_escape(curl, field->type, 0);
+ if (field->value_encrypted)
+ value = curl_easy_escape(curl, field->value_encrypted, 0);
+ else if (!strcmp(field->type, "checkbox") || !strcmp(field->type, "radio")) {
+ xasprintf(&intermediate, "%s-%c", field->value, field->checked ? '1' : '0');
+ value = curl_easy_escape(curl, intermediate, 0);
+ free(intermediate);
+ } else
+ value = curl_easy_escape(curl, field->value, 0);
+
+ xasprintf(&str, "0\t%s\t%s\t%s\n", name, value, type);
+
+ curl_free(name);
+ curl_free(type);
+ curl_free(value);
+ curl_easy_cleanup(curl);
+
+ return str;
+}
+
+static char *stringify_fields(const struct list_head *field_head)
+{
+ char *field_str, *fields = NULL;
+ struct field *field;
+
+ list_for_each_entry(field, field_head, list) {
+ field_str = stringify_field(field);
+ xstrappend(&fields, field_str);
+ free(field_str);
+ }
+ if (fields)
+ xstrappend(&fields, "0\taction\t\taction\n0\tmethod\t\tmethod\n");
+ else
+ fields = xstrdup("");
+
+ field_str = NULL;
+ bytes_to_hex((unsigned char *) fields, &field_str, strlen(fields));
+ free(fields);
+
+ return field_str;
+}
+
static void add_app_fields(const struct account *account,
struct http_param_set *params)
{
@@ -120,14 +172,17 @@
};
_cleanup_free_ char *url = NULL;
+ _cleanup_free_ char *fields = NULL;
bytes_to_hex((unsigned char *) account->url, &url, strlen(account->url));
+ fields = stringify_fields(&account->field_head);
++blob->version;
http_post_add_params(¶ms,
"extjs", "1",
"token", session->token,
+ "method", "cli",
"name", account->name_encrypted,
"grouping", account->group_encrypted,
"pwprotect", account->pwprotect ? "on" : "off",
@@ -151,17 +206,26 @@
http_post_add_params(¶ms, "appaid", account->id, NULL);
upload_queue_enqueue(sync, key, session, "addapp.php", ¶ms);
+ goto out_free_params;
+ }
+ http_post_add_params(¶ms,
+ "aid", account->id,
+ "url", url,
+ "username", account->username_encrypted,
+ "password", account->password_encrypted,
+ "extra", account->note_encrypted,
+ NULL);
- } else {
+ if (strlen(fields)) {
http_post_add_params(¶ms,
- "aid", account->id,
- "url", url,
- "username", account->username_encrypted,
- "password", account->password_encrypted,
- "extra", account->note_encrypted,
+ "save_all", "1",
+ "data", fields,
NULL);
- upload_queue_enqueue(sync, key, session, "show_website.php", ¶ms);
}
+ upload_queue_enqueue(sync, key, session, "show_website.php", ¶ms);
+
+out_free_params:
+ free(params.argv);
}
unsigned long long lastpass_get_blob_version(struct session *session, unsigned const char key[KDF_HASH_LEN])
@@ -397,6 +461,7 @@
* in *result should be freed by the caller.
*/
int lastpass_load_attachment(const struct session *session,
+ const char *shareid,
struct attach *attach,
char **result)
{
@@ -405,9 +470,27 @@
*result = NULL;
- reply = http_post_lastpass("show_website.php", session, NULL,
- "token", session->token,
- "getattach", attach->storagekey, NULL);
+ struct http_param_set params = {
+ .argv = NULL,
+ .n_alloced = 0
+ };
+
+ http_post_add_params(¶ms,
+ "token", session->token,
+ "getattach", attach->storagekey,
+ NULL);
+
+ if (shareid) {
+ http_post_add_params(¶ms,
+ "sharedfolderid", shareid,
+ NULL);
+ }
+
+ reply = http_post_lastpass_param_set("getattach.php",
+ session, NULL,
+ ¶ms);
+
+ free(params.argv);
if (!reply)
return -ENOENT;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/endpoints.h new/lastpass-cli-1.2.2/endpoints.h
--- old/lastpass-cli-1.2.1/endpoints.h 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/endpoints.h 2017-10-25 22:09:11.000000000 +0200
@@ -27,5 +27,5 @@
int lastpass_pwchange_start(const struct session *session, const char *username, const char hash[KDF_HEX_LEN], struct pwchange_info *pwchange_info);
int lastpass_pwchange_complete(const struct session *session, const char *username, const char *enc_username, const char new_hash[KDF_HEX_LEN], int new_iterations, struct pwchange_info *pwchange_info);
int lastpass_upload(const struct session *session, struct list_head *accounts);
-int lastpass_load_attachment(const struct session *session, struct attach *attach, char **result);
+int lastpass_load_attachment(const struct session *session, const char *shareid, struct attach *attach, char **result);
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/format.c new/lastpass-cli-1.2.2/format.c
--- old/lastpass-cli-1.2.1/format.c 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/format.c 2017-10-25 22:09:11.000000000 +0200
@@ -138,6 +138,10 @@
/* group name */
append_str(buf, account->group, add_slash);
break;
+ case 'l':
+ /* URL */
+ append_str(buf, account->url, add_slash);
+ break;
default:
break;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/http.c new/lastpass-cli-1.2.2/http.c
--- old/lastpass-cli-1.2.1/http.c 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/http.c 2017-10-25 22:09:11.000000000 +0200
@@ -310,8 +310,8 @@
ret = curl_easy_perform(curl);
unset_interrupt_detect();
- curl_easy_cleanup(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, http_code);
+ curl_easy_cleanup(curl);
*curl_ret = ret;
if (ret != CURLE_OK) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/lpass.1.txt new/lastpass-cli-1.2.2/lpass.1.txt
--- old/lastpass-cli-1.2.1/lpass.1.txt 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/lpass.1.txt 2017-10-25 22:09:11.000000000 +0200
@@ -158,6 +158,7 @@
* %aU: account last touch time
* %as: account share name
* %ag: account group name
+* %al: account URL
* %fn: field name (for 'show')
* %fv: field value (for 'show')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/test/tests new/lastpass-cli-1.2.2/test/tests
--- old/lastpass-cli-1.2.1/test/tests 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/test/tests 2017-10-25 22:09:11.000000000 +0200
@@ -100,10 +100,37 @@
cat <<__EOM__ | lpass add --sync=no --note-type=ssh-key --non-interactive $name
Name: $name
Hostname: foobar
+Private Key: $privkey
+Public Key: $pubkey
__EOM__
- echo "$privkey" | tr '\n' ' '| lpass edit --sync=no --field='Private Key' --non-interactive $name
+ assert_str_eq "$(lpass show --sync=no --field='Private Key' $name)" "$privkey" || return 1
+ assert_str_eq "$(lpass show --sync=no --field='Public Key' $name)" "$pubkey"
+}
+
+function test_edit_ssh_key
+{
+ login || return 1
+ local name="test-edit-ssh-key"
+ read -r -d '' privkey <<__EOM__
+-----BEGIN EC PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-128-CBC,5D91CAD2A62C0E3EDCCB853FCB21054D
+
+V/HhFCirRljWoJnjOwwhoFqdRnpWbXQsrppky/uT/Ttb9k5YmC9SLhEZyf8fAReJ
+KGiE8MvnnXKvDMj5eqeWge/YleHsNvyR+8qPqfPha9X/vYCUeR/ZoGg/CKzMVBN3
+bnghFVqB3npQykkkbiBEKLDwosTkR/0JO4I8PRzo34k=
+-----END EC PRIVATE KEY-----
+__EOM__
+ read -r -d '' pubkey <<__EOM__
+ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHiavhPDPg2OH2YjJWDpF9JHpKfnVGB0xc7cSojMXMJftgH4UvgUr8fVJhfp1ix/I8a/a8C0RiCo/Q/A6z3o+7U= blah
+__EOM__
+ cat <<__EOM__ | lpass add --sync=no --note-type=ssh-key --non-interactive $name
+Name: $name
+Hostname: foobar
+__EOM__
+ echo "$privkey" | lpass edit --sync=no --field='Private Key' --non-interactive $name
echo "$pubkey" | lpass edit --sync=no --field='Public Key' --non-interactive $name
- assert_str_eq "$(lpass show --sync=no --field='Private Key' $name)" "$privkey"
+ assert_str_eq "$(lpass show --sync=no --field='Private Key' $name)" "$privkey" || return 1
assert_str_eq "$(lpass show --sync=no --field='Public Key' $name)" "$pubkey"
}
@@ -142,7 +169,7 @@
login || return 1
echo "Reprompt: No" | lpass edit --non-interactive test-reprompt-note
assertz $? || return 1
- assert_str_eq "$(lpass show --sync=no test-reprompt-note | grep Reprompt)" ""
+ assert_str_eq "$(lpass show --sync=no test-reprompt-note | grep Reprompt)" "" || return 1
echo "Reprompt: Yes" | lpass edit --non-interactive test-reprompt-note
assertz $? || return 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.1/version.h new/lastpass-cli-1.2.2/version.h
--- old/lastpass-cli-1.2.1/version.h 2017-06-28 14:50:49.000000000 +0200
+++ new/lastpass-cli-1.2.2/version.h 2017-10-25 22:09:11.000000000 +0200
@@ -1,2 +1,2 @@
-#define LASTPASS_CLI_VERSION "1.2.1"
+#define LASTPASS_CLI_VERSION "1.2.2"
#define LASTPASS_CLI_USERAGENT "LastPass-CLI/" LASTPASS_CLI_VERSION