comparison svr-chansession.c @ 1154:b1fabf797bd3

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.
author Guilhem Moulin <guilhem@fripost.org>
date Wed, 21 Oct 2015 22:08:47 +0800
parents aaf576b27a10
children a23386821e9f
comparison
equal deleted inserted replaced
1153:67d8a904f5a9 1154:b1fabf797bd3
812 li = chansess_login_alloc(chansess); 812 li = chansess_login_alloc(chansess);
813 login_login(li); 813 login_login(li);
814 login_free_entry(li); 814 login_free_entry(li);
815 815
816 #ifdef DO_MOTD 816 #ifdef DO_MOTD
817 if (svr_opts.domotd) { 817 if (svr_opts.domotd && !chansess->cmd) {
818 /* don't show the motd if ~/.hushlogin exists */ 818 /* don't show the motd if ~/.hushlogin exists */
819 819
820 /* 12 == strlen("/.hushlogin\0") */ 820 /* 12 == strlen("/.hushlogin\0") */
821 len = strlen(ses.authstate.pw_dir) + 12; 821 len = strlen(ses.authstate.pw_dir) + 12;
822 822