Compare commits

..

2 Commits

Author SHA1 Message Date
d031c820ff
shim: expose checkPid in constructor
All checks were successful
test / test (push) Successful in 21s
This will be supported soon when launching via fsu.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-27 23:49:37 +09:00
5524e09a5f
fsu: implement simple setuid user switcher
All checks were successful
test / test (push) Successful in 20s
Contains path to fortify set at compile time, authenticates based on a simple uid range assignment file which also acts as the allow list.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-27 23:45:52 +09:00

View File

@ -91,7 +91,7 @@ func parseConfig(p string, puid int) (fid int, ok bool) {
} else if s.Mode().Perm() != 0400 { } else if s.Mode().Perm() != 0400 {
log.Fatal("bad fsurc perm") log.Fatal("bad fsurc perm")
} else if st := s.Sys().(*syscall.Stat_t); st.Uid != 0 || st.Gid != 0 { } else if st := s.Sys().(*syscall.Stat_t); st.Uid != 0 || st.Gid != 0 {
log.Fatal("fsurc must be owned by uid 0") log.Fatal("fsurc must be owner by uid 0")
} }
if r, err := os.Open(p); err != nil { if r, err := os.Open(p); err != nil {