Re: tramp (2.3.3.26.1); Faild savid file under su which located in other partision

2018-09-24 Thread Michael Albinus
Роберт Севумян  writes:

> Michael, hello.

Hi Robert,

> #Failed operation
> [root@localhost /]# cp -f -p /tmp/tramp.test.conf
> /boot/EFI/refind/refind.conf
> cp: failed to preserve ownership '/boot/EFI/refind/refind.conf':
> Permission denied
>
> My boot sector is in vfat format:
> # /dev/sda1 LABEL=ESP UUID=AA28-199A /boot vfat
>
> May be this is an cause of the problem?

Yes.

> Idea was taken form here:
> https://stackoverflow.com/questions/23520744/cp-failed-to-preserve-ownership-error-when-mounted-manually

Well, it looks like you need to play with different mount options. Since
the cp command fails also on shell level, there's nothing Tramp could
do. Sorry.

If you have some more sensible arguments for the cp command which would
work, you might contact us again. We'll find a way then how to convince
Tramp to use such changed arguments.

> Best regards,
> Sevumyan Robert

Best regards, Michael.

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: The “//” fix confuses cygwin-mount

2018-09-24 Thread Chris Zheng

Hello Michael,

I’m afraid the following commit is still needed for MS-Windows user
using cygwin-mount because this problem is return.

2849477af22a1e20a86da7743562495e00b3a1b7
Author: Michael Albinus 
AuthorDate: Thu Mar 22 16:52:58 2018 +0100
Commit: Michael Albinus 
CommitDate: Thu Mar 22 16:52:58 2018 +0100

For your reference, with current master of Emacs,

(substitute-in-file-name "/method:host:/foo") yields
"/method:host:c:/msys64/foo"

Thank you very much,

Chris

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: tramp (2.3.3.26.1); Faild savid file under su which located in other partision

2018-09-24 Thread Michael Albinus
alrobe...@rambler.ru writes:

Hi,

> Reproduce steps
>   1) Open file in boot sector with su using tramp (in my case it was 
> /boot/EFI/refind/refind.conf)
>  a) C-x C-f /su::localhost
>  b) Enter password
>  c) /boot/EFI/refind/refind.conf
>   2) Edit opened file
>   3) Save file (by C-x C-s)
>
> Expected result
>   1) File saved
>
> Actual result
>   1) File didn't save
>   2) Error message :"tramp-file-name-handler: Copying directly failed, see 
> buffer ‘*tramp/su root@localhost*’ for details."
>   3) Buffer *tramp/su root@localhost* is empty
>
> Details:
>   1) All works fine while editing files under tramp su which located on
>   root sector (for example /etc/hosts)
>   2) All works fine while editing file /boot/EFI/refind/refind.conf by
>   emacs, which started under root.

Perhaps ACLs are in the way. Following are the relevant commands Tramp
has performed:

> 18:22:51.479677 tramp-send-command (6) # ( (test -e 
> /boot/EFI/refind/refind.conf || test -h /boot/EFI/refind/refind.conf) && (env 
> QUOTING_STYLE=locale \stat -c '((/%N/) %h /%U/ /%G/ 
> %Xe0 %Ye0 %Ze0 %se0 /%A/ t %ie0 -1)' /boot/EFI/refind/refind.conf | 
> sed -e 's/"/\\"/g' -e 's/\/\/\/\/\//"/g') || echo nil) 2>/dev/null; echo 
> tramp_exit_status $?
> 18:22:51.483711 tramp-wait-for-regexp (6) # 
> (("‘/boot/EFI/refind/refind.conf’") 1 "root" "root" 1537565058e0 1537565058e0 
> 1537623302e0 28003e0 "-rwxr-xr-x" t 48e0 -1)

This is a check about the existing file "refind.conf". Most important: it
has uid and gid 0 (root).

> 18:22:51.546768 tramp-send-command (6) # getfacl -ac 
> /boot/EFI/refind/refind.conf 2>/dev/null; echo tramp_exit_status $?
> 18:22:51.547833 tramp-wait-for-regexp (6) # 
> user::rwx
> group::r-x
> other::r-x

ACLs are checked.

> 18:22:51.548268 tramp-send-command (6) # selinuxenabled 2>/dev/null; echo 
> tramp_exit_status $?
> 18:22:51.548976 tramp-wait-for-regexp (6) # 
> tramp_exit_status 127

SELinux is not enabled.

> 18:22:51.550123 tramp-send-command (6) # ( (test -e /boot/EFI/refind/ || test 
> -h /boot/EFI/refind/) && (env QUOTING_STYLE=locale \stat -c '((/%N/) 
> %h /%U/ /%G/ %Xe0 %Ye0 %Ze0 %se0 /%A/ t %ie0 -1)' 
> /boot/EFI/refind/ | sed -e 's/"/\\"/g' -e 's/\/\/\/\/\//"/g') || echo nil) 
> 2>/dev/null; echo tramp_exit_status $?
> 18:22:51.553736 tramp-wait-for-regexp (6) # 
> (("‘/boot/EFI/refind/’") 5 "root" "root" 1537623302e0 1537623302e0 
> 1537623302e0 4096e0 "drwxr-xr-x" t 23e0 -1)

The directory "refind" is checked. It is writable for user root.

> 18:22:51.558454 tramp-send-command (6) # test -w /boot/EFI/refind/ 
> 2>/dev/null; echo tramp_exit_status $?
> 18:22:51.558800 tramp-wait-for-regexp (6) # 
> tramp_exit_status 0

The same.

> 18:22:51.566790 tramp-send-command (6) # mv -f /boot/EFI/refind/refind.conf 
> /boot/EFI/refind/refind.conf\~ 2>/dev/null; echo tramp_exit_status $?
> 18:22:51.568523 tramp-wait-for-regexp (6) # 
> tramp_exit_status 0

The file "refind.conf" is renamed to "refind.conf~", no problem.

> 18:22:51.582302 tramp-send-command (6) # env TZ=UTC \touch -t 201809212124.18 
> /boot/EFI/refind/refind.conf\~ 2>/dev/null; echo tramp_exit_status $?
> 18:22:51.583698 tramp-wait-for-regexp (6) # 
> tramp_exit_status 0
> ///1a55e6f4fdda667545d90c960c19b7c4#$
> 18:22:51.584143 tramp-send-command (6) # chmod 755 
> /boot/EFI/refind/refind.conf\~ 2>/dev/null; echo tramp_exit_status $?
> 18:22:51.585234 tramp-wait-for-regexp (6) # 
> tramp_exit_status 0

It gets the timestamp and permissions of the original file.

> 18:22:51.623200 tramp-send-command (6) # ( (test -e /tmp/tramp.a7nx5C.conf || 
> test -h /tmp/tramp.a7nx5C.conf) && (env QUOTING_STYLE=locale \stat -c 
> '((/%N/) %h /%U/ /%G/ %Xe0 %Ye0 %Ze0 %se0 
> /%A/ t %ie0 -1)' /tmp/tramp.a7nx5C.conf | sed -e 's/"/\\"/g' -e 
> 's/\/\/\/\/\//"/g') || echo nil) 2>/dev/null; echo tramp_exit_status $?
> 18:22:51.628222 tramp-wait-for-regexp (6) # 
> (("‘/tmp/tramp.a7nx5C.conf’") 1 "robbie" "adm" 1537629771e0 1537629771e0 
> 1537629771e0 27993e0 "-rw-r--r--" t 464952e0 -1)

The temporary file /tmp/tramp.a7nx5C.conf, which is used for editing, is
checked. It belongs to user/group robbie/adm.

> 18:22:51.639260 tramp-send-command (6) # cp -f -p /tmp/tramp.a7nx5C.conf 
> /boot/EFI/refind/refind.conf 2>/dev/null; echo tramp_exit_status $?
> 18:22:51.640592 tramp-wait-for-regexp (6) # 
> tramp_exit_status 1
> ///1a55e6f4fdda667545d90c960c19b7c4#$
> 18:22:51.640898 tramp-do-copy-or-rename-file-directly (1) # File error: 
> Copying directly failed, see buffer ‘*tramp/su root@localhost*’ for details.

Tramp tries to apply "cp -f -p /tmp/tramp.a7nx5C.conf
/boot/EFI/refind/refind.conf", which fails with error code 1. Unfortunately,
due to "2>/dev/null", we don't see why.

> 18:22:54.233581 tramp-send-command (6) # mv -f /boot/EFI/refind/refind.conf\~ 
> /boot/EFI/refind/refind.conf 2>/dev/null; echo tramp_exit_status $?
> 18:22:54.235271