fortify: print comp values early
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
673b648bd3
commit
e564b5bdec
@ -62,6 +62,10 @@ func main() {
|
||||
if flagVerbose {
|
||||
seccomp.CPrintln = log.Println
|
||||
}
|
||||
|
||||
// read comp values early to allow for early failure
|
||||
fmsg.Verbosef("version %s", internal.Version())
|
||||
fmsg.Verbosef("setuid helper at %s", internal.MustFsuPath())
|
||||
return nil
|
||||
}).
|
||||
Flag(&flagVerbose, "v", command.BoolFlag(false), "Print debug messages to the console").
|
||||
|
4
main.go
4
main.go
@ -73,6 +73,10 @@ func buildCommand(out io.Writer) command.Command {
|
||||
if flagVerbose {
|
||||
seccomp.CPrintln = log.Println
|
||||
}
|
||||
|
||||
// read comp values early to allow for early failure
|
||||
fmsg.Verbosef("version %s", internal.Version())
|
||||
fmsg.Verbosef("setuid helper at %s", internal.MustFsuPath())
|
||||
return nil
|
||||
}).
|
||||
Flag(&flagVerbose, "v", command.BoolFlag(false), "Print debug messages to the console").
|
||||
|
@ -83,7 +83,8 @@ machine.succeed(
|
||||
"fortify-fhs -c '(cd /tmp/src && go generate ./... && go test ./... && touch /tmp/success-gotest)' &> /tmp/gotest &")
|
||||
|
||||
# To check fortify's version:
|
||||
print(machine.succeed("sudo -u alice -i fortify version"))
|
||||
fortifyVersion = machine.succeed("sudo -u alice -i fortify version")
|
||||
print(fortifyVersion)
|
||||
|
||||
# Wait for Sway to complete startup:
|
||||
machine.wait_for_file("/run/user/1000/wayland-1")
|
||||
@ -101,7 +102,7 @@ print(machine.fail("sudo -u alice -i fsu"))
|
||||
# Verify PrintBaseError behaviour:
|
||||
if denyOutput != "fsu: uid 1001 is not in the fsurc file\n":
|
||||
raise Exception(f"unexpected deny output:\n{denyOutput}")
|
||||
if denyOutputVerbose != "fsu: uid 1001 is not in the fsurc file\nfortify: *cannot obtain uid from fsu: permission denied\n":
|
||||
if denyOutputVerbose != f"fortify: version {fortifyVersion}fortify: setuid helper at /run/wrappers/bin/fsu\nfsu: uid 1001 is not in the fsurc file\nfortify: *cannot obtain uid from fsu: permission denied\n":
|
||||
raise Exception(f"unexpected deny verbose output:\n{denyOutputVerbose}")
|
||||
|
||||
# Start fortify permissive defaults outside Wayland session:
|
||||
|
Loading…
Reference in New Issue
Block a user