app: rename app implementation package
All checks were successful
Test / Create distribution (push) Successful in 26s
Test / Sandbox (push) Successful in 1m48s
Test / Fortify (push) Successful in 2m36s
Test / Sandbox (race detector) (push) Successful in 2m52s
Test / Fpkg (push) Successful in 3m32s
Test / Fortify (race detector) (push) Successful in 4m9s
Test / Flake checks (push) Successful in 1m4s
All checks were successful
Test / Create distribution (push) Successful in 26s
Test / Sandbox (push) Successful in 1m48s
Test / Fortify (push) Successful in 2m36s
Test / Sandbox (race detector) (push) Successful in 2m52s
Test / Fpkg (push) Successful in 3m32s
Test / Fortify (race detector) (push) Successful in 4m9s
Test / Flake checks (push) Successful in 1m4s
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
ae6f5ede19
commit
0d7c1a9a43
@ -13,7 +13,7 @@ import (
|
||||
"git.gensokyo.uk/security/fortify/command"
|
||||
"git.gensokyo.uk/security/fortify/fst"
|
||||
"git.gensokyo.uk/security/fortify/internal"
|
||||
"git.gensokyo.uk/security/fortify/internal/app"
|
||||
"git.gensokyo.uk/security/fortify/internal/app/setuid"
|
||||
"git.gensokyo.uk/security/fortify/internal/fmsg"
|
||||
"git.gensokyo.uk/security/fortify/internal/sys"
|
||||
"git.gensokyo.uk/security/fortify/sandbox"
|
||||
@ -62,7 +62,7 @@ func main() {
|
||||
Flag(&flagVerbose, "v", command.BoolFlag(false), "Print debug messages to the console").
|
||||
Flag(&flagDropShell, "s", command.BoolFlag(false), "Drop to a shell in place of next fortify action")
|
||||
|
||||
c.Command("shim", command.UsageInternal, func([]string) error { app.ShimMain(); return errSuccess })
|
||||
c.Command("shim", command.UsageInternal, func([]string) error { setuid.ShimMain(); return errSuccess })
|
||||
|
||||
{
|
||||
var (
|
||||
|
@ -5,20 +5,20 @@ import (
|
||||
"os"
|
||||
|
||||
"git.gensokyo.uk/security/fortify/fst"
|
||||
"git.gensokyo.uk/security/fortify/internal/app"
|
||||
"git.gensokyo.uk/security/fortify/internal/app/setuid"
|
||||
"git.gensokyo.uk/security/fortify/internal/fmsg"
|
||||
)
|
||||
|
||||
func mustRunApp(ctx context.Context, config *fst.Config, beforeFail func()) {
|
||||
rs := new(fst.RunState)
|
||||
a := app.MustNew(ctx, std)
|
||||
a := setuid.MustNew(ctx, std)
|
||||
|
||||
var code int
|
||||
if sa, err := a.Seal(config); err != nil {
|
||||
fmsg.PrintBaseError(err, "cannot seal app:")
|
||||
code = 1
|
||||
} else {
|
||||
code = app.PrintRunStateErr(rs, sa.Run(rs))
|
||||
code = setuid.PrintRunStateErr(rs, sa.Run(rs))
|
||||
}
|
||||
|
||||
if code != 0 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package app
|
||||
package setuid
|
||||
|
||||
import (
|
||||
"context"
|
@ -1,4 +1,4 @@
|
||||
package app_test
|
||||
package setuid_test
|
||||
|
||||
import (
|
||||
"git.gensokyo.uk/security/fortify/acl"
|
@ -1,4 +1,4 @@
|
||||
package app_test
|
||||
package setuid_test
|
||||
|
||||
import (
|
||||
"os"
|
@ -1,4 +1,4 @@
|
||||
package app_test
|
||||
package setuid_test
|
||||
|
||||
import (
|
||||
"fmt"
|
@ -1,4 +1,4 @@
|
||||
package app_test
|
||||
package setuid_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@ -8,7 +8,7 @@ import (
|
||||
"time"
|
||||
|
||||
"git.gensokyo.uk/security/fortify/fst"
|
||||
"git.gensokyo.uk/security/fortify/internal/app"
|
||||
"git.gensokyo.uk/security/fortify/internal/app/setuid"
|
||||
"git.gensokyo.uk/security/fortify/internal/sys"
|
||||
"git.gensokyo.uk/security/fortify/sandbox"
|
||||
"git.gensokyo.uk/security/fortify/system"
|
||||
@ -28,7 +28,7 @@ func TestApp(t *testing.T) {
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
a := app.NewWithID(tc.id, tc.os)
|
||||
a := setuid.NewWithID(tc.id, tc.os)
|
||||
var (
|
||||
gotSys *system.I
|
||||
gotContainer *sandbox.Params
|
||||
@ -38,7 +38,7 @@ func TestApp(t *testing.T) {
|
||||
t.Errorf("Seal: error = %v", err)
|
||||
return
|
||||
} else {
|
||||
gotSys, gotContainer = app.AppIParams(a, sa)
|
||||
gotSys, gotContainer = setuid.AppIParams(a, sa)
|
||||
}
|
||||
}) {
|
||||
return
|
@ -1,4 +1,4 @@
|
||||
package app
|
||||
package setuid
|
||||
|
||||
import (
|
||||
"errors"
|
@ -1,4 +1,4 @@
|
||||
package app
|
||||
package setuid
|
||||
|
||||
import (
|
||||
"git.gensokyo.uk/security/fortify/fst"
|
@ -1,4 +1,4 @@
|
||||
package app
|
||||
package setuid
|
||||
|
||||
import (
|
||||
"context"
|
@ -1,4 +1,4 @@
|
||||
package app
|
||||
package setuid
|
||||
|
||||
import (
|
||||
"bytes"
|
@ -1,4 +1,4 @@
|
||||
package app
|
||||
package setuid
|
||||
|
||||
import (
|
||||
"context"
|
@ -1,4 +1,4 @@
|
||||
package app
|
||||
package setuid
|
||||
|
||||
import (
|
||||
"strconv"
|
8
main.go
8
main.go
@ -19,7 +19,7 @@ import (
|
||||
"git.gensokyo.uk/security/fortify/dbus"
|
||||
"git.gensokyo.uk/security/fortify/fst"
|
||||
"git.gensokyo.uk/security/fortify/internal"
|
||||
"git.gensokyo.uk/security/fortify/internal/app"
|
||||
"git.gensokyo.uk/security/fortify/internal/app/setuid"
|
||||
"git.gensokyo.uk/security/fortify/internal/fmsg"
|
||||
"git.gensokyo.uk/security/fortify/internal/state"
|
||||
"git.gensokyo.uk/security/fortify/internal/sys"
|
||||
@ -73,7 +73,7 @@ func buildCommand(out io.Writer) command.Command {
|
||||
Flag(&flagVerbose, "v", command.BoolFlag(false), "Print debug messages to the console").
|
||||
Flag(&flagJSON, "json", command.BoolFlag(false), "Serialise output as JSON when applicable")
|
||||
|
||||
c.Command("shim", command.UsageInternal, func([]string) error { app.ShimMain(); return errSuccess })
|
||||
c.Command("shim", command.UsageInternal, func([]string) error { setuid.ShimMain(); return errSuccess })
|
||||
|
||||
c.Command("app", "Launch app defined by the specified config file", func(args []string) error {
|
||||
if len(args) < 1 {
|
||||
@ -284,14 +284,14 @@ func runApp(config *fst.Config) {
|
||||
ctx, stop := signal.NotifyContext(context.Background(),
|
||||
syscall.SIGINT, syscall.SIGTERM)
|
||||
defer stop() // unreachable
|
||||
a := app.MustNew(ctx, std)
|
||||
a := setuid.MustNew(ctx, std)
|
||||
|
||||
rs := new(fst.RunState)
|
||||
if sa, err := a.Seal(config); err != nil {
|
||||
fmsg.PrintBaseError(err, "cannot seal app:")
|
||||
internal.Exit(1)
|
||||
} else {
|
||||
internal.Exit(app.PrintRunStateErr(rs, sa.Run(rs)))
|
||||
internal.Exit(setuid.PrintRunStateErr(rs, sa.Run(rs)))
|
||||
}
|
||||
|
||||
*(*int)(nil) = 0 // not reached
|
||||
|
Loading…
Reference in New Issue
Block a user