From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 08 14:23:02 2022 Received: (at submit) by debbugs.gnu.org; 8 Jun 2022 18:23:02 +0000 Received: from localhost ([127.0.0.1]:44268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nz0Kb-0001At-SK for submit@debbugs.gnu.org; Wed, 08 Jun 2022 14:23:02 -0400 Received: from lists.gnu.org ([209.51.188.17]:43496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyzu5-0000T9-Fl for submit@debbugs.gnu.org; Wed, 08 Jun 2022 13:55:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyzu5-0007AL-6R for bug-gnu-emacs@gnu.org; Wed, 08 Jun 2022 13:55:37 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:36809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyzu3-0001a6-En for bug-gnu-emacs@gnu.org; Wed, 08 Jun 2022 13:55:36 -0400 Received: by mail-lf1-x132.google.com with SMTP id i29so17615544lfp.3 for ; Wed, 08 Jun 2022 10:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=0iqmSDj07b0EBDpmtKLs5Z+2scAaqCGZfHcqrjMmaFg=; b=lJCsdffOfUr7St8olEn/t08YkESbdZM8U96h60A8VnwZjD8Lme1qe3ON/zb8vUdqTd /7PZh24/AxMhiWhpNWDybmWhmbfWsflsX/Jcdv/xIjSRNnw9Qt10FPxLOQArvhU8ydy5 Loqu8gGkDW+v+gkAmMJ1AJWTS7Y3OR9d9M0Z5V4DK4qXR0dPj36Mvh9JlEVMFQzp65n0 A1l9ao8SgPoz1UJdk/OhoqMpR1+yIUF2Kp5V0VyPiXrSf+zNQJHwGMokjVyOPQsIqE+F 9tm2rvB148BaC/Kfd/9RrDDjb5lqlqmPFiFcUJIBWCg5xfkU0In7GUFzFsSpINY0YeYn H+Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=0iqmSDj07b0EBDpmtKLs5Z+2scAaqCGZfHcqrjMmaFg=; b=t3LywCTIBPZHECnDiRDtrbYojqAwjoYHELVrwGoLur4XTZcsXDcHklgPKNuLfE/i2r FuIHKGqqBprguaoOFCgjBXunI44vweSuXN7wrwCx2r7njA3Yl2fm8zJu0Rf/2UpC0jra 7KHMOCBkN12vKDgnF74B0Pz85EDEsd3jQ3CunQI0Lk4R5wdaC1XXmKhc3RNk3xiCCrAM M3jCVtuA6h/Zy3l9S93bZoPaj6wUoFUkf6z+1v5A5SHY7+0RSsqqzuZTzDcYkPacL+R5 B7+grRTHhwPNuwmKjMV2/v5RU+D7xAEvxp25xXxPX6sWhyTmqzWSeNPjCk+YzQbXqOo0 xXEA== X-Gm-Message-State: AOAM533Nj8MS+WsFDW/BNyFQQLaZTG1PjuyZt/eCv3ayCOBg+djQxek0 eD4fkJjJtlI1S8OxF2FsaoHzVweFXXuEZ88CwzIeWMDkoMyAuQ== X-Google-Smtp-Source: ABdhPJx3Ownn3ejE1JOGDDoDABqVBHKz3RGecKLuCuTqUwvGa4z/etmPIBXdF3TWGobgXcENjjTgbIIgYHAjWYAwru4= X-Received: by 2002:a19:6445:0:b0:479:141c:cb5b with SMTP id b5-20020a196445000000b00479141ccb5bmr20210833lfj.280.1654710932992; Wed, 08 Jun 2022 10:55:32 -0700 (PDT) MIME-Version: 1.0 From: Evan MacTaggart Date: Wed, 8 Jun 2022 11:55:21 -0600 Message-ID: Subject: "Invalid file name" error with tramp-smb filename check To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="0000000000005df62905e0f36908" Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=evan.mactaggart@gmail.com; helo=mail-lf1-x132.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 08 Jun 2022 14:23:00 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --0000000000005df62905e0f36908 Content-Type: text/plain; charset="UTF-8" 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. 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. The following is where the check happens, ``` ;; /28.1/lisp/net/tramp-smb.el.gz ;; (defun tramp-smb-get-localname (vec) "Return the file name of LOCALNAME. If VEC has no cifs capabilities, exchange \"/\" by \"\\\\\"." (save-match-data (let ((localname (tramp-file-name-unquote-localname vec))) (setq localname (if (string-match "^/?[^/]+\\(/.*\\)" localname) ;; There is a share, separated by "/". (if (not (tramp-smb-get-cifs-capabilities vec)) (mapconcat (lambda (x) (if (equal x ?/) "\\" (char-to-string x))) (match-string 1 localname) "") (match-string 1 localname)) ;; There is just a share. (if (string-match "^/?\\([^/]+\\)$" localname) (match-string 1 localname) ""))) ;; Sometimes we have discarded `substitute-in-file-name'. (when (string-match "\\(\\$\\$\\)\\(/\\|$\\)" localname) (setq localname (replace-match "$" nil nil localname 1))) ;; A period followed by a space, or trailing periods and spaces, ;; are not supported. (when (string-match-p "\\. \\|\\.$\\| $" localname) ;; <<<< THIS CHECK HERE <<<<< (tramp-error vec 'file-error "Invalid file name %s" (tramp-make-tramp-file-name vec localname))) localname))) ``` My work around for this was to redefine tramp-smb-get-localname with looser filename checking. Thanks in advance, and let me know if there's anything else you need from me. Cheers, Evan MacTaggart --0000000000005df62905e0f36908 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
So after tramping into an SMB file server, I'm tr= ying to find-file into a directory whose name is as so: "/smb:username= %DOMAIN@fsname:/my path/1234. Some Name".=C2=A0 The problem with this = filename is that the filename contains a ". ", which throws a tra= mp-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.

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 supporte= d about this filename. I'd imagine/assume this is due to a newer SMB ve= rsion than what the following code was initially written for.
=
The following is where the check happens,
```
;; /28.1/lisp/net/tramp-smb.el.gz ;;
(defun tramp= -smb-get-localname (vec)
=C2=A0 "Return the file name of LOCALNAME.=
If VEC has no cifs capabilities, exchange \"/\" by \"\\\= \\"."
=C2=A0 (save-match-data
=C2=A0 =C2=A0 (let ((localnam= e (tramp-file-name-unquote-localname vec)))
=C2=A0 =C2=A0 =C2=A0 (setq=C2=A0 =C2=A0 =C2=A0 =C2=A0localname
=C2=A0 =C2=A0 =C2=A0 =C2=A0(if (s= tring-match "^/?[^/]+\\(/.*\\)" localname)
=C2=A0 ;; There i= s a share, separated by "/".
=C2=A0 (if (not (tramp-smb-get-= cifs-capabilities vec))
=C2=A0 =C2=A0 =C2=A0 (mapconcat
(lambda (= x) (if (equal x ?/) "\\" (char-to-string x)))
(match-string = 1 localname) "")
=C2=A0 =C2=A0 (match-string 1 localname)) ;; There is just a share.
(if (string-match "^/?\\([^/]+\\)$&= quot; localname)
=C2=A0 =C2=A0 (match-string 1 localname)
=C2=A0 = "")))

=C2=A0 =C2=A0 =C2=A0 ;; Sometimes we have discarded = `substitute-in-file-name'.
=C2=A0 =C2=A0 =C2=A0 (when (string-match = "\\(\\$\\$\\)\\(/\\|$\\)" localname)
(setq localname (replace= -match "$" nil nil localname 1)))

=C2=A0 =C2=A0 =C2=A0 ;; = A period followed by a space, or trailing periods and spaces,
=C2=A0 =C2= =A0 =C2=A0 ;; are not supported.
=C2=A0 =C2=A0 =C2=A0 (when (string-matc= h-p "\\. \\|\\.$\\| $" localname) ;; <<<< THIS CHECK = HERE <<<<<
(tramp-error
vec 'file-error
&q= uot;Invalid file name %s" (tramp-make-tramp-file-name vec localname)))=

=C2=A0 =C2=A0 =C2=A0 localname)))
```

My work = around for this was to redefine tramp-smb-get-localname with looser filenam= e checking.

Thanks in advance, and let me know if there&= #39;s anything else you need from me.

Cheers,
Evan MacTaggart
--0000000000005df62905e0f36908-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 09 08:51:10 2022 Received: (at 55855) by debbugs.gnu.org; 9 Jun 2022 12:51:11 +0000 Received: from localhost ([127.0.0.1]:45346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzHd0-0001qu-LP for submit@debbugs.gnu.org; Thu, 09 Jun 2022 08:51:10 -0400 Received: from mout.gmx.net ([212.227.17.21]:54143) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzHcz-0001qf-9v for 55855@debbugs.gnu.org; Thu, 09 Jun 2022 08:51:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1654779062; bh=hyG/hcPv05dmMdWxngmxUgkpNexmIFukxiembA8RWuc=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=XvrJcfwOMx1Ih0uQ1A0X5qLGicBxe/AWlBpjnpBS51kJeHWCrz5a1bOfZ5lgXeRh2 pOckFbVpSNEExSQnbKaqoIGncIN/PB/C6GUpmupz1w31mOhetLukAOXM4NboBLU+vu Dp190lASOgLPeN7h8+n1D7HdMEqicYCk4j+jJoe4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([213.220.151.112]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MyKHc-1npBKD3YYm-00ylKS; Thu, 09 Jun 2022 14:51:01 +0200 From: Michael Albinus To: Evan MacTaggart Subject: Re: bug#55855: "Invalid file name" error with tramp-smb filename check References: Date: Thu, 09 Jun 2022 14:51:00 +0200 In-Reply-To: (Evan MacTaggart's message of "Wed, 8 Jun 2022 11:55:21 -0600") Message-ID: <875ylahuff.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:VcC6aB+MNjVuMKOdzMSxwk+AyR145KmF8CO6Mum4iPHQxpeyy3R uC4udsGa+AqxCLR+ikqbaWMrSlaD5SJKNRtVHYegDcKHqAHloyY2HHlt80ECKYtHIfJ2FEY Q4OZYfwtV+1TG0h5mhjT6ehZBJGngcP6dBO70mBQUrKZwNUomfUCQNFk0ZFmiVFrVrMKAmE aGtHvCy6lYx0g7J72ApuQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:YoVzohoic9Y=:uZ7S26Kc9NtvJ4GK9yVRcc 6AO5cLb9Nn6fbag8CeXjlB8BBsFDDZjV5R+S3LAb/NDfXYN9L3p4TIrgz8rmLKQc0Etdjup1e ywTpNN3t9w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maw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55855 Cc: 55855@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 . Does it work for you as well? > Cheers, > Evan MacTaggart Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 09 12:24:36 2022 Received: (at 55855) by debbugs.gnu.org; 9 Jun 2022 16:24:36 +0000 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 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 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) MIME-Version: 1.0 References: <875ylahuff.fsf@gmx.de> In-Reply-To: <875ylahuff.fsf@gmx.de> From: Evan MacTaggart Date: Thu, 9 Jun 2022 10:24:15 -0600 Message-ID: Subject: Re: bug#55855: "Invalid file name" error with tramp-smb filename check To: Michael Albinus Content-Type: multipart/alternative; boundary="0000000000006953df05e10641d7" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55855 Cc: 55855@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --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-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 09 12:48:55 2022 Received: (at 55855-done) by debbugs.gnu.org; 9 Jun 2022 16:48:55 +0000 Received: from localhost ([127.0.0.1]:47581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzLL4-0005TA-R4 for submit@debbugs.gnu.org; Thu, 09 Jun 2022 12:48:54 -0400 Received: from mout.gmx.net ([212.227.17.20]:37431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzLL2-0005So-DW for 55855-done@debbugs.gnu.org; Thu, 09 Jun 2022 12:48:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1654793325; bh=8I/GeuVxqWkDT0FBWAfSWen9ZWG/hCYMTIUW4lqWKko=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=fxkV3P+GT/so0/dya4ygcB9wVsI4Ez3WmuC9gWT9A1ZsPt1lb9R16eYw2CHNYOhsX tAxROfus1acRGRIUiOeGjbpYZtapH+Xg9SDK7E/RnP6jdb0gIE+EHd9einMGcWc+vA euQftUOm2utBTm1GUYeXbscA45IRLXOO1paFhiwY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([213.220.151.112]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mj8qj-1nW4Wu1vVt-00f8kN; Thu, 09 Jun 2022 18:48:45 +0200 From: Michael Albinus To: Evan MacTaggart Subject: Re: bug#55855: "Invalid file name" error with tramp-smb filename check References: <875ylahuff.fsf@gmx.de> Date: Thu, 09 Jun 2022 18:48:44 +0200 In-Reply-To: (Evan MacTaggart's message of "Thu, 9 Jun 2022 10:24:15 -0600") Message-ID: <87wndphjf7.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Ik/7vBHj/yj1NprlHddKp309l4d7lWhqFcEgyyiZrLi9tWSsi1E JLTpGuUXJ9kFYNNYajvOGugBhqMqF0yK7oMxKH24kF3Kr1Ip7mACCiR3ASiEFvxEOmZCF3O 5XkVTjTXxYyZhSlmnKvcHKYCYACBRIPMRtGNHd4DP9V6I4YngJwfmha3lG3ngTLXR4zX7Te wmqlGSTlGri+La1FipgIg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:7V4mIk/piVU=:NHKjrvOG3ITHdFqoyb7lj9 JL+c9vDDI/FKNqAIlYPHGxPBnMxLX+wX1jIOPOR54p9tDQV9Z7U29kvlUGcaEBksLc2xP49Gk FBkknEh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yA8yl+99X+QWQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55855-done Cc: 55855-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Version: 28.2 Evan MacTaggart writes: > Hey Michael, Hi Evan, > 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! Thanks for the feedback! I'm closing the bug then. > Cheers, > Evan MacTaggart Best regards, Michael. From unknown Fri Jun 20 07:25:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 08 Jul 2022 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator