add shell to initpk

This commit is contained in:
sawka
2023-10-05 09:50:35 -07:00
parent b8ef07e064
commit adc4948d17
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -576,6 +576,7 @@ type InitPacketType struct {
HostName string `json:"hostname,omitempty"` HostName string `json:"hostname,omitempty"`
NotFound bool `json:"notfound,omitempty"` NotFound bool `json:"notfound,omitempty"`
UName string `json:"uname,omitempty"` UName string `json:"uname,omitempty"`
Shell string `json:"shell,omitempty"`
RemoteId string `json:"remoteid,omitempty"` RemoteId string `json:"remoteid,omitempty"`
} }
+2
View File
@@ -47,6 +47,7 @@ const MinMaxPtySize = 16 * 1024
const MaxMaxPtySize = 100 * 1024 * 1024 const MaxMaxPtySize = 100 * 1024 * 1024
const MaxRunDataSize = 1024 * 1024 const MaxRunDataSize = 1024 * 1024
const MaxTotalRunDataSize = 10 * MaxRunDataSize const MaxTotalRunDataSize = 10 * MaxRunDataSize
const ShellVarName = "SHELL"
const GetStateTimeout = 5 * time.Second const GetStateTimeout = 5 * time.Second
@@ -1432,6 +1433,7 @@ func MakeServerInitPacket() (*packet.InitPacketType, error) {
return nil, err return nil, err
} }
initPacket.State = shellState initPacket.State = shellState
initPacket.Shell = os.Getenv(ShellVarName)
initPacket.RemoteId, err = base.GetRemoteId() initPacket.RemoteId, err = base.GetRemoteId()
if err != nil { if err != nil {
return nil, err return nil, err