MCPcopy Create free account
hub / github.com/coder/coder / isQuietLogin

Function isQuietLogin

agent/agentssh/agentssh.go:1284–1299  ·  view source on GitHub ↗

isQuietLogin checks if the SSH server should perform a quiet login or not. https://github.com/openssh/openssh-portable/blob/25bd659cc72268f2858c5415740c442ee950049f/session.c#L816

(fs afero.Fs, rawCommand string)

Source from the content-addressed store, hash-verified

1282//
1283// https://github.com/openssh/openssh-portable/blob/25bd659cc72268f2858c5415740c442ee950049f/session.c#L816
1284func isQuietLogin(fs afero.Fs, rawCommand string) bool {
1285 // We are always quiet unless this is a login shell.
1286 if !isLoginShell(rawCommand) {
1287 return true
1288 }
1289
1290 // Best effort, if we can't get the home directory,
1291 // we can't lookup .hushlogin.
1292 homedir, err := userHomeDir()
1293 if err != nil {
1294 return false
1295 }
1296
1297 _, err = fs.Stat(filepath.Join(homedir, ".hushlogin"))
1298 return err == nil
1299}
1300
1301// showAnnouncementBanner will write the service banner if enabled and not blank
1302// along with a blank line for spacing.

Callers 1

startPTYSessionMethod · 0.85

Calls 2

isLoginShellFunction · 0.85
userHomeDirFunction · 0.70

Tested by

no test coverage detected