Compare commits

..

2 Commits

Author SHA1 Message Date
10ef06a3b2
cmd/fpkg: app bundle helper
All checks were successful
Tests / Go tests (push) Successful in 43s
Nix / NixOS tests (push) Successful in 3m40s
This helper program creates fortify configuration for running an application bundle. The activate action wraps a home-manager activation package and ensures each generation gets activated once.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-26 13:21:49 +09:00
93e48a1590
internal: include path to fortify main program
Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-26 12:48:48 +09:00
3 changed files with 4 additions and 14 deletions

View File

@ -81,7 +81,6 @@ type SandboxConfig struct {
} }
type ExtraPermConfig struct { type ExtraPermConfig struct {
Ensure bool `json:"ensure,omitempty"`
Path string `json:"path"` Path string `json:"path"`
Read bool `json:"r,omitempty"` Read bool `json:"r,omitempty"`
Write bool `json:"w,omitempty"` Write bool `json:"w,omitempty"`
@ -89,12 +88,8 @@ type ExtraPermConfig struct {
} }
func (e *ExtraPermConfig) String() string { func (e *ExtraPermConfig) String() string {
buf := make([]byte, 0, 5+len(e.Path)) buf := make([]byte, 0, 4+len(e.Path))
buf = append(buf, '-', '-', '-') buf = append(buf, '-', '-', '-', ':')
if e.Ensure {
buf = append(buf, '+')
}
buf = append(buf, ':')
buf = append(buf, []byte(e.Path)...) buf = append(buf, []byte(e.Path)...)
if e.Read { if e.Read {
buf[0] = 'r' buf[0] = 'r'

View File

@ -65,7 +65,6 @@ type appSeal struct {
type sealedExtraPerm struct { type sealedExtraPerm struct {
name string name string
perms acl.Perms perms acl.Perms
ensure bool
} }
// Seal seals the app launch context // Seal seals the app launch context
@ -170,7 +169,6 @@ func (a *app) Seal(config *fst.Config) error {
if p.Execute { if p.Execute {
seal.extraPerms[i].perms = append(seal.extraPerms[i].perms, acl.Execute) seal.extraPerms[i].perms = append(seal.extraPerms[i].perms, acl.Execute)
} }
seal.extraPerms[i].ensure = p.Ensure
} }
// map sandbox config to bwrap // map sandbox config to bwrap

View File

@ -297,9 +297,6 @@ func (seal *appSeal) setupShares(bus [2]*dbus.Config, os linux.System) error {
if p == nil { if p == nil {
continue continue
} }
if p.ensure {
seal.sys.Ensure(p.name, 0700)
}
seal.sys.UpdatePermType(system.User, p.name, p.perms...) seal.sys.UpdatePermType(system.User, p.name, p.perms...)
} }