cmd/fpkg: rename shell to shellPath
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
64b6dc41ba
commit
4fa1e97026
@ -9,10 +9,10 @@ import (
|
|||||||
"git.gensokyo.uk/security/fortify/internal/fmsg"
|
"git.gensokyo.uk/security/fortify/internal/fmsg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const shell = "/run/current-system/sw/bin/bash"
|
const shellPath = "/run/current-system/sw/bin/bash"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if err := os.Setenv("SHELL", shell); err != nil {
|
if err := os.Setenv("SHELL", shellPath); err != nil {
|
||||||
log.Fatalf("cannot set $SHELL: %v", err)
|
log.Fatalf("cannot set $SHELL: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ func actionStart(args []string) {
|
|||||||
if !dropShell {
|
if !dropShell {
|
||||||
command[0] = app.Launcher
|
command[0] = app.Launcher
|
||||||
} else {
|
} else {
|
||||||
command[0] = shell
|
command[0] = shellPath
|
||||||
}
|
}
|
||||||
command = append(command, args[1:]...)
|
command = append(command, args[1:]...)
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ func withNixDaemon(
|
|||||||
) {
|
) {
|
||||||
fortifyAppDropShell(updateConfig(&fst.Config{
|
fortifyAppDropShell(updateConfig(&fst.Config{
|
||||||
ID: app.ID,
|
ID: app.ID,
|
||||||
Command: []string{shell, "-lc", "rm -f /nix/var/nix/daemon-socket/socket && " +
|
Command: []string{shellPath, "-lc", "rm -f /nix/var/nix/daemon-socket/socket && " +
|
||||||
// start nix-daemon
|
// start nix-daemon
|
||||||
"nix-daemon --store / & " +
|
"nix-daemon --store / & " +
|
||||||
// wait for socket to appear
|
// wait for socket to appear
|
||||||
@ -59,7 +59,7 @@ func withNixDaemon(
|
|||||||
func withCacheDir(action string, command []string, workDir string, app *bundleInfo, pathSet *appPathSet, dropShell bool, beforeFail func()) {
|
func withCacheDir(action string, command []string, workDir string, app *bundleInfo, pathSet *appPathSet, dropShell bool, beforeFail func()) {
|
||||||
fortifyAppDropShell(&fst.Config{
|
fortifyAppDropShell(&fst.Config{
|
||||||
ID: app.ID,
|
ID: app.ID,
|
||||||
Command: []string{shell, "-lc", strings.Join(command, " && ")},
|
Command: []string{shellPath, "-lc", strings.Join(command, " && ")},
|
||||||
Confinement: fst.ConfinementConfig{
|
Confinement: fst.ConfinementConfig{
|
||||||
AppID: app.AppID,
|
AppID: app.AppID,
|
||||||
Username: "nixos",
|
Username: "nixos",
|
||||||
@ -92,7 +92,7 @@ func withCacheDir(action string, command []string, workDir string, app *bundleIn
|
|||||||
|
|
||||||
func fortifyAppDropShell(config *fst.Config, dropShell bool, beforeFail func()) {
|
func fortifyAppDropShell(config *fst.Config, dropShell bool, beforeFail func()) {
|
||||||
if dropShell {
|
if dropShell {
|
||||||
config.Command = []string{shell, "-l"}
|
config.Command = []string{shellPath, "-l"}
|
||||||
fortifyApp(config, beforeFail)
|
fortifyApp(config, beforeFail)
|
||||||
beforeFail()
|
beforeFail()
|
||||||
internal.Exit(0)
|
internal.Exit(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user