all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: tramp (2.0.52); Saving files changes ownership
       [not found]   ` <s7wirrwvom1.fsf@thetis.hq>
@ 2007-10-18 16:15     ` Sascha Wilde
  2007-10-19  3:48       ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Wilde @ 2007-10-18 16:15 UTC (permalink / raw)
  To: Kai Großjohann; +Cc: tramp-devel, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 1073 bytes --]

Sascha Wilde <wilde@intevation.de> writes:
> Kai Großjohann <kai@emptydomain.de> writes:

[Editing existing files as root changes ownership]

>> See variables backup-by-copying and backup-by-copying-*.
>>
>> (Emacs behaves the same when run as root and editing the file normally.)
>>
>> Was that it?
> 
> Yes, thanks!
> 
> Setting backup-by-copying to t makes emacs (with and without tramp)
> behave as I would expect it.

For some reasons the problem recently reappeared in CVS Emacs:

The file /path/to/example on host bob is owned by root.foo
visiting it from another host as /ssh:root@bob:/path/to/example
editing and saving leads to it being owned by root.root.

I have backup-by-copying set to t.

Any Ideas?

Known problem?

cheers
sascha
-- 
Sascha Wilde                                      OpenPGP key: 4BB86568
Intevation GmbH, Osnabrück             http://www.intevation.de/~wilde/
Amtsgericht Osnabrück, HR B 18998             http://www.intevation.de/
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tramp (2.0.52); Saving files changes ownership
  2007-10-18 16:15     ` tramp (2.0.52); Saving files changes ownership Sascha Wilde
@ 2007-10-19  3:48       ` Michael Albinus
  2007-10-19  7:47         ` Sascha Wilde
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2007-10-19  3:48 UTC (permalink / raw)
  To: Sascha Wilde; +Cc: tramp-devel, Kai Großjohann, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

Sascha Wilde <wilde@intevation.de> writes:

> The file /path/to/example on host bob is owned by root.foo
> visiting it from another host as /ssh:root@bob:/path/to/example
> editing and saving leads to it being owned by root.root.
>
> I have backup-by-copying set to t.
>
> Any Ideas?

Tramp 2.1.11 respects now the parameter PRESERVE-UID-GID of `copy-file'.
Does the following patch (files.el in Emacs trunk) help?

> cheers
> sascha


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1109 bytes --]

*** /home/albinus/src/emacs/lisp/files.el	2007-10-19 05:37:45.000000000 +0200
--- /home/albinus/src/emacs/lisp/files.el.~1.935.~	2007-10-18 22:42:53.000000000 +0200
***************
*** 3204,3216 ****
  	  (set-default-file-modes ?\700)
  	  (when (condition-case nil
  		    ;; Try to overwrite old backup first.
! 		    (copy-file from-name to-name t t t)
  		  (error t))
  	    (while (condition-case nil
  		       (progn
  			 (when (file-exists-p to-name)
  			   (delete-file to-name))
! 			 (copy-file from-name to-name nil t t)
  			 nil)
  		     (file-already-exists t))
  	      ;; The file was somehow created by someone else between
--- 3204,3216 ----
  	  (set-default-file-modes ?\700)
  	  (when (condition-case nil
  		    ;; Try to overwrite old backup first.
! 		    (copy-file from-name to-name t t)
  		  (error t))
  	    (while (condition-case nil
  		       (progn
  			 (when (file-exists-p to-name)
  			   (delete-file to-name))
! 			 (copy-file from-name to-name nil t)
  			 nil)
  		     (file-already-exists t))
  	      ;; The file was somehow created by someone else between

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tramp (2.0.52); Saving files changes ownership
  2007-10-19  3:48       ` Michael Albinus
@ 2007-10-19  7:47         ` Sascha Wilde
  2007-10-21 11:01           ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Wilde @ 2007-10-19  7:47 UTC (permalink / raw)
  To: Michael Albinus; +Cc: tramp-devel, Kai Großjohann, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 1017 bytes --]

Michael Albinus <michael.albinus@gmx.de> writes:
> Sascha Wilde <wilde@intevation.de> writes:
>
>> The file /path/to/example on host bob is owned by root.foo
>> visiting it from another host as /ssh:root@bob:/path/to/example
>> editing and saving leads to it being owned by root.root.
>>
>> I have backup-by-copying set to t.
>>
>> Any Ideas?
>
> Tramp 2.1.11 respects now the parameter PRESERVE-UID-GID of `copy-file'.
> Does the following patch (files.el in Emacs trunk) help?

No, at a quick test it didn't.  I applied your patch (assuming it were
an revert patch), reevaluated backup-buffer-copy, visited and saved a
remote file, but with the same result, the group was changed...

cheers
sascha
-- 
Sascha Wilde                                      OpenPGP key: 4BB86568
Intevation GmbH, Osnabrück             http://www.intevation.de/~wilde/
Amtsgericht Osnabrück, HR B 18998             http://www.intevation.de/
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tramp (2.0.52); Saving files changes ownership
  2007-10-19  7:47         ` Sascha Wilde
@ 2007-10-21 11:01           ` Michael Albinus
  2007-10-22  8:54             ` Sascha Wilde
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2007-10-21 11:01 UTC (permalink / raw)
  To: Sascha Wilde; +Cc: tramp-devel, Kai Großjohann, emacs-devel

Sascha Wilde <wilde@intevation.de> writes:

>> Tramp 2.1.11 respects now the parameter PRESERVE-UID-GID of `copy-file'.
>> Does the following patch (files.el in Emacs trunk) help?
>
> No, at a quick test it didn't.  I applied your patch (assuming it were
> an revert patch), reevaluated backup-buffer-copy, visited and saved a
> remote file, but with the same result, the group was changed...

Indeed. In fileio.c, Fcopy_buffer calls the file name handler without
preserve-uid-and-gid.

I've committed the patches for files.el and fileio.c to the Emacs
trunk. Could you, please, test it?

> cheers
> sascha

Best regards, Michael.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tramp (2.0.52); Saving files changes ownership
  2007-10-21 11:01           ` Michael Albinus
@ 2007-10-22  8:54             ` Sascha Wilde
  0 siblings, 0 replies; 5+ messages in thread
From: Sascha Wilde @ 2007-10-22  8:54 UTC (permalink / raw)
  To: Michael Albinus; +Cc: tramp-devel, Kai Großjohann, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 804 bytes --]

Michael Albinus <michael.albinus@gmx.de> writes:
> Sascha Wilde <wilde@intevation.de> writes:
>> No, at a quick test it didn't.  I applied your patch (assuming it were
>> an revert patch), reevaluated backup-buffer-copy, visited and saved a
>> remote file, but with the same result, the group was changed...
[...]
> I've committed the patches for files.el and fileio.c to the Emacs
> trunk. Could you, please, test it?

Looks good.  On a quick test the ownership was preserved.
Thanks!

sascha
-- 
Sascha Wilde                                      OpenPGP key: 4BB86568
Intevation GmbH, Osnabrück             http://www.intevation.de/~wilde/
Amtsgericht Osnabrück, HR B 18998             http://www.intevation.de/
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-22  8:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <s7wzmla82qx.fsf@thetis.hq>
     [not found] ` <43E271C6.8030901@emptydomain.de>
     [not found]   ` <s7wirrwvom1.fsf@thetis.hq>
2007-10-18 16:15     ` tramp (2.0.52); Saving files changes ownership Sascha Wilde
2007-10-19  3:48       ` Michael Albinus
2007-10-19  7:47         ` Sascha Wilde
2007-10-21 11:01           ` Michael Albinus
2007-10-22  8:54             ` Sascha Wilde

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.