From owner-freebsd-questions@freebsd.org Fri Aug 26 11:20:28 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEFC1A94938 for ; Fri, 26 Aug 2016 11:20:28 +0000 (UTC) (envelope-from lists@bertram-scharpf.de) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FA1334C for ; Fri, 26 Aug 2016 11:20:27 +0000 (UTC) (envelope-from lists@bertram-scharpf.de) Received: from becker.bs.l ([85.180.1.53]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0LlFeI-1b5pUk43RG-00b4NJ for ; Fri, 26 Aug 2016 13:15:13 +0200 Received: from bsch by becker.bs.l with local (Exim 4.87 (FreeBSD)) (envelope-from ) id 1bdF6O-000IgC-91 for freebsd-questions@freebsd.org; Fri, 26 Aug 2016 13:15:12 +0200 Date: Fri, 26 Aug 2016 13:15:12 +0200 From: Bertram Scharpf To: freebsd-questions@freebsd.org Subject: login.conf: tc overwrites setenv Message-ID: <20160826111512.GA70960@becker.bs.l> Mail-Followup-To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.6.1 (2016-04-27) Sender: Bertram Scharpf X-Provags-ID: V03:K0:5Wj/GKCQff5nroDOu2shBVMvkVqDEBSJ/WHwPVC6LVuysdEBsWI Eciugwk6g/7ukbJg5J4//aa9/NCSJV9mOTndoadgGTc9CBGM6Yd3Nz7VB5B1xWUIe8rILoD XCJ3UQuJm45mSMhIwUvLYjBmRPiBUdVQezm5J40BZ4TgIInAT2D9/qywU5SoKG/siwzUAmm 3xVaZekx5VKKI5J/8UQ5Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:CUA+7FspO58=:dXEiTjbWVIiLRLUq5SgpaO OmqoJbvuNOPsc5KZjieQnHR3v9EVY21C22vmDpM8IHu4ncat7ilYLBadfjBnu6sYLlVFVRs7+ KszpvTkUGs2PABS9umB3uFgE+K4tldsgi14qXtKMse5YspAqEttB3U5djbIPNRVePWyLtZwba 6/1Bsrpl0JZknDtPYsactvEAgHTFneto+jXCK9qj3cDgMS6oMINDzBLgWCmHSMXoza9v00s42 o74PYiqsEUax/rzU658M3QoUHW85nS8OoQU7AyI5+yjuT8XCfbZ1gh2QAjddGszSFXQpg9er4 UivC0NRpm9laKoHpDVn7R4qGy4tu6c7GMypA1CBv4OH3+AUt+i061PEya60+1hkkGFVggjM9R fSUP+gplKgEMWbr0b/ds3+YtQk8pa6C4jkdWzOtAi9JIow1Pkc6q2vE9VOzADmfxkEBPwL3rd 4Ml/oK03c0a0+6UV1IkxR/9J4vGJL3JZfONKnE2fYLDpu/LBCwVoo+uacJeYNkl/oFoRMhdku ZFM5gAB/wiHPgz/ITqISL6ia4X92HsKX1gdAQI6V2nT2FTLAfdmeG/qyhkAeHwTTTht9k33A+ JlV+9q4af+jdh671PxFe4bQpa+6aYZ2Vkyx5+mkAdRlB3gOHj1MUPhnrfuUVDr3lUfnCO3/PU qmf0NNA6+iwATGn9A7wDwPQajI9ICl5b6BgwnnsPt70O6h7jRzLLCRO0KvXgW62THleI= X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 11:20:29 -0000 Hi, when I enter a displayless machine I want to start TMux immediately: $ ssh -t otherhost tmux -u Yet, this bypasses /etc/profile before the TMux server is started. As soon as TMux opens its first pane, a shell is opened and /etc/profile comes into respect. But while TMux is setting up its mode-keys option, it won't detect the EDITOR=vi in the profile. Therefore I added the EDITOR environment variable to /etc/login.conf. default:\ :setenv=[...],EDITOR=vi:\ :[...]: This works as long as I only use the "default" section. However, when I change the login class in vipw to "german" the effect disappears. german|German Users Accounts:\ :charset=UTF-8:\ :lang=de_DE.UTF-8:\ :setenv=LC_COLLATE=C:\ :tc=default: The tc directive imports all directives from "default" but then, "setenv" is overwritten. I thorougly examined this behaviour by setting further environment variables and by not calling TMux but a simple variable dump (see below). Is there a way to merge the setenv directives? Is there any better solution to my problem? On a Linux machine I solved it by calling pam_env in /etc/pam.d/sshd , but I can find no pam_env in FreeBSD. Thanks in advance. Bertram ________________________________________________________________ In /etc/login.conf: default:\ :setenv=[...],EDITOR=vi,WASHERE_DEFAULT=x:\ :[...]: german|German Users Accounts:\ :charset=UTF-8:\ :lang=de_DE.UTF-8:\ :setenv=LC_COLLATE=C,WASHERE_GERMAN=x:\ :tc=default: ----------------------------------------------------- #include #include int main(int argc, char **argv, char **env) { char **e; for (e = env; *e != 0; e++) printf( "%s\n", *e); return 0; } ---------------------------------------------------------------- Shell command: $ ssh -t otherhost ./showenv | grep ^WASHERE -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de