Skip to content

Commit

Permalink
all: replace execabs with os/exec
Browse files Browse the repository at this point in the history
os/exec no longer searches executablse in the current directory as of
Go 1.19. See https://go.dev/blog/path-security and https://go.dev/issue/43724.
  • Loading branch information
hajimehoshi committed May 3, 2024
1 parent 903ab67 commit c658a25
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/ebitenmobile/gobind.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"strings"

exec "golang.org/x/sys/execabs"
"golang.org/x/tools/go/packages"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/ebitenmobile/gomobile.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import (
_ "embed"
"fmt"
"os"
"os/exec"
"path/filepath"
"runtime"
"runtime/debug"

// Add a dependency on gomobile in order to get the version via debug.ReadBuildInfo().
_ "github.com/ebitengine/gomobile/geom"
exec "golang.org/x/sys/execabs"
)

//go:embed gobind.go
Expand Down
2 changes: 1 addition & 1 deletion cmd/ebitenmobile/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
"text/template"
"unicode"

exec "golang.org/x/sys/execabs"
"golang.org/x/tools/go/packages"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/png/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"go/parser"
"go/token"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"

exec "golang.org/x/sys/execabs"
"golang.org/x/tools/go/ast/astutil"
)

Expand Down
3 changes: 1 addition & 2 deletions internal/processtest/processtest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ import (
"bytes"
"context"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"sync"
"testing"
"time"

exec "golang.org/x/sys/execabs"
)

func isWSL() (bool, error) {
Expand Down

0 comments on commit c658a25

Please sign in to comment.