Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward slash is displayed as a new line #10

Closed
aygee opened this issue Oct 23, 2014 · 4 comments
Closed

Forward slash is displayed as a new line #10

aygee opened this issue Oct 23, 2014 · 4 comments

Comments

@aygee
Copy link

aygee commented Oct 23, 2014

Hi, first I'd like to thank you for the great tool. I love it!

One small problem is that forward slash is displayed as a new line (interpreted as a folder name) when doing 'lpass ls'

For example, I have an entry 'spaceship cpanel / ftp'.
'lpass ls' would show

spaceship cpanel
    ftp [id: xxxxxxx]
@wtfbbqhax
Copy link

FYI, "spaceship cpanel" is being interpreted as a folder name.

@aygee
Copy link
Author

aygee commented Oct 23, 2014

Yep, btw grep works as expected. I removed this from the original comment. Eg:

lpass ls | grep spaceship
spaceship cpanel / ftp [id: xxxxxxx]
lpass ls | grep ftp 
spaceship cpanel / ftp [id: xxxxxxx]

So it seems that it's only a display issue.

@bcopeland
Copy link
Contributor

I think what we should do here is convert backslash to newlines but not forward slashes... since internally a folder like "abc/def/ghi/xyz" is represented as a group called "abc\def\ghi" + site "xyz"

bcopeland pushed a commit that referenced this issue Dec 30, 2015
The original code made some wrong assumptions about how the pathnames
are organized.  Instead of forward slashes, backslashes are used
within group names to separate "folders" from "subfolders".  Site
names might have embedded forward slashes (or backslashes) and should
not be interpreted.

Instead of trying to re-parse out the structure from the fullname,
use what we know about the structure to build the tree directly.
While at it, tokenize foldernames to handle backslashes properly.

This fixes github issue #10.

Signed-off-by: Bob Copeland <copeland@lastpass.com>
@bcopeland
Copy link
Contributor

ed892c0 should fix this.

psiniemi pushed a commit to NitorCreations/lastpass-cli that referenced this issue Feb 5, 2016
The original code made some wrong assumptions about how the pathnames
are organized.  Instead of forward slashes, backslashes are used
within group names to separate "folders" from "subfolders".  Site
names might have embedded forward slashes (or backslashes) and should
not be interpreted.

Instead of trying to re-parse out the structure from the fullname,
use what we know about the structure to build the tree directly.
While at it, tokenize foldernames to handle backslashes properly.

This fixes github issue lastpass#10.

Signed-off-by: Bob Copeland <copeland@lastpass.com>
bket added a commit to bket/lastpass-cli that referenced this issue May 18, 2018
Running 'make test' on OpenBSD results in sporadicaly, random tests
failing. Cause is always the same; a segmentation fault in lpass-test.
Output of a backtrace:

(gdb) bt
\#0  strcmp () at /usr/src/lib/libc/arch/amd64/string/strcmp.S:19
\lastpass#1  0x00000ea544013432 in config_path_type (name=0xea82c7ca000 "upload-queue/15266634470001") at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/config.c:178
\lastpass#2  0x00000ea5440134e5 in config_path (name=0xea82c7ca000 "upload-queue/15266634470001") at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/config.c:195
\lastpass#3  0x00000ea544013891 in config_exists (name=0xea82c7ca000 "upload-queue/15266634470001") at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/config.c:218
\lastpass#4  0x00000ea54402189c in upload_queue_write_entry (
    entry=0xea7f3b3b800 "show_website.php\nextjs\n1\ntoken\nabcd\nmethod\ncli\nname\n!fJpRFXdBBSG+gDij1lHw6w==|+tGkaSkIoUbyhAQifugbxtKpS3GYoj1xDa0Vc+s5GIw=\ngrouping\n\npwprotect\noff\naid\n0\nurl\n687474703a2f2f736e\nusername\n\npassword\n\nextr"..., key=0x7f7ffffedee0 "S±íؽQóã\207ø_\223m1ÓÀE]\t2r\201=y_©\2320\033â\217!Tßþÿ\177\177")
    at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/upload-queue.c:90
\lastpass#5  0x00000ea5440217d4 in upload_queue_enqueue (sync=BLOB_SYNC_NO, key=0x7f7ffffedee0 "S±íؽQóã\207ø_\223m1ÓÀE]\t2r\201=y_©\2320\033â\217!Tßþÿ\177\177",
    session=0xea788620bc0, page=0xea54412c21c "show_website.php", params=0x7f7ffffedcd0) at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/upload-queue.c:435
\lastpass#6  0x00000ea544019ac1 in lastpass_update_account (sync=BLOB_SYNC_NO, key=0x7f7ffffedee0 "S±íؽQóã\207ø_\223m1ÓÀE]\t2r\201=y_©\2320\033â\217!Tßþÿ\177\177",
    session=0xea788620bc0, account=0xea7ab15f100, blob=0xea759c16880) at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/endpoints.c:225
\lastpass#7  0x00000ea544014ee6 in edit_account (session=0xea788620bc0, blob=0xea759c16880, sync=BLOB_SYNC_NO, editable=0xea7ab15f100, choice=EDIT_FIELD,
    field=0xea7cd5b2e10 "Public Key", non_interactive=true, key=0x7f7ffffedee0 "S±íؽQóã\207ø_\223m1ÓÀE]\t2r\201=y_©\2320\033â\217!Tßþÿ\177\177")
    at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/edit.c:597
\lastpass#8  0x00000ea54400a067 in cmd_edit (argc=5, argv=0x7f7ffffedfe0) at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/cmd-edit.c:139
\lastpass#9  0x00000ea54401df2d in process_command (argc=5, argv=0x7f7ffffedfe0) at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/lpass.c:164
\lastpass#10 0x00000ea54401dd22 in main (argc=6, argv=0x7f7ffffedfd8) at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/lpass.c:205
Current language:  auto; currently asm

Frame 1 shows something interesting:

(gdb) frame 1
\lastpass#1  0x00000ea544013432 in config_path_type (name=0xea82c7ca000 "upload-queue/15266634470001") at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/config.c:178
178		if (strlen(name) >= 5 && !strcmp(name-5, ".lock")) {
Current language:  auto; currently minimal

strcmp(name-5, ".lock") isn't right, and most likely should read
something like strcmp(name + strlen(name) - 5, ".lock").

Diff has been tested successfully on OpenBSD.

Signed-off-by: Björn Ketelaars <bjorn.ketelaars@hydroxide.nl>
bket added a commit to bket/lastpass-cli that referenced this issue May 18, 2018
Running 'make test' on OpenBSD results in sporadicaly, random tests
failing. Cause is always the same; a segmentation fault in lpass-test.
Output of a backtrace:

(gdb) bt
\#0  strcmp () at /usr/src/lib/libc/arch/amd64/string/strcmp.S:19
\lastpass#1  0x00000ea544013432 in config_path_type (name=0xea82c7ca000 "upload-queue/15266634470001") at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/config.c:178
\lastpass#2  0x00000ea5440134e5 in config_path (name=0xea82c7ca000 "upload-queue/15266634470001") at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/config.c:195
\lastpass#3  0x00000ea544013891 in config_exists (name=0xea82c7ca000 "upload-queue/15266634470001") at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/config.c:218
\lastpass#4  0x00000ea54402189c in upload_queue_write_entry (
    entry=0xea7f3b3b800 "show_website.php\nextjs\n1\ntoken\nabcd\nmethod\ncli\nname\n!fJpRFXdBBSG+gDij1lHw6w==|+tGkaSkIoUbyhAQifugbxtKpS3GYoj1xDa0Vc+s5GIw=\ngrouping\n\npwprotect\noff\naid\n0\nurl\n687474703a2f2f736e\nusername\n\npassword\n\nextr"..., key=0x7f7ffffedee0 "S±íؽQóã\207ø_\223m1ÓÀE]\t2r\201=y_©\2320\033â\217!Tßþÿ\177\177")
    at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/upload-queue.c:90
\lastpass#5  0x00000ea5440217d4 in upload_queue_enqueue (sync=BLOB_SYNC_NO, key=0x7f7ffffedee0 "S±íؽQóã\207ø_\223m1ÓÀE]\t2r\201=y_©\2320\033â\217!Tßþÿ\177\177",
    session=0xea788620bc0, page=0xea54412c21c "show_website.php", params=0x7f7ffffedcd0) at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/upload-queue.c:435
\lastpass#6  0x00000ea544019ac1 in lastpass_update_account (sync=BLOB_SYNC_NO, key=0x7f7ffffedee0 "S±íؽQóã\207ø_\223m1ÓÀE]\t2r\201=y_©\2320\033â\217!Tßþÿ\177\177",
    session=0xea788620bc0, account=0xea7ab15f100, blob=0xea759c16880) at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/endpoints.c:225
\lastpass#7  0x00000ea544014ee6 in edit_account (session=0xea788620bc0, blob=0xea759c16880, sync=BLOB_SYNC_NO, editable=0xea7ab15f100, choice=EDIT_FIELD,
    field=0xea7cd5b2e10 "Public Key", non_interactive=true, key=0x7f7ffffedee0 "S±íؽQóã\207ø_\223m1ÓÀE]\t2r\201=y_©\2320\033â\217!Tßþÿ\177\177")
    at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/edit.c:597
\lastpass#8  0x00000ea54400a067 in cmd_edit (argc=5, argv=0x7f7ffffedfe0) at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/cmd-edit.c:139
\lastpass#9  0x00000ea54401df2d in process_command (argc=5, argv=0x7f7ffffedfe0) at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/lpass.c:164
\lastpass#10 0x00000ea54401dd22 in main (argc=6, argv=0x7f7ffffedfd8) at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/lpass.c:205
Current language:  auto; currently asm

Frame 1 shows something interesting:

(gdb) frame 1
\lastpass#1  0x00000ea544013432 in config_path_type (name=0xea82c7ca000 "upload-queue/15266634470001") at /tmp/ports/pobj/lastpass-cli-1.3.1/lastpass-cli-1.3.1/config.c:178
178		if (strlen(name) >= 5 && !strcmp(name-5, ".lock")) {
Current language:  auto; currently minimal

strcmp(name-5, ".lock") isn't right, and most likely should read
something like strcmp(name + strlen(name) - 5, ".lock").

Diff has been tested successfully on OpenBSD: 'make test' runs
successfully, and lpass works as advertised.

Signed-off-by: Björn Ketelaars <bjorn.ketelaars@hydroxide.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants