Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ void account_free_contents(struct account *account)
free(account->username);
free(account->password);
free(account->note);
free(account->notetype);
free(account->name_encrypted);
free(account->group_encrypted);
free(account->url_encrypted);
Expand Down Expand Up @@ -393,7 +394,7 @@ static struct account *account_parse(struct chunk *chunk, const unsigned char ke
entry_plain(attachkey_encrypted);
entry_boolean(attachpresent);
skip(individualshare);
skip(notetype);
entry_plain(notetype);
skip(noalert);
entry_plain(last_modified_gmt);
skip(hasbeenshared);
Expand Down
1 change: 1 addition & 0 deletions blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ struct account {
char *username, *username_encrypted;
char *password, *password_encrypted;
char *note, *note_encrypted;
char *notetype;
char *last_touch, *last_modified_gmt;
bool pwprotect;
bool fav;
Expand Down
2 changes: 2 additions & 0 deletions cmd-duplicate.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ int cmd_duplicate(int argc, char **argv)
new->fullname = xstrdup(found->fullname);
account_set_url(new, xstrdup(found->url), key, &session->feature_flag);
new->pwprotect = found->pwprotect;
if (found->notetype)
new->notetype = xstrdup(found->notetype);

list_for_each_entry(field, &found->field_head, list) {
copy_field = new0(struct field, 1);
Expand Down
13 changes: 13 additions & 0 deletions endpoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,19 @@ void lastpass_update_account(enum blobsync sync, unsigned const char key[KDF_HAS
http_post_add_params(&params, "url", url, NULL);
}

/*
* The redesigned web vault classifies an item as a secure note via a
* plaintext "notetype" param, not the legacy url=http://sn marker.
* Without it, CLI-created notes render as logins. Echo back the type the
* server gave us (preserving structured types on edit), defaulting to a
* generic note for newly created notes that have none yet.
*/
if (account_is_secure_note(account)) {
const char *notetype = (account->notetype && *account->notetype)
? account->notetype : "Generic";
http_post_add_params(&params, "notetype", notetype, NULL);
}

if (strlen(fields)) {
http_post_add_params(&params,
"save_all", "1",
Expand Down