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

Add new Homebrew path and fix security concern #1

Merged
merged 1 commit into from
May 21, 2021
Merged
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
14 changes: 8 additions & 6 deletions workflow/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ tell application "Finder"
set lpass_binary to "/usr/local/bin/lpass"
else if exists POSIX file "/opt/local/bin/lpass" then
set lpass_binary to "/opt/local/bin/lpass"
else if exists POSIX file "/opt/homebrew/bin/lpass" then
set lpass_binary to "/opt/homebrew/bin/lpass"
end if
end tell

Expand All @@ -305,7 +307,7 @@ if ("{query}" = "scriptlocationnotset") then
display notification "Please wait... the alfred search will be presented once login is complete." with title "LastPass Login"
end if

do shell script "/bin/bash -c '" & "export TERM=\"xterm-256color\" && export LPASS_ASKPASS=\"" & osascript & "\" && export LPASS_AGENT_TIMEOUT=" & login_timeout & " && " & lpass_binary & " login --trust \"" & login_email & "\" && clear && " & lpass_binary & " ls --sync=now > /dev/null 2>&1 && exit 0'"
do shell script "/bin/bash -c '" & "export TERM=\"xterm-256color\" && export LPASS_ASKPASS=\"" & osascript & "\" && export LPASS_AGENT_TIMEOUT=" & login_timeout & " && " & lpass_binary & " login \"" & login_email & "\" && clear && " & lpass_binary & " ls --sync=now > /dev/null 2>&1 && exit 0'"

if ("{query}" = "scriptlocationnotset") then
tell application id "com.runningwithcrayons.Alfred" to search "lp "
Expand Down Expand Up @@ -407,7 +409,7 @@ exit 1;
} else {

my $lpass_exec;
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass@) {
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass /opt/homebrew/bin/lpass@) {
$lpass_exec = $f
if (-x $f);
}
Expand Down Expand Up @@ -530,7 +532,7 @@ my ($agent, $agentErr, $agentErrCode) = capture {
};

my $lpass_exec;
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass@) {
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass /opt/homebrew/bin/lpass@) {
$lpass_exec = $f
if (-x $f);
}
Expand Down Expand Up @@ -669,7 +671,7 @@ exit 1;
} else {

my $lpass_exec;
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass@) {
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass /opt/homebrew/bin/lpass@) {
$lpass_exec = $f
if (-x $f);
}
Expand Down Expand Up @@ -768,7 +770,7 @@ print $results;
<integer>127</integer>
<key>script</key>
<string>#!/bin/bash
for f in lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass; do
for f in lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass /opt/homebrew/bin/lpass; do
if test -x $f; then
lpass_exec=$f
fi
Expand Down Expand Up @@ -827,7 +829,7 @@ my ($agent, $agentErr, $agentErrCode) = capture {
};

my $lpass_exec;
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass@) {
foreach my $f (qw@lpass /usr/local/bin/lpass /opt/local/bin/lpass /usr/bin/lpass /opt/homebrew/bin/lpass@) {
$lpass_exec = $f
if (-x $f);
}
Expand Down