Date: Wed, 22 Sep 2004 13:35:30 +0200 (CEST) From: Mikael Eklund <rma@ludd.ltu.se> To: FreeBSD-gnats-submit@FreeBSD.org Subject: conf/71994: Login shell may unnecessarily print "Exit 1" Message-ID: <200409221135.i8MBZUff047430@bumblebee.home> Resent-Message-ID: <200409221140.i8MBeO3M057717@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 71994 >Category: conf >Synopsis: Login shell may unnecessarily print "Exit 1" >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Sep 22 11:40:24 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Mikael Eklund >Release: FreeBSD 5.3-BETA4 i386 >Organization: Ludd (Luleå Academic Computer Society) >Environment: System: FreeBSD bumblebee 5.3-BETA4 FreeBSD 5.3-BETA4 #0: Wed Sep 15 05:35:37 CEST 2004 root@bumblebee:/usr/obj/usr/src/sys/BUMBLEBEE i386 tcsh-6.13.00 >Description: Under some rare circumstances your login shell may greet you with the single line: Exit 1 followed by your command prompt. To me, this looks scary and it made me wonder what went wrong. The problem is in the file /usr/share/skel/dot.login, that uses /bin/[ rather than a csh-syntax if-clause that always returns true (0), even if the test fails. >How-To-Repeat: Install a minimum distribution set, or at least one that does not include /usr/games/fortune. In your ~/.cshrc file, set the shell variable $printexitvalue. Log in, or start a new login terminal window: "xterm -ls". At login, the test for /usr/games/fortune will become false. Thus /bin/[ will return a status code of 1. This will be reported by tcsh, printing "Exit 1" alerting the user that something went wrong. >Fix: Apply the following patch. --- patch begins here --- --- share/skel/dot.login.old Sat Sep 11 14:29:27 2004 +++ share/skel/dot.login Wed Sep 15 04:49:15 2004 @@ -5,4 +5,4 @@ # see also csh(1), environ(7). # -[ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips +if ( -x /usr/games/fortune ) /usr/games/fortune freebsd-tips --- patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409221135.i8MBZUff047430>