I builded openssh with variable LOGIN_CAP=YES This give me a chance to using login capabilities in FreeBSD with openssh But some of login capabilities does not work For example, I assign russian class for user Russian class defined at /etc/logon.conf: russian:Russian Users Accounts:\ :charset=KOI8-R:\ :lang=ru_RU.KOI8-R:\ :tc=default: This adds two environment variables into environment of user: LANG & MM_CHARSET, when used standard login via telnet or console However when used openssh, then sshd does not setup LANG & MM_CHARSET into environment for user in russian class Code for this operation does not exists in openssh port ! You may apply next very small patch to already patched openssh port, then rebuild and reinstall openssh port to fix problem --- session.c.orig Tue Aug 29 14:07:20 2000 +++ session.c Tue Aug 29 15:06:09 2000 @@ -901,6 +901,10 @@ env[0] = NULL; if (!options.use_login) { +#ifdef LOGIN_CAP + char *var; +#endif /* LOGIN_CAP */ + /* Set basic environment. */ child_set_env(&env, &envsize, "USER", pw->pw_name); child_set_env(&env, &envsize, "LOGNAME", pw->pw_name); @@ -908,6 +912,12 @@ #ifdef LOGIN_CAP child_set_env(&env, &envsize, "PATH", login_getpath(lc, "path", _PATH_STDPATH)); + var= login_getcapstr(lc, "lang", NULL, NULL); + if ( var ) child_set_env(&env, &envsize, "LANG", var); + var= login_getcapstr(lc, "charset", NULL, NULL); + if ( var ) child_set_env(&env, &envsize, "MM_CHARSET", var); + var= login_getcapstr(lc, "timezone", NULL, NULL); + if ( var ) child_set_env(&env, &envsize, "TZ", var); #else /* LOGIN_CAP */ child_set_env(&env, &envsize, "PATH", _PATH_STDPATH); #endif /* LOGIN_CAP */ @@ -919,8 +929,11 @@ /* Normal systems set SHELL by default. */ child_set_env(&env, &envsize, "SHELL", shell); } +#ifdef LOGIN_CAP +#else /* LOGIN_CAP */ if (getenv("TZ")) child_set_env(&env, &envsize, "TZ", getenv("TZ")); +#endif /* LOGIN_CAP */ /* Set custom environment options from RSA authentication. */ while (custom_environment) { Fix: cd /usr/ports/security/openssh/patches Replace original patch file 'patch-au' with next file Rebuild and reinstall openssh port How-To-Repeat: Build and install openssh port with LOGIN_CAP: cd /usr/ports/security/openssh LOGIN_CAP=YES make build install Using chpass setup russian class for user joe Login as joe to openssh Test environment for variables LANG & MM_CHARSET: echo $LANG echo $MM_CHARSET This variables does not defined !!!
Responsible Changed From-To: freebsd-ports->green Over to maintainer
There are two new openssh ports now, does this apply to either of them since they have both been updated recently?
Responsible Changed From-To: green->dinoex Over to new maintainer
State Changed From-To: open->closed Committed, Thanks
> -----Original Message----- > From: David W. Chapman Jr. [mailto:dwcjr@inethouston.net] > Sent: Monday, June 25, 2001 11:46 AM > To: freebsd-gnats-submit@FreeBSD.org; odip@bionet.nsc.ru; > dinoex@FreeBSD.org; dwcjr@inethouston.net > Subject: Re: ports/21146: [patch] openssh with LOGIN_CAP > don't setup LANG & MM_CHARSET into environment > > > There are two new openssh ports now, does this apply to > either of them > since they have both been updated recently? This patch applied only to FreeBSD-3-STABLE branch and openssh port on it FreeBSD-4-STABLE have openssh inserted into main src tree and doesn't have this bug - login and sshd rewriten - environments variables are setuped correctly [ODiP] == Dmitry Grigorovich