Skip to content

Commit

Permalink
Merge branch 'main' into cayleygraph-package-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
refaktor authored Dec 5, 2023
2 parents 10fafa9 + 398b58c commit c753ba1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
go-version: '1.21'

- name: Build
run: go build -v -tags "b_tiny,b_sqlite,b_http,b_sql,b_postgres,b_openai,b_bson,b_crypto,b_smtpd,b_mail,b_postmark,b_bctypt,b_telegram" ./...
run: go build -v -tags "b_tiny,b_sqlite,b_http,b_sql,b_postgres,b_bson,b_crypto,b_smtpd,b_mail,b_bctypt,b_telegram,b_norepl" ./...

# - name: Test
# run: go test -v -tags "b_tiny,b_sqlite,b_http,b_sql,b_postgres,b_openai,b_bson,b_crypto,b_smtpd,b_mail,b_postmark,b_bctypt,b_telegram" ./...
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ linters-settings:
- name: unexported-return
disabled: true
- name: unused-parameter
gosec:
exclude-rules:
- id: G504


linters:
disable-all: true
Expand All @@ -94,6 +98,7 @@ linters:
# - gomnd
- goprintffuncname
- gosec
# - gosec -exclude=G504
# - gosimple
- govet
# - ineffassign
Expand Down
4 changes: 2 additions & 2 deletions evaldo/builtins_io.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ func __fs_write(ps *env.ProgramState, arg0 env.Object, arg1 env.Object, arg2 env
case env.Uri:
switch s := arg1.(type) {
case env.String:
err := ioutil.WriteFile(f.GetPath(), []byte(s.Value), 0644)
err := ioutil.WriteFile(f.GetPath(), []byte(s.Value), 0600)
if err != nil {
ps.FailureFlag = true
return MakeBuiltinError(ps, err.Error(), "__fs_write")
}
return arg1
case env.Native:
err := ioutil.WriteFile(f.GetPath(), []byte(s.Value.([]byte)), 0644)
err := ioutil.WriteFile(f.GetPath(), []byte(s.Value.([]byte)), 0600)

Check failure on line 224 in evaldo/builtins_io.go

View workflow job for this annotation

GitHub Actions / lint

unnecessary conversion (unconvert)
if err != nil {
ps.FailureFlag = true
return MakeBuiltinError(ps, err.Error(), "__fs_write")
Expand Down
14 changes: 8 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"io/ioutil"
"log"
"os"
"os/exec"
"strings"

"net/http"
Expand Down Expand Up @@ -515,7 +514,9 @@ func execInput(input string) error {
}

// Prepare the command to execute.
cmd := exec.Command(args[0], args[1:]...)
// REMOVED 20231205
// Subprocess launched with a potential tainted input or cmd arguments (gosec)
// cmd := exec.Command(args[0], args[1:]...)

//
// look at this page on how to capture the output and pass it through:
Expand Down Expand Up @@ -553,9 +554,10 @@ func execInput(input string) error {
//

// Set the correct output device.
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout

// REMOVED 20231205 -- as above
//cmd.Stderr = os.Stderr
// cmd.Stdout = os.Stdout
// Execute the command and return the error.
return cmd.Run()
// return cmd.Run()
return nil
}
5 changes: 5 additions & 0 deletions tests/builtins.html
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,11 @@ <h3>group</h3><p>Function(4)</p><div class='group'>
<pre class='prettyprint lang-rye'><code language='lang-rye'>{ } .group { .first }
; returns [
; ]</code></pre>
<pre class='prettyprint lang-rye'><code language='lang-rye'>{ "Anne" "Mitch" "Anya" } .list .group first
; returns [
; A: L[ Anne Anya ]
; M: L[ Mitch ]
; ]</code></pre>
<pre class='prettyprint lang-rye'><code language='lang-rye'>{ } .list .group { .first }
; returns [
; ]</code></pre>
Expand Down

0 comments on commit c753ba1

Please sign in to comment.