Execute "login -f root" when gocage console

This commit is contained in:
yo 2022-07-10 21:13:36 +02:00
parent 35b75ee7fb
commit d16a2d6789

View File

@ -33,7 +33,8 @@ func shellJail(jail *Jail) error {
jid := strconv.Itoa(jail.JID)
err := syscall.Exec("/usr/sbin/jexec", []string{"jexec", jid, "/bin/csh"}, os.Environ())
//err := syscall.Exec("/usr/sbin/jexec", []string{"jexec", jid, "/bin/csh"}, os.Environ())
err := syscall.Exec("/usr/sbin/jexec", []string{"jexec", jid, "login", "-f", "root"}, os.Environ())
// We should never get here, as syscall.Exec replace the gocage binary execution with jexec
// This means the moment syscall.Exec fires, gocage execution halt.