From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Duncan Greatwood Newsgroups: gmane.emacs.bugs Subject: bug#72450: 29.1; Tramp Failed to Parse OS Name and Version for Windows 11 Date: Mon, 5 Aug 2024 15:14:50 -0700 Message-ID: References: <86y15cucg3.fsf@gnu.org> <87frrkk7ze.fsf@gmx.de> <867ccwsl77.fsf@gnu.org> <87bk28k1yy.fsf@gmx.de> <8634nksh16.fsf@gnu.org> <877ccwk142.fsf@gmx.de> <861q34sgb3.fsf@gnu.org> <874j7zpe62.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000025fe88061ef7025a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37247"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , dgbulk@gmail.com, 72450@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 06 00:17:08 2024 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 1sb60p-0009Ur-Ry for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Aug 2024 00:17:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sb60T-0004TT-Gn; Mon, 05 Aug 2024 18:16:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sb60R-0004T4-BN for bug-gnu-emacs@gnu.org; Mon, 05 Aug 2024 18:16:43 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sb60N-0000WM-4r for bug-gnu-emacs@gnu.org; Mon, 05 Aug 2024 18:16:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=r8pmCjpZ9Q0fX/frmu4YLz+eoX18f2KIGxdTvbIm4tQ=; b=n4pEC0e3cxiyOIMXxAqA2trxj8Tt6ylZX0x3rQJou7M+kXQJ/Pj+mre8jPK0HkrjgXbAaXqBPy2rUA3IxyeA7EeyLw/RWX9nAzi0Ou5/oCjTMukFP5RCKO3P0mpBTkBI1SZsBqv6wR0PUNLXLTEbr7f80PbXCYw/EiICEb3j7jY0m1zinrWwso65UBzVjI6emkg6mAsVrESTGElybIxAH4qUUAkoLUvpWCKiMD2WwtitnNAzWBA6dx1ckLJrFfLDHi+04DqxUMivKOcdggvYxUKbqAEFRryU+90wvXGsPLPs+ziVdFvMKcfjzjM5O4jZ7pCuWXWr0SnsG3mKtG0EVA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sb60j-0007ct-QK for bug-gnu-emacs@gnu.org; Mon, 05 Aug 2024 18:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Duncan Greatwood Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Aug 2024 22:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72450 X-GNU-PR-Package: emacs Original-Received: via spool by 72450-submit@debbugs.gnu.org id=B72450.172289619729235 (code B ref 72450); Mon, 05 Aug 2024 22:17:01 +0000 Original-Received: (at 72450) by debbugs.gnu.org; 5 Aug 2024 22:16:37 +0000 Original-Received: from localhost ([127.0.0.1]:59540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sb60K-0007bQ-IE for submit@debbugs.gnu.org; Mon, 05 Aug 2024 18:16:37 -0400 Original-Received: from mail-lj1-f182.google.com ([209.85.208.182]:46128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sb60I-0007aw-3R for 72450@debbugs.gnu.org; Mon, 05 Aug 2024 18:16:35 -0400 Original-Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2f16767830dso484771fa.0 for <72450@debbugs.gnu.org>; Mon, 05 Aug 2024 15:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722896104; x=1723500904; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=r8pmCjpZ9Q0fX/frmu4YLz+eoX18f2KIGxdTvbIm4tQ=; b=YPhIIRNBLvm4GtQdgrrcKc8VkzELGyyzL5YQbvJFo2fDBc6jb12ivdylViBjl2p3m+ RJANc7RHVqFzQSv8BHZucEPz6HPeAJLL9bGmiLzjZi/cRbwAaAwno1+l0bzPw0Zidkz1 HPFI2nb2wAbY5H6vkPMPkukwcaY2m2zoSPoO2jjCrsjtQieNjgh5y77z3Ak/Jo/5MVAE YxC6uXgu8wPkseUekgS88FNeYUs9bwC/jvEQ4IjwvCwyRTMHLCBcRocBnl4VblGgCEid zj6ESxCgOSEDrmnXbnE+Ra+QJDep7Hc2Awol92BatTpcBUWvwwsSwFDCEWA86tTOu+hz S1ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722896104; x=1723500904; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r8pmCjpZ9Q0fX/frmu4YLz+eoX18f2KIGxdTvbIm4tQ=; b=mMBjV5q27WEuIw9hF9+pLIMzoh6L5pLyd1lTJ+n1ZPYe1hZazpJGTKbUjdLnpEnZ3Y pssMMzFO8Oq44TA2uhzOzEpoSGnNBiNYpwfGJc9vQfaU4SyYfFkJo8f9qF2Q0pTHZaM8 6OyYcG0bBlDqa/n+sB/D9JY8zMjcet+V5/RU/zF4D0/fngii+hFlrRIKHBFSsXMvoftJ Fpc7YcJ9/WfSP9mZx7OaPIByB50mhc8QDQGweFMV+iLqvirB+i6+Y4xuLXRP8fhVCoDE cK9ykanzF1I6RtgMcolbJdRqLb8dKX+Lvkl/CMff7cqAv9sHTrvyo3mgf5SESuSzIrGx 0j3w== X-Forwarded-Encrypted: i=1; AJvYcCWq/zqVSTpXFsQNzyEA4lF+Vv7/5yzucXe3znbVepHrgq+Z76DAmy28gLP6pCVGO0X0jsIPkuhpM7THdCEJlbVwwYIZBh0= X-Gm-Message-State: AOJu0YwbUMSMzVUNx02Tl+frEojCeQGyQcbbs3borxSZZTWRKZtpd/OD G7GUZ0f23ltSDxuf/eRF/sZusHFzMpJXdU5vx8rs3lPA8jhKAtgKjaSNv32aN+w= X-Google-Smtp-Source: AGHT+IHssp1yRky1ZgmSFphcnk08BsWYAryWUC8KZK7HW5mTbscIJkDdZgRgProghnnW//KqZ4R1ig== X-Received: by 2002:a2e:9681:0:b0:2ef:2dfe:f058 with SMTP id 38308e7fff4ca-2f15ab27d20mr85558801fa.42.1722896103450; Mon, 05 Aug 2024 15:15:03 -0700 (PDT) Original-Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com. [209.85.218.44]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b839c2dbe8sm5369905a12.37.2024.08.05.15.15.02 for <72450@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Aug 2024 15:15:02 -0700 (PDT) Original-Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a7d2a9a23d9so6980366b.3 for <72450@debbugs.gnu.org>; Mon, 05 Aug 2024 15:15:02 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXETHXTCs92frTBQeDsPUG2hfmmBJM3odaZWZ1QM51N4yo1lSviZ6/QIFTOZ1I6ojbrGryFtfX7TlygHykzyhIAbZyVd8E= X-Received: by 2002:a17:907:6d1f:b0:a7a:9d70:82b9 with SMTP id a640c23a62f3a-a7dc4e4ae22mr933658266b.17.1722896102054; Mon, 05 Aug 2024 15:15:02 -0700 (PDT) In-Reply-To: <874j7zpe62.fsf@gmx.de> X-Gmail-Original-Message-ID: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289809 Archived-At: --00000000000025fe88061ef7025a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Response below, Thanks again. On Mon, Aug 5, 2024 at 1:28=E2=80=AFAM Michael Albinus wrote: > Duncan Greatwood writes: > > > Hi Michael and Eli - > > Hi Duncan, > > > sh-5.2$ uname --version > > uname (GNU coreutils) 8.32 > > Copyright (C) 2020 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later > > . > > This is free software: you are free to change and redistribute it. > > There is NO WARRANTY, to the extent permitted by law. > > > > Written by David MacKenzie. > > sh-5.2$ > > > > If I may, the extra characters in the emacs error message might not > > come from the uname on windows - that uname seems to work OK on the > > windows side at least - it could be a misparsing in emacs (or even an > > mistake gathering the error message, I suppose). > > I also don't believe it comes from uname itself. '[17;120H=E2=80=99' look= s > rather like an escape code sequence, perhaps emitted from the underlying > shell. [DG] Yes, makes sense. > Something like cursor position, window setting, whatever. A > search didn't gave me a clue what's this. > > After connecting the remote host via ssh, Tramp sends as very first > command something like > > --8<---------------cut here---------------start------------->8--- > # exec env TERM=3D'dumb' INSIDE_EMACS=3D'31.0.50,tramp:2.8.0-pre' ENV=3D'= ' > HISTFILE=3D~/.tramp_history PROMPT_COMMAND=3D'' > PS1=3D///245adade605348c086dac6d8f612435c\#\$ PS2=3D'' PS3=3D'' /bin/sh = -i > --8<---------------cut here---------------end--------------->8--- > > Note the TERM=3D'dumb' setting, which ought to suppress such code > sequences. > [DG] FWIW, I entered this command directly at the "sh" prompt on Windows, and it looks OK AFAIK: sh-5.2$ exec env TERM=3D'dumb' INSIDE_EMACS=3D'31.0.50,tramp:2.8.0-pre' ENV= =3D'' HISTFILE=3D~/.tramp_history PROMPT_COMMAND=3D'' PS1=3D///245adade605348c086dac6d8f612435c\#\$ PS2=3D'' PS3=3D'' /bin/sh -i ///245adade605348c086dac6d8f612435c#$ ///245adade605348c086dac6d8f612435c#$echo $TERM dumb ///245adade605348c086dac6d8f612435c#$echo $INSIDE_EMACS 31.0.50,tramp:2.8.0-pre > > Somehow, this doesn't seem to work as expected in your case. Perhaps due > to calling /bin/sh. See below for debugging instructions. > > > i) the target windows machine is not directly accessible right now, it > > is accessible via an intervening ssh proxy; > > That's a valid point. So we need to find a solution. > > > ii) SMB seems pretty retro to me in 2024, but maybe that's just me. > > Yes, it is just you. > [DG] Fair enough. On this basis, I configured a mount on the Linux machine of the Windows share using cifs/smb. fstab entry thus: //WINDOWS-IP/WINDOWS-SHARE-NAME LINUX-MOUNT-DIR cifs credentials=3DCREDS-FOR-WINDOWS-STORED-IN-LINUX,rw,uid=3D1000,gid=3D1000,fi= le_mode=3D0755,dir_mode=3D0755 0 0 (where 1000 is the UID and GID of my Linux user) Then I used the normal tramp /ssh:... form to open LINUX-MOUNT-DIR and then open a file contained on the mount. I.e. With emacs running on macOS, this is going macOS -> (ssh) -> Linux -> (smb) -> Windows. And it seems to work just as you'd hope. So this seems to be an option for the use case of access via an SSH proxy, provided the user has admin rights on the proxy (the Linux machine in this case) to install on the proxy a CIFS mount of the Windows share. > > > From an emacs perspective, it seems a shame not to be able to use ssh, > > given that modern Windows commonly supports ssh and provides a bash > > shell. Depending on your own available bandwidth etc. of course. > > That is NOT a shame. MS Windows is a non-free operation system, > therefore it isn't a primary target for Emacs development. > > And it doesn't seem to be important. I'm working for Tramp for more than > 20 years. During this time, nobody has contributed anything for the sake > of MS Windows. And I don't use MS Windows myself; if possible, I fix > things, that's it. I, along with many others, appreciate all your efforts. > > > > BTW, emacs seems to be taking some time before finally producing an > > error message. If there is a way to log what is happening in emacs - > > what tramp is trying, what happens, etc., I'd be happy to. Or LMK how > > I could help otherwise. > > Set tramp-verbose to 6 in a new Emacs session, prior the ssh > connection. When it has failed, there is a *debug tramp/ssh ...* > buffer; please send it as attachment. > [DG] Firstly, my apologies - I can't recreate the "uname parsing issue" directly now. Instead, emacs will go to a time out trying to access the Windows machine via the ssh proxy. I don't know what's changed. In any case, I am enclosing the debug output file. It is 86MB, so I am sharing via Google Drive, hopefully that's OK. https://drive.google.com/file/d/1aH1c-58rfOmjKVBqqfJ9QpzY5m-ltmDQ/view?usp= =3Dsharing This is with the Windows machine using /usr/bin/sh as the default shell for ssh login. Confirmed at the client command prompt - if I do "ssh WINDOWS", I log in and get the "sh" prompt. > > > Best > > -DG > > Best regards, Michael. > --=20 NOTICE: This email and its attachments may contain privileged and=20 confidential information, only for the viewing and use of the intended=20 recipient. If you are not the intended recipient, you are hereby notified= =20 that any disclosure, copying, distribution, acting upon, or use of the=20 information contained in this email and its attachments is strictly=20 prohibited and that this email and its attachments must be immediately=20 returned to the sender and deleted from your system. If you received this= =20 email erroneously, please notify the sender immediately.=C2=A0 Xage Securit= y,=20 Inc. and its affiliates will never request personal information (e.g.,=20 passwords, Social Security numbers) via email.=C2=A0 Report suspicious emai= ls to=20 security-alerts@xage.com --00000000000025fe88061ef7025a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Response below,

Thanks again= .

On Mon, Aug 5, 2024 at 1:28=E2=80=AFAM Michael Albinus <michael.albinus@gmx.de> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Duncan Greatwood <dgreatwood@gmail.com> writes:

> Hi Michael and Eli -

Hi Duncan,

>=C2=A0 =C2=A0 =C2=A0sh-5.2$ uname --version
>=C2=A0 =C2=A0 =C2=A0uname (GNU coreutils) 8.32
>=C2=A0 =C2=A0 =C2=A0Copyright (C) 2020 Free Software Foundation, Inc. >=C2=A0 =C2=A0 =C2=A0License GPLv3+: GNU GPL version 3 or later
>=C2=A0 =C2=A0 =C2=A0<
https://gnu.org/licenses/gpl.html&g= t;.
>=C2=A0 =C2=A0 =C2=A0This is free software: you are free to change and r= edistribute it.
>=C2=A0 =C2=A0 =C2=A0There is NO WARRANTY, to the extent permitted by la= w.
>
>=C2=A0 =C2=A0 =C2=A0Written by David MacKenzie.
>=C2=A0 =C2=A0 =C2=A0sh-5.2$
>
> If I may, the extra characters in the emacs error message might not > come from the uname on windows - that uname seems to work OK on the > windows side at least - it could be a misparsing in emacs (or even an<= br> > mistake gathering the error message, I suppose).

I also don't believe it comes from uname itself. '[17;120H=E2=80=99= ' looks
rather like an escape code sequence, perhaps emitted from the underlying shell.
[DG] Yes, makes sense.
=C2=A0
Something like cursor position= , window setting, whatever. A
search didn't gave me a clue what's this.

After connecting the remote host via ssh, Tramp sends as very first
command something like

--8<---------------cut here---------------start------------->8---
# exec env TERM=3D'dumb' INSIDE_EMACS=3D'31.0.50,tramp:2.8.0-pr= e' ENV=3D'' HISTFILE=3D~/.tramp_history PROMPT_COMMAND=3D'&= #39; PS1=3D///245adade605348c086dac6d8f612435c\#\$ PS2=3D'' PS3=3D&= #39;' /bin/sh=C2=A0 -i
--8<---------------cut here---------------end--------------->8---

Note the TERM=3D'dumb' setting, which ought to suppress such code sequences.
[DG] FWIW, I entered this command directly = at the "sh" prompt on Windows, and it looks OK AFAIK:
s= h-5.2$ exec env TERM=3D'dumb' INSIDE_EMACS=3D'31.0.50,tramp:2.8= .0-pre' ENV=3D'' HISTFILE=3D~/.tramp_history PROMPT_COMMAND=3D&= #39;' PS1=3D///245adade605348c086dac6d8f612435c\#\$ PS2=3D'' PS= 3=3D'' /bin/sh =C2=A0-i
///245adade605348c086dac6d8f612435c#$///245adade605348c086dac6d8f612435c#$echo $TERM
dumb
///245adade6053= 48c086dac6d8f612435c#$echo $INSIDE_EMACS
31.0.50,tramp:2.8.0-pre
=C2=A0

Somehow, this doesn't seem to work as expected in your case. Perhaps du= e
to calling /bin/sh. See below for debugging instructions.

> i) the target windows machine is not directly accessible right now, it=
> is accessible via an intervening ssh proxy;

That's a valid point. So we need to find a solution.

> ii) SMB seems pretty retro to me in 2024, but maybe that's just me= .

Yes, it is just you.
[DG] Fair enough.=C2=A0

On this basis, I configured a mount on the Linux machine of= the Windows share using cifs/smb. fstab entry thus:
//WINDOWS-IP= /WINDOWS-SHARE-NAME LINUX-MOUNT-DIR cifs credentials=3DCREDS-FOR-WINDOWS-ST= ORED-IN-LINUX,rw,uid=3D1000,gid=3D1000,file_mode=3D0755,dir_mode=3D0755 0 0=
(where 1000 is the UID and GID of my Linux user)
<= br>
Then I used the normal tramp /ssh:... form to open LINUX-MOUN= T-DIR and then open a file contained on the mount. I.e. With emacs running = on macOS, this is going macOS -> (ssh) -> Linux -> (smb) -> Win= dows. And it seems to work just as you'd hope.

So this seems to be an option for the use case of access via an SSH proxy,= provided the user has admin rights on the proxy (the Linux machine in this= case) to install on the proxy a CIFS mount of the Windows share.

> From an emacs perspective, it seems a shame not to be able to use ssh,=
> given that modern Windows commonly supports ssh and provides a bash > shell. Depending on your own available bandwidth etc. of course.

