From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Evan MacTaggart Newsgroups: gmane.emacs.bugs Subject: bug#55855: "Invalid file name" error with tramp-smb filename check Date: Thu, 9 Jun 2022 10:24:15 -0600 Message-ID: References: <875ylahuff.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006953df05e10641d7" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35326"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55855@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 09 19:24:08 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nzLt9-00092V-BD for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Jun 2022 19:24:07 +0200 Original-Received: from localhost ([::1]:35820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzLt8-0001yz-5i for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Jun 2022 13:24:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzKxz-0000HO-2G for bug-gnu-emacs@gnu.org; Thu, 09 Jun 2022 12:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzKxy-0002cZ-ON for bug-gnu-emacs@gnu.org; Thu, 09 Jun 2022 12:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nzKxy-0002cD-IF for bug-gnu-emacs@gnu.org; Thu, 09 Jun 2022 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Evan MacTaggart Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Jun 2022 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55855 X-GNU-PR-Package: emacs Original-Received: via spool by 55855-submit@debbugs.gnu.org id=B55855.165479187610015 (code B ref 55855); Thu, 09 Jun 2022 16:25:02 +0000 Original-Received: (at 55855) by debbugs.gnu.org; 9 Jun 2022 16:24:36 +0000 Original-Received: from localhost ([127.0.0.1]:47515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzKxX-0002bS-H5 for submit@debbugs.gnu.org; Thu, 09 Jun 2022 12:24:35 -0400 Original-Received: from mail-lf1-f47.google.com ([209.85.167.47]:37786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzKxV-0002bD-9F for 55855@debbugs.gnu.org; Thu, 09 Jun 2022 12:24:34 -0400 Original-Received: by mail-lf1-f47.google.com with SMTP id h23so38798926lfe.4 for <55855@debbugs.gnu.org>; Thu, 09 Jun 2022 09:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4+RLbXTMueoxFzRiFZ2wOqb7zFif0kfRAKAiBv5pgEA=; b=BTwP3LbusfReeYE0lqijnoRpmi3ak6BTJGKaQcDhBleMRpxptkW8Nar99gOeTOQn01 lYyt5p20paZdJnZ9tBU9AN91w8qKP2ny98g1Uop7ZZCFZCwc7nwiCja+ejmWKvS1VPzo +JMpowFY2Yh55MbDM8ThBYVqa1VNi4oyW8OIWOf1S4fEu0j/Yv0ay8+UPef845o/+D1P Fsr/y4cQj8+Gas3d0NPo8IQ79maKsUdi0NfgNPajJVdIt3qYy40+ll5HydkXK5UPIFNz /AnKn76r6bzDbLE98C1v4J0745J/ukyT3AmHJs9lgUQGPQb2HEOpfa+VaM+onRANr2Mu DUPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4+RLbXTMueoxFzRiFZ2wOqb7zFif0kfRAKAiBv5pgEA=; b=fGXHJIZ4GPZQF71DQ6sFRVod62xI6mL53SwFmgt8NIDKNbwij2Ad6EAYrQeKBZMHEM VBkZcXaEaxXYOY1J5KkqRbFKN6wo8IYfgvpxb/6Ik4O3aM9HF45mE2T40DuTSwzM9Zwo Yn2lGkn4DcAe8VprIFYjyjZ7jZCo4kgXH97Szr6CBgFbkP892T8hxOOBRwz1rC0CXKg0 EVpcNytCJjJaiunm8neaUv7ZkBIZkXJotkDAUmSGSNsWCKo4OO3IRpUQi1mxfzf8BSS6 M/YUDNdkYnwzqjxhF5GlEnP+2jslDOnwWn6OlniJw+OmVtrLjCUXjJQ867qr+nW5gXYn GyIA== X-Gm-Message-State: AOAM532caq9RXpOij3HdRPu5wQzZX7LE2hNQLm1ebJrL7xiQIwwLUwQM vxkf8mO3RFm3hgpxQtRKYGxE3i5b0tdHXjCILN0= X-Google-Smtp-Source: ABdhPJy7hC9+IDB61r7CGMBft6tB74j5ExW+vRNOGrDS4IbIvhHaaTp+C66c0n3ufchS9e+zn7NLii01sUDr5tLQSuk= X-Received: by 2002:a05:6512:2806:b0:47b:57ad:4ffd with SMTP id cf6-20020a056512280600b0047b57ad4ffdmr3945398lfb.601.1654791867026; Thu, 09 Jun 2022 09:24:27 -0700 (PDT) In-Reply-To: <875ylahuff.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:234127 Archived-At: --0000000000006953df05e10641d7 Content-Type: text/plain; charset="UTF-8" Hey Michael, I gave your changes a rip (via the latest emacs-28 branch (22a832ad82ed7d099e6ee3a947a5841d84e475c4)) and they worked like a charm! I was able to open/save/copy/move/delete both files and directories with names containing ". ". Thanks for the speedy response and the quick fix, you are awesome! Cheers, Evan MacTaggart On Thu, Jun 9, 2022 at 6:51 AM Michael Albinus wrote: > Evan MacTaggart writes: > > Hi Evan, > > > So after tramping into an SMB file server, I'm trying to find-file > > into a directory whose name is as so: "/smb:username%DOMAIN@fsname:/my > > path/1234. Some Name". The problem with this filename is that the > > filename contains a ". ", which throws a tramp-error. And as per the > > code comment is "not supported", however it seems as though, at least > > for the server I'm connected to, this is supported. > > Thanks for the report and the analysis! > > > I'm certainly not the most well versed on the samba protocol, but > > perhaps look into this and see if the once invalid file names are now > > valid. Or perhaps describe specifically what is not supported about > > this filename. I'd imagine/assume this is due to a newer SMB version > > than what the following code was initially written for. > > I've digged into this, and you are right: There is no SMB protocol > problem. There is an error in tramp-smb-handle-write-region, which > didn't quote tmpfile when sending "put ...". Since it wasn't detected > earlier, it was regarded as problem of SMB, resulting in the wrong > check. > > I've fixed this now, and I've also adapted the check in > tramp-smb-get-localname. Pushed to the emacs-28 git branch. Will appear > with Emacs 28.2 as well as with the next GNU ELPA Tramp release (2.5.3 > or 2.6.0, not decided yet). > > > Thanks in advance, and let me know if there's anything else you need > > from me. > > You could test with the emacs-28 git branch. For the master branch, I > haven't pushed a fix yet, because I'd like to rework it for being more > robust. If you don't use a git clone, you can consult the patch at > < > https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-28&id=3fd08543782d0d417eaa2dda0727ea16b3271710>. > Does > it work for you as well? > > > Cheers, > > Evan MacTaggart > > Best regards, Michael. > --0000000000006953df05e10641d7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey Michael,

I gave your changes a = rip (via the latest emacs-28 branch (22a832ad82ed7d099e6ee3a947a5841d84e475= c4)) and they worked like a charm! I was able to open/save/copy/move/delete= both files and directories with names containing ". ". Thanks fo= r the speedy response and the quick fix, you are awesome!

Cheers,
Evan MacTaggart


On Thu, Jun 9, 2022 at 6:51 AM Michael Albinus &l= t;michael.albinus@gmx.de> = wrote:
Evan MacT= aggart <e= van.mactaggart@gmail.com> writes:

Hi Evan,

> So after tramping into an SMB file server, I'm trying to find-file=
> into a directory whose name is as so: "/smb:username%DOMAIN@fsnam= e:/my
> path/1234. Some Name".=C2=A0 The problem with this filename is th= at the
> filename contains a ". ", which throws a tramp-error. And as= per the
> code comment is "not supported", however it seems as though,= at least
> for the server I'm connected to, this is supported.

Thanks for the report and the analysis!

> I'm certainly not the most well versed on the samba protocol, but<= br> > perhaps look into this and see if the once invalid file names are now<= br> > valid. Or perhaps describe specifically what is not supported about > this filename. I'd imagine/assume this is due to a newer SMB versi= on
> than what the following code was initially written for.

I've digged into this, and you are right: There is no SMB protocol
problem. There is an error in tramp-smb-handle-write-region, which
didn't quote tmpfile when sending "put ...". Since it wasn= 9;t detected
earlier, it was regarded as problem of SMB, resulting in the wrong
check.

I've fixed this now, and I've also adapted the check in
tramp-smb-get-localname. Pushed to the emacs-28 git branch. Will appear
with Emacs 28.2 as well as with the next GNU ELPA Tramp release (2.5.3
or 2.6.0, not decided yet).

> Thanks in advance, and let me know if there's anything else you ne= ed
> from me.

You could test with the emacs-28 git branch. For the master branch, I
haven't pushed a fix yet, because I'd like to rework it for being m= ore
robust. If you don't use a git clone, you can consult the patch at
<https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=3De= macs-28&id=3D3fd08543782d0d417eaa2dda0727ea16b3271710>. Does
it work for you as well?

> Cheers,
> Evan MacTaggart

Best regards, Michael.
--0000000000006953df05e10641d7--