browserpass / browserpass-legacy

Legacy Browserpass repo, development is now happening at:
https://github.com/browserpass/browserpass-extension
MIT License
998 stars 87 forks source link

Presence of a folder named `browserpass` will trick developer mode. #324

Closed subdavis closed 5 years ago

subdavis commented 5 years ago

https://github.com/browserpass/browserpass/blob/2f191ad0a1cf3782142aa7ddb7d162b9f02d3253/install.sh#L82-L85

Problem

test -e checks if a file or folder exists. If a folder named browserpass exists, or a file is not executable, it will install in dev mode anyway. This will cause the browser to issue an error about how the native messaging host was not found. This got me when I was first installing browserpass

Solution

use test -f instead. This will verify that the file matched is indeed a file.

To be more thorough, test that it's an executable file:

[ -f "$BIN_DIR/browserpass" -a -x "$BIN_DIR/browserpass" ]

maximbaz commented 5 years ago

nice catch, thanks!

maximbaz commented 5 years ago

In v3 I went for using a Makefile to install and configure Browserpass, so I believe this is no longer an issue. If you can test now, please share your feedback in https://github.com/browserpass/browserpass/issues/331