diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-19 00:25:00 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-19 00:25:00 +0900 |
| commit | a748d40745611b471ee2a8dd79656aaa174eb03c (patch) | |
| tree | 6734d036b37ebd40798578a60cf54c2527515a60 /internal/app/share.go | |
| parent | 648e1d641a8b0ae7c5bc4899f84b884d4335c97f (diff) | |
app: store values with string representation
Improves code readability without changing memory layout.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/share.go')
| -rw-r--r-- | internal/app/share.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/app/share.go b/internal/app/share.go index bb244c83..4fd77466 100644 --- a/internal/app/share.go +++ b/internal/app/share.go @@ -68,7 +68,7 @@ func (seal *appSeal) setupShares(bus [2]*dbus.Config, os sys.State) error { seal.sys.UpdatePermType(system.User, targetTmpdirParent, acl.Execute) // ensure child tmpdir (e.g. `/tmp/fortify.%d/tmpdir/%d`) - targetTmpdir := path.Join(targetTmpdirParent, seal.sys.user.as) + targetTmpdir := path.Join(targetTmpdirParent, seal.sys.user.aid.String()) seal.sys.Ensure(targetTmpdir, 01700) seal.sys.UpdatePermType(system.User, targetTmpdir, acl.Read, acl.Write, acl.Execute) seal.sys.bwrap.Bind(targetTmpdir, "/tmp", false, true) @@ -126,9 +126,9 @@ func (seal *appSeal) setupShares(bus [2]*dbus.Config, os sys.State) error { // generate /etc/passwd and /etc/group seal.sys.bwrap.CopyBind("/etc/passwd", - []byte(username+":x:"+seal.sys.mappedIDString+":"+seal.sys.mappedIDString+":Fortify:"+homeDir+":"+sh+"\n")) + []byte(username+":x:"+seal.sys.mapuid.String()+":"+seal.sys.mapuid.String()+":Fortify:"+homeDir+":"+sh+"\n")) seal.sys.bwrap.CopyBind("/etc/group", - []byte("fortify:x:"+seal.sys.mappedIDString+":\n")) + []byte("fortify:x:"+seal.sys.mapuid.String()+":\n")) /* Display servers @@ -181,7 +181,7 @@ func (seal *appSeal) setupShares(bus [2]*dbus.Config, os sys.State) error { return fmsg.WrapError(ErrXDisplay, "DISPLAY is not set") } else { - seal.sys.ChangeHosts("#" + seal.sys.user.us) + seal.sys.ChangeHosts("#" + seal.sys.user.uid.String()) seal.sys.bwrap.SetEnv[display] = d seal.sys.bwrap.Bind("/tmp/.X11-unix", "/tmp/.X11-unix") } |
