Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Nov 7, 2023
1 parent bf5f04e commit e5bea46
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
11 changes: 2 additions & 9 deletions cmd/launcher/uninstall_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,12 @@ func removeLauncher(ctx context.Context, identifier string) error {
fmt.Printf("error occurred while stopping/disabling launcher service, systemctl output %s: err: %s\n", string(out), err)
}

fileExists := func(f string) bool {
if _, err := os.Stat(f); err == nil {
return true
}
return false
}

// Tell the appropriate package manager to remove launcher
if cmd, err := allowedpaths.CommandContextWithLookup("dpkg", []string{"--purge", packageName}...); err == nil {
if cmd, err := allowedpaths.CommandContextWithLookup(ctx, "dpkg", []string{"--purge", packageName}...); err == nil {
if out, err := cmd.CombinedOutput(); err != nil {
fmt.Printf("error occurred while running dpkg --purge, output %s: err: %s\n", string(out), err)
}
} else if cmd, err := allowedpaths.CommandContextWithLookup("rpm", []string{"-e", packageName}...); err == nil {
} else if cmd, err := allowedpaths.CommandContextWithLookup(ctx, "rpm", []string{"-e", packageName}...); err == nil {
if out, err := cmd.CombinedOutput(); err != nil {
fmt.Printf("error occurred while running rpm -e, output %s: err: %s\n", string(out), err)
}
Expand Down
3 changes: 2 additions & 1 deletion ee/desktop/user/notify/notify_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/godbus/dbus/v5"
"github.com/kolide/launcher/pkg/allowedpaths"
)

type dbusNotifier struct {
Expand Down Expand Up @@ -180,7 +181,7 @@ func (d *dbusNotifier) sendNotificationViaNotifySend(n Notification) error {
args = append(args, "-i", d.iconFilepath)
}

cmd, err := allowedpaths.Command("notify-send", args...)
cmd, err := allowedpaths.CommandContextWithLookup("notify-send", args...)

Check failure on line 184 in ee/desktop/user/notify/notify_linux.go

View workflow job for this annotation

GitHub Actions / launcher (ubuntu-20.04)

not enough arguments in call to allowedpaths.CommandContextWithLookup

Check failure on line 184 in ee/desktop/user/notify/notify_linux.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

not enough arguments in call to allowedpaths.CommandContextWithLookup

Check failure on line 184 in ee/desktop/user/notify/notify_linux.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

not enough arguments in call to allowedpaths.CommandContextWithLookup

Check failure on line 184 in ee/desktop/user/notify/notify_linux.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

not enough arguments in call to allowedpaths.CommandContextWithLookup

Check failure on line 184 in ee/desktop/user/notify/notify_linux.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

not enough arguments in call to allowedpaths.CommandContextWithLookup

Check failure on line 184 in ee/desktop/user/notify/notify_linux.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

not enough arguments in call to allowedpaths.CommandContextWithLookup

Check failure on line 184 in ee/desktop/user/notify/notify_linux.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

not enough arguments in call to allowedpaths.CommandContextWithLookup

Check failure on line 184 in ee/desktop/user/notify/notify_linux.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

not enough arguments in call to allowedpaths.CommandContextWithLookup

Check failure on line 184 in ee/desktop/user/notify/notify_linux.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

not enough arguments in call to allowedpaths.CommandContextWithLookup
if err != nil {
return fmt.Errorf("creating command: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/allowedpaths/cmd_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package allowedpaths
var knownPaths = map[string]map[string]bool{
"cryptsetup": {
"/usr/sbin/cryptsetup": true,
"/sbin/cryptsetup", true
"/sbin/cryptsetup": true,
},
"dpkg": {
"/usr/bin/dpkg": true,
Expand Down Expand Up @@ -64,7 +64,7 @@ var knownPaths = map[string]map[string]bool{
},
"zpool": {
"/usr/sbin/zpool": true,
}
},
}

var knownPathPrefixes = []string{
Expand Down
2 changes: 1 addition & 1 deletion pkg/execwrapper/exec_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func Exec(ctx context.Context, argv0 string, argv []string, envv []string) error
// Now run it. This is faking exec, we need to distinguish
// between a failure to execute, and a failure in in the called program.
// I think https://github.com/golang/go/issues/26539 adds this functionality.
err := cmd.Run()
err = cmd.Run()

if cmd.ProcessState.ExitCode() == -1 {
if err == nil {
Expand Down

0 comments on commit e5bea46

Please sign in to comment.