That is NOT a shame. MS Windows is a non-free operation system,
therefore it isn't a primary target for Emacs development.

And it doesn't seem to be important. I'm working for Tramp for more= than
20 years. During this time, nobody has contributed anything for the sake of MS Windows. And I don't use MS Windows myself; if possible, I fix things, that's it.
I, along with many others, apprecia= te all your efforts.
=C2=A0


> BTW, emacs seems to be taking some time before finally producing an > error message. If there is a way to log what is happening in emacs - > what tramp is trying, what happens, etc., I'd be happy to. Or LMK = how
> I could help otherwise.

Set tramp-verbose to 6 in a new Emacs session, prior the ssh
connection. When it has failed, there is a *debug tramp/ssh ...*
buffer; please send it as attachment.
[DG] Firstly, my= apologies - I can't recreate the "uname parsing issue" direc= tly now. Instead, emacs will go to a time out trying to access the Windows = machine via the ssh proxy. I don't know what's changed.
<= br>
In any case, I am enclosing the debug output file. It is 86MB= , so I am sharing via Google Drive, hopefully that's OK.

This is with t= he Windows machine using /usr/bin/sh as the default shell for ssh login. Co= nfirmed at the client command prompt - if I do "ssh WINDOWS", I l= og in and get the "sh" prompt.

> Best
> -DG

Best regards, Michael.

NOTICE: This email and its attachmen= ts may contain privileged and confidential information, only for the viewin= g and use of the intended recipient. If you are not the intended recipient,= you are hereby notified that any disclosure, copying, distribution, acting= upon, or use of the information contained in this email and its attachment= s is strictly prohibited and that this email and its attachments must be im= mediately returned to the sender and deleted from your system. If you recei= ved this email erroneously, please notify the sender immediately.=C2=A0 Xag= e Security, Inc. and its affiliates will never request personal information= (e.g., passwords, Social Security numbers) via email.=C2=A0 Report suspici= ous emails to security= -alerts@xage.com
--00000000000025fe88061ef7025a--