Compare commits

..

3 Commits

Author SHA1 Message Date
96f7504403
system: optimise string formatting
Some checks failed
Test / Flake checks (push) Blocked by required conditions
Test / Create distribution (push) Successful in 25s
Test / Fortify (push) Successful in 2m38s
Test / Data race detector (push) Has been cancelled
Test / Fpkg (push) Has been cancelled
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-03-25 04:42:30 +09:00
b058268fac
test: check revert type selection
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-03-25 04:37:58 +09:00
28260caaa5
app: run in native sandbox
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-03-25 05:08:58 +09:00
3 changed files with 13 additions and 2 deletions

View File

@ -65,6 +65,7 @@ type appInfo struct {
func (app *appInfo) toFst(pathSet *appPathSet, argv []string, flagDropShell bool) *fst.Config {
config := &fst.Config{
ID: app.ID,
Path: argv[0],
Args: argv,
Confinement: fst.ConfinementConfig{
AppID: app.AppID,

View File

@ -16,7 +16,8 @@ func withNixDaemon(
app *appInfo, pathSet *appPathSet, dropShell bool, beforeFail func(),
) {
mustRunAppDropShell(ctx, updateConfig(&fst.Config{
ID: app.ID,
ID: app.ID,
Path: shellPath,
Args: []string{shellPath, "-lc", "rm -f /nix/var/nix/daemon-socket/socket && " +
// start nix-daemon
"nix-daemon --store / & " +
@ -64,6 +65,7 @@ func withCacheDir(
app *appInfo, pathSet *appPathSet, dropShell bool, beforeFail func()) {
mustRunAppDropShell(ctx, &fst.Config{
ID: app.ID,
Path: shellPath,
Args: []string{shellPath, "-lc", strings.Join(command, " && ")},
Confinement: fst.ConfinementConfig{
AppID: app.AppID,

View File

@ -301,7 +301,15 @@ func (l *Symlink) apply(*Params) error {
return msg.WrapErr(syscall.EBADE,
fmt.Sprintf("path %q is not absolute", l[1]))
}
if err := os.Symlink(l[0], toSysroot(l[1])); err != nil {
target := toSysroot(l[1])
if err := ensureFile(target, 0444, 0755); err != nil {
return err
}
if err := os.Remove(target); err != nil {
return msg.WrapErr(err, err.Error())
}
if err := os.Symlink(l[0], target); err != nil {
return msg.WrapErr(err, err.Error())
}
return nil