Hello community, here is the log from the commit of package lastpass-cli for openSUSE:Factory checked in at 2017-07-12 19:35:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lastpass-cli (Old) and /work/SRC/openSUSE:Factory/.lastpass-cli.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lastpass-cli" Wed Jul 12 19:35:46 2017 rev:5 rq:509457 version:1.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/lastpass-cli/lastpass-cli.changes 2017-06-09 15:57:23.319827802 +0200 +++ /work/SRC/openSUSE:Factory/.lastpass-cli.new/lastpass-cli.changes 2017-07-12 19:35:48.226062463 +0200 @@ -1,0 +2,7 @@ +Tue Jul 11 13:12:46 UTC 2017 - mplus...@suse.com + +- Update to version 1.2.0: + * fix regression with lpass show not displaying all fields for + secure notes + +------------------------------------------------------------------- Old: ---- lastpass-cli-1.2.0.tar.gz New: ---- lastpass-cli-1.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lastpass-cli.spec ++++++ --- /var/tmp/diff_new_pack.vCgOg6/_old 2017-07-12 19:35:48.809979979 +0200 +++ /var/tmp/diff_new_pack.vCgOg6/_new 2017-07-12 19:35:48.813979415 +0200 @@ -17,7 +17,7 @@ Name: lastpass-cli -Version: 1.2.0 +Version: 1.2.1 Release: 0 Summary: LastPass command line interface tool License: GPL-2.0 @@ -48,7 +48,7 @@ %build %cmake \ -DTEST_BUILD=ON -make %{?_smp_mflags} all doc-man +%make_jobs all doc-man %install %cmake_install install-doc @@ -57,7 +57,6 @@ make %{?_smp_mflags} test %files -%defattr(-,root,root) %doc CHANGELOG.md README.md COPYING %{_bindir}/lpass %{_mandir}/man1/lpass.1%{ext_man} ++++++ lastpass-cli-1.2.0.tar.gz -> lastpass-cli-1.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.0/CHANGELOG.md new/lastpass-cli-1.2.1/CHANGELOG.md --- old/lastpass-cli-1.2.0/CHANGELOG.md 2017-06-07 21:41:30.000000000 +0200 +++ new/lastpass-cli-1.2.1/CHANGELOG.md 2017-06-28 14:50:49.000000000 +0200 @@ -1,3 +1,10 @@ +# Version 1.2.1 + * Bugfix: fix regression with ```lpass show``` not displaying all fields + for secure notes + * Use sysctl instead of procfs for pid-to-cmd on some versions of BSD, + from Thomas Hurst + * Build: fix build for test binaries on OpenBSD, from Björn Ketelaars + # Version 1.2.0 * ```lpass show``` now supports new-style multiline ssh keys * ```lpass export``` now supports --fields=FIELDLIST argument to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.0/CMakeLists.txt new/lastpass-cli-1.2.1/CMakeLists.txt --- old/lastpass-cli-1.2.0/CMakeLists.txt 2017-06-07 21:41:30.000000000 +0200 +++ new/lastpass-cli-1.2.1/CMakeLists.txt 2017-06-28 14:50:49.000000000 +0200 @@ -82,11 +82,15 @@ COMPILE_DEFINITIONS ${PROJECT_DEFINITIONS} ) target_link_libraries(lpass-test ${LIBXML2_LIBRARIES} ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES}) +if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") + target_link_libraries(lpass-test "-lkvm") +endif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") enable_testing() add_test(test_login ${CMAKE_SOURCE_DIR}/test/tests test_login) add_test(test_login_wrong_pw_should_fail ${CMAKE_SOURCE_DIR}/test/tests test_login_wrong_pw_should_fail) add_test(test_add_account ${CMAKE_SOURCE_DIR}/test/tests test_add_account) add_test(test_add_note ${CMAKE_SOURCE_DIR}/test/tests test_add_note) +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_username ${CMAKE_SOURCE_DIR}/test/tests test_edit_username) @@ -95,6 +99,7 @@ add_test(test_duplicate ${CMAKE_SOURCE_DIR}/test/tests test_duplicate) add_test(test_generate ${CMAKE_SOURCE_DIR}/test/tests test_generate) add_test(test_show ${CMAKE_SOURCE_DIR}/test/tests test_show) +add_test(test_show_note ${CMAKE_SOURCE_DIR}/test/tests test_show_note) add_test(test_show_reprompt ${CMAKE_SOURCE_DIR}/test/tests test_show_reprompt) add_test(test_ls ${CMAKE_SOURCE_DIR}/test/tests test_ls) add_test(test_export ${CMAKE_SOURCE_DIR}/test/tests test_export) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.0/blob.c new/lastpass-cli-1.2.1/blob.c --- old/lastpass-cli-1.2.0/blob.c 2017-06-07 21:41:30.000000000 +0200 +++ new/lastpass-cli-1.2.1/blob.c 2017-06-28 14:50:49.000000000 +0200 @@ -1166,8 +1166,8 @@ for (start = acc->note; ; ) { name = value = NULL; - lf = strchr(start, '\n'); - if (!lf || lf == start) + lf = strchrnul(start, '\n'); + if (lf == start) goto skip; line = xstrndup(start, lf - start); @@ -1194,7 +1194,8 @@ * not a Proc-Type field. */ if (note_type != NOTE_TYPE_NONE && - !note_has_field(note_type, name) && field) { + !note_has_field(note_type, name) && field && + note_field_is_multiline(note_type, field->name)) { xstrappendf(&field->value, "\n%s", line); goto skip; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.0/debian/changelog new/lastpass-cli-1.2.1/debian/changelog --- old/lastpass-cli-1.2.0/debian/changelog 2017-06-07 21:41:30.000000000 +0200 +++ new/lastpass-cli-1.2.1/debian/changelog 2017-06-28 14:50:49.000000000 +0200 @@ -1,3 +1,9 @@ +lastpass-cli (1.2.1) unstable; urgency=medium + + * New upstream 1.2.1 + + -- Bob Copeland <copel...@lastpass.com> Wed, 28 Jun 2017 08:50:06 -0400 + lastpass-cli (1.2.0) unstable; urgency=medium * New upstream 1.2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.0/notes.c new/lastpass-cli-1.2.1/notes.c --- old/lastpass-cli-1.2.0/notes.c 2017-06-07 21:41:30.000000000 +0200 +++ new/lastpass-cli-1.2.1/notes.c 2017-06-28 14:50:49.000000000 +0200 @@ -121,6 +121,11 @@ return note_templates[note_type].name; } +bool note_field_is_multiline(enum note_type note_type, const char *field) +{ + return note_type == NOTE_TYPE_SSH_KEY && !strcmp(field, "Private Key"); +} + bool note_has_field(enum note_type note_type, const char *field) { const char **p; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.0/notes.h new/lastpass-cli-1.2.1/notes.h --- old/lastpass-cli-1.2.0/notes.h 2017-06-07 21:41:30.000000000 +0200 +++ new/lastpass-cli-1.2.1/notes.h 2017-06-28 14:50:49.000000000 +0200 @@ -36,6 +36,7 @@ extern struct note_template note_templates[]; const char *notes_get_name(enum note_type note_type); +bool note_field_is_multiline(enum note_type note_type, const char *field); bool note_has_field(enum note_type note_type, const char *field); enum note_type notes_get_type_by_shortname(const char *shortname); enum note_type notes_get_type_by_name(const char *type_str); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.0/process.c new/lastpass-cli-1.2.1/process.c --- old/lastpass-cli-1.2.0/process.c 2017-06-07 21:41:30.000000000 +0200 +++ new/lastpass-cli-1.2.1/process.c 2017-06-28 14:50:49.000000000 +0200 @@ -48,6 +48,9 @@ #include <libproc.h> #include <sys/ptrace.h> #define USE_PTRACE +#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) +#include <sys/param.h> +#include <sys/sysctl.h> #elif defined(__OpenBSD__) #include <sys/param.h> #include <sys/proc.h> @@ -73,17 +76,11 @@ #endif -#if defined(__linux__) || defined(__CYGWIN__) || defined(__NetBSD__) -#define DEVPROC_NAME "exe" -#elif defined(__FreeBSD__) || defined(__DragonFly__) -#define DEVPROC_NAME "file" -#endif - -#ifdef DEVPROC_NAME +#if defined(__linux__) || defined(__CYGWIN__) || (defined(__NetBSD__) && !defined(KERN_PROC_PATHNAME)) static int pid_to_cmd(pid_t pid, char *cmd, size_t cmd_size) { _cleanup_free_ char *proc; - xasprintf(&proc, "/proc/%lu/" DEVPROC_NAME, (unsigned long)pid); + xasprintf(&proc, "/proc/%lu/exe", (unsigned long)pid); return readlink(proc, cmd, cmd_size - 1); } #elif defined(__APPLE__) && defined(__MACH__) @@ -93,6 +90,13 @@ result = proc_pidpath(pid, cmd, cmd_size); return (result <= 0) ? -1 : 0; } +#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) +static int pid_to_cmd(pid_t pid, char *cmd, size_t cmd_size) +{ + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, pid }; + + return sysctl(mib, 4, cmd, &cmd_size, NULL, 0); +} #elif defined(__OpenBSD__) static int pid_to_cmd(pid_t pid, char *cmd, size_t cmd_size) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.0/test/tests new/lastpass-cli-1.2.1/test/tests --- old/lastpass-cli-1.2.0/test/tests 2017-06-07 21:41:30.000000000 +0200 +++ new/lastpass-cli-1.2.1/test/tests 2017-06-28 14:50:49.000000000 +0200 @@ -49,6 +49,21 @@ assert_str_eq "$(lpass show --sync=no --field=Number $name)" "000-00-0000" } +function test_add_note_with_notes +{ + login || return 1 + local name="test-add-note-with-notes" + cat<<__EOM__ | lpass add --sync=no --note-type=ssn --non-interactive $name +Name: $name +Number: 000-00-0000 +Note: This is my SSN +NoteType: Social Security +__EOM__ + assertz $? || return 1 + + assert_str_eq "$(lpass show --sync=no --field=Number $name)" "000-00-0000" +} + function test_add_ssn_name { login || return 1 @@ -163,6 +178,22 @@ assert_str_eq "$expected" "$out" } +function test_show_note +{ + login || return 1 + # note the extra space here because mock server includes one + # normally note fields are trimmed when saved + read -r -d '' expected <<__EOM__ +test-group/test-note [id: 0002] +Username: test-note-user +Password: test-note-password +Hostname: foo.example.com +NoteType: Server +__EOM__ + local out=$(lpass show --sync=no test-note) + assert_str_eq "$expected" "$out" +} + function test_show_reprompt { login || return 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastpass-cli-1.2.0/version.h new/lastpass-cli-1.2.1/version.h --- old/lastpass-cli-1.2.0/version.h 2017-06-07 21:41:30.000000000 +0200 +++ new/lastpass-cli-1.2.1/version.h 2017-06-28 14:50:49.000000000 +0200 @@ -1,2 +1,2 @@ -#define LASTPASS_CLI_VERSION "1.2.0" +#define LASTPASS_CLI_VERSION "1.2.1" #define LASTPASS_CLI_USERAGENT "LastPass-CLI/" LASTPASS_CLI_VERSION