# HG changeset patch # User Guilhem Moulin # Date 1445436527 -28800 # Node ID b1fabf797bd35d715876349e398cd819a83f3d4a # Parent 67d8a904f5a949d2d5fac911027c5d19c0f798a7 Don't display the MOTD when an explicit command is run. (possibly via authorized_keys(5) restrictions), even when a pseudo-terminal has been allocated for the session. In other words, only display the MOTD when the server starts the user's default shell. diff -r 67d8a904f5a9 -r b1fabf797bd3 svr-chansession.c --- a/svr-chansession.c Wed Oct 21 22:05:50 2015 +0800 +++ b/svr-chansession.c Wed Oct 21 22:08:47 2015 +0800 @@ -814,7 +814,7 @@ login_free_entry(li); #ifdef DO_MOTD - if (svr_opts.domotd) { + if (svr_opts.domotd && !chansess->cmd) { /* don't show the motd if ~/.hushlogin exists */ /* 12 == strlen("/.hushlogin\0") */