From owner-freebsd-bugs@FreeBSD.ORG Wed Oct 20 01:50:24 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A1B0116A4CE for ; Wed, 20 Oct 2004 01:50:24 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7602043D53 for ; Wed, 20 Oct 2004 01:50:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9K1oO6J045633 for ; Wed, 20 Oct 2004 01:50:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9K1oO1j045632; Wed, 20 Oct 2004 01:50:24 GMT (envelope-from gnats) Resent-Date: Wed, 20 Oct 2004 01:50:24 GMT Resent-Message-Id: <200410200150.i9K1oO1j045632@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, wgrim@siue.edu Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B1D516A4CE for ; Wed, 20 Oct 2004 01:42:40 +0000 (GMT) Received: from siue.dnsalias.net (cv517-231.cv.siue.edu [146.163.219.231]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58F8B43D2D for ; Wed, 20 Oct 2004 01:42:40 +0000 (GMT) (envelope-from grimw@siue.dnsalias.net) Received: by siue.dnsalias.net (Postfix, from userid 1001) id AEF64C0FC; Tue, 19 Oct 2004 20:42:35 -0500 (CDT) Message-Id: <20041020014235.AEF64C0FC@siue.dnsalias.net> Date: Tue, 19 Oct 2004 20:42:35 -0500 (CDT) From: William Michael Grim To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: conf/72901: [PATCH]: Prevent printing when doing an scp (printing breaks SCP). X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: wgrim@siue.edu List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2004 01:50:24 -0000 >Number: 72901 >Category: conf >Synopsis: [PATCH]: Prevent printing when doing an scp (printing breaks SCP). >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 20 01:50:24 GMT 2004 >Closed-Date: >Last-Modified: >Originator: William Michael Grim >Release: FreeBSD 5.3-BETA7 i386 >Organization: Southern Illinois University at Edwardsville >Environment: System: FreeBSD siue.dnsalias.net 5.3-BETA7 FreeBSD 5.3-BETA7 #3: Mon Oct 18 23:46:43 CDT 2004 root@siue.dnsalias.net:/usr/obj/usr/src/sys/FREEBSD i386 >Description: When a user tries to 'scp' to another machine that is outputting fortunes, as bash does by default on FreeBSD, then scp will exit, printing only the first line of output instead of copying files. >How-To-Repeat: Have a host to which you are trying to scp print some lines to stdout through .profile or .bashrc. >Fix: The patch below is to patch /usr/share/skel/dot.profile and determines if the shell being run is interactive or not. If it is not interactive, then it does not print out fortunes. --- dot.profile.patch begins here --- --- /home/grimw/dot.profile Tue Oct 19 20:05:42 2004 +++ dot.profile Tue Oct 19 20:06:46 2004 @@ -21,4 +21,9 @@ # set ENV to a file invoked each time sh is started for interactive use. ENV=$HOME/.shrc; export ENV +# Don't print anything if this is not an interactive shell. +if [ ${-/*i*/i} != 'i' ]; then + return +fi + [ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips --- dot.profile.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: