From paul.coucher@demon.net  Tue Sep 23 03:49:33 2003
Return-Path: <paul.coucher@demon.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A395816A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 23 Sep 2003 03:49:33 -0700 (PDT)
Received: from sos.support.demon.net (sos.support.demon.net [194.217.150.1])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C0E9543FA3
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 23 Sep 2003 03:49:26 -0700 (PDT)
	(envelope-from paul.coucher@demon.net)
Received: from sos-connector1.southend.demon.net ([194.217.150.15])
	by sos.support.demon.net with esmtp (Exim 3.03 #1)
	id 1A1kjV-0002fc-00
	for FreeBSD-gnats-submit@freebsd.org; Tue, 23 Sep 2003 11:49:25 +0100
Received: by sos-connector1.southend.demon.net with Internet Mail Service (5.5.2653.19)
	id <SXPNM0P6>; Tue, 23 Sep 2003 11:49:25 +0100
Message-Id: <6FE6459486ECD411A7FE00508BEF02400AB2EFE0@sos-mailstore1>
Date: Tue, 23 Sep 2003 11:51:19 +0100
From: "Coucher, Paul" <paul.coucher@demon.net>
To: "'FreeBSD-gnats-submit@freebsd.org'" <FreeBSD-gnats-submit@freebsd.org>
Subject: send-pr:SMBFS incorrect LFN & 8.3 bad character handling.

>Number:         57123
>Category:       kern
>Synopsis:       SMBFS incorrect LFN & 8.3 bad character handling.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 23 03:50:08 PDT 2003
>Closed-Date:    Fri Jan 09 22:17:22 PST 2004
>Last-Modified:  Fri Jan 09 22:17:22 PST 2004
>Originator:     Paul Coucher - pcoucher@demon.net
>Release:        FreeBSD 4.8-RELEASE-p7 i386
>Organization:
Computacenter
>Environment:
System: FreeBSD isdevel.support.demon.net 4.8-RELEASE-p7 FreeBSD
4.8-RELEASE-p7 #0: Thu Sep 18 12:43:36 BST 2003
root@isdevel.support.demon.net:/usr/src/sys/compile/MYKERNEL i386


        
>Description:
        When a Windows SMBFS drive is mounted using mount_smbfs files of the
form:

username@foo.bar.com[1].txt

are not handled correctly. This can be tracked down to them containing "[]"
characters amongst other things.

I can see them, tab complete them under various shells, ls -l them by name,
but *not* rm them. When I try to rm them I get:
# rm username\@foo.bar.com\[1].txt
rm: username@foo.bar.com[1].txt : No such file or directory
# vi username\@foo.bar.com\[1].txt

shows the contents of the file, but gives:

error: username@foo.bar.com[1].txt: No such file or directory

when it is asked to update the file.

>How-To-Repeat:
        Mount a Windows SMBFS share that contains Internet Explorer cookies.
ls will function correctly, but rm or anything that tries to update them
won't.
 
>Fix:

I originally raised this in 2002 about 4.5, & Boris Popov sent me a patch,
but it didn't make the cvs repository despite a few prods. I attach the
relevant bits of a diff:

1080,1081c1075,1076
<       static const char *badchars = "*/\[]:<>=;?";
<       static const char *badchars83 = " +|,";
---
>       static const char *badchars = "*/\:<>;?";
>       static const char *badchars83 = " +|,[]=";
1237,1238c1232

The other characters should be verified too for sanity in LFNs & 8.3s.

Regards,
-- 
Paul Coucher
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: tjr 
State-Changed-When: Fri Sep 26 05:11:29 PDT 2003 
State-Changed-Why:  
I just committed a similar patch (I moved `=' to badchars83 too) and will 
MFC it in about a month. Thanks for the report. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57123 
State-Changed-From-To: patched->closed 
State-Changed-By: tjr 
State-Changed-When: Fri Jan 9 22:17:03 PST 2004 
State-Changed-Why:  
Fixed in -stable. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57123 
>Unformatted:
 X-send-pr-version: 3.113
 X-GNATS-Notify:
