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)
| 1282 | // |
| 1283 | // https://github.com/openssh/openssh-portable/blob/25bd659cc72268f2858c5415740c442ee950049f/session.c#L816 |
| 1284 | func 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. |
no test coverage detected