Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Oct 2004 20:42:35 -0500 (CDT)
From:      William Michael Grim <grimw@siue.dnsalias.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   conf/72901: [PATCH]: Prevent printing when doing an scp (printing breaks SCP).
Message-ID:  <20041020014235.AEF64C0FC@siue.dnsalias.net>
Resent-Message-ID: <200410200150.i9K1oO1j045632@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041020014235.AEF64C0FC>