-
Notifications
You must be signed in to change notification settings - Fork 290
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
Comments
FYI, "spaceship cpanel" is being interpreted as a folder name. |
Yep, btw grep works as expected. I removed this from the original comment. Eg:
So it seems that it's only a display issue. |
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" |
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>
ed892c0 should fix this. |
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>
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>
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>
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
The text was updated successfully, but these errors were encountered: