From le@univie.ac.at  Wed Jun 19 02:04:34 2002
Return-Path: <le@univie.ac.at>
Received: from pcle2.cc.univie.ac.at (pcle2.cc.univie.ac.at [131.130.2.177])
	by hub.freebsd.org (Postfix) with ESMTP id D9F1F37B404
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 19 Jun 2002 02:04:32 -0700 (PDT)
Received: from pcle2.cc.univie.ac.at (localhost [127.0.0.1])
	by pcle2.cc.univie.ac.at (8.12.3/8.12.3) with ESMTP id g5J94VAF006024
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 19 Jun 2002 11:04:31 +0200 (CEST)
	(envelope-from le@pcle2.cc.univie.ac.at)
Received: (from le@localhost)
	by pcle2.cc.univie.ac.at (8.12.3/8.12.3/Submit) id g5J94UaO006023;
	Wed, 19 Jun 2002 11:04:30 +0200 (CEST)
	(envelope-from le)
Message-Id: <200206190904.g5J94UaO006023@pcle2.cc.univie.ac.at>
Date: Wed, 19 Jun 2002 11:04:30 +0200 (CEST)
From: Lukas Ertl <le@univie.ac.at>
Reply-To: Lukas Ertl <le@univie.ac.at>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: can't write on smbfs with scp
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         39502
>Category:       kern
>Synopsis:       can't write on smbfs with scp
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tjr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 19 02:10:01 PDT 2002
>Closed-Date:    Mon Feb 03 16:35:11 PST 2003
>Last-Modified:  Mon Feb 03 16:35:11 PST 2003
>Originator:     Lukas Ertl
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
>Environment:
System: FreeBSD pcle2.cc.univie.ac.at 4.6-STABLE FreeBSD 4.6-STABLE #0: Mon Jun 17 15:47:18 CEST 2002 le@pcle2.cc.univie.ac.at:/usr/obj/usr/src/sys/PCLE2 i386


	
>Description:

I'm not able to write a file on an smbfs using scp. If /foobar is a
locally mounted smbfs from a remote Samba server, then

$ scp file.bla user@host:/foobar

and

$ scp user@host:file.bla /foobar

both fail, the former with "lost connection", the latter with "Bad address"
and "Write failed flushing stdout buffer. write stdout: Broken pipe".

In both cases the file is created on the smbfs but has 0 bytes length.
(Copying a file locally using cp works fine, though.)

The SMB server that exports the share is Samba 2.2.5-pre1. The machine
that mounts the share is 4.6-STABLE.

>How-To-Repeat:

Mount a Samba share using mount_smbfs, copy a file to it using scp.

>Fix:

	


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: tjr 
State-Changed-When: Mon Dec 2 18:41:23 PST 2002 
State-Changed-Why:  
This is actually a bug in OpenSSH, not smbfs, that occurs when the optimal 
filesystem block size is not a power of two. I have submitted a patch to 
the OpenSSH folks and I am awaiting their response. 

Here is the patch I submitted: 
http://people.freebsd.org/~tjr/openssh-scp-smbfs.diff 

Let me know if it doesn't fix the problem; it seemed to work for me. 


Responsible-Changed-From-To: freebsd-bugs->tjr 
Responsible-Changed-By: tjr 
Responsible-Changed-When: Mon Dec 2 18:41:23 PST 2002 
Responsible-Changed-Why:  
I will handle this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39502 
State-Changed-From-To: analyzed->patched 
State-Changed-By: tjr 
State-Changed-When: Mon Dec 16 16:18:48 PST 2002 
State-Changed-Why:  
des@ has committed my patch to scp. No plans to MFC it yet, hopefully it 
will get included when OpenSSH in -stable is upgraded to a newer version. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39502 
State-Changed-From-To: patched->closed 
State-Changed-By: tjr 
State-Changed-When: Mon Feb 3 16:34:33 PST 2003 
State-Changed-Why:  
des@ has MFC'd the new version of OpenSSH which includes the patch 
for this bug. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39502 
>Unformatted:
