diff --git a/pkg/packet/packet.go b/pkg/packet/packet.go index a8c0d033..d566ffb3 100644 --- a/pkg/packet/packet.go +++ b/pkg/packet/packet.go @@ -576,6 +576,7 @@ type InitPacketType struct { HostName string `json:"hostname,omitempty"` NotFound bool `json:"notfound,omitempty"` UName string `json:"uname,omitempty"` + Shell string `json:"shell,omitempty"` RemoteId string `json:"remoteid,omitempty"` } diff --git a/pkg/shexec/shexec.go b/pkg/shexec/shexec.go index 63337fa8..a2e27487 100644 --- a/pkg/shexec/shexec.go +++ b/pkg/shexec/shexec.go @@ -47,6 +47,7 @@ const MinMaxPtySize = 16 * 1024 const MaxMaxPtySize = 100 * 1024 * 1024 const MaxRunDataSize = 1024 * 1024 const MaxTotalRunDataSize = 10 * MaxRunDataSize +const ShellVarName = "SHELL" const GetStateTimeout = 5 * time.Second @@ -1432,6 +1433,7 @@ func MakeServerInitPacket() (*packet.InitPacketType, error) { return nil, err } initPacket.State = shellState + initPacket.Shell = os.Getenv(ShellVarName) initPacket.RemoteId, err = base.GetRemoteId() if err != nil { return nil, err