fix: use mutex on lifecycle

This commit is contained in:
2026-07-11 19:20:22 +07:00
parent d7ec5e852b
commit efbff0f7f7
+4
View File
@@ -73,10 +73,14 @@ func (l *lifecycle) User() string {
} }
func (l *lifecycle) SetChannel(channel ssh.Channel) { func (l *lifecycle) SetChannel(channel ssh.Channel) {
l.mu.Lock()
defer l.mu.Unlock()
l.channel = channel l.channel = channel
} }
func (l *lifecycle) Channel() ssh.Channel { func (l *lifecycle) Channel() ssh.Channel {
l.mu.Lock()
defer l.mu.Unlock()
return l.channel return l.channel
} }