unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Weird tramp scp permissions issue with
@ 2008-11-07 17:30 Ian Eure
  2008-11-08 20:43 ` Kevin Rodgers
  2008-11-16 18:59 ` Michael Albinus
  0 siblings, 2 replies; 8+ messages in thread
From: Ian Eure @ 2008-11-07 17:30 UTC (permalink / raw)
  To: help-gnu-emacs

Any file I create on a remote host using tramp's scp method gets a  
mode of 0600, rather than the 0644 I would like. If I use the (slower)  
ssh method, the file gets the correct mode.

What seems to be happening is that the local file gets created with  
0600, which is preserved when it's SCP'd over. Indeed, 'tramp-methods  
shows that the `-p' argument is passed to scp, which does exactly this.

My umask is 0022 on both ends, which is correct. So tramp seems to be  
creating the file with 0600 before it copies it.

Does anyone know how I can fix this?

  - Ian




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

* Re: Weird tramp scp permissions issue with
  2008-11-07 17:30 Weird tramp scp permissions issue with Ian Eure
@ 2008-11-08 20:43 ` Kevin Rodgers
  2008-11-08 21:05   ` Ian Eure
  2008-11-16 18:59 ` Michael Albinus
  1 sibling, 1 reply; 8+ messages in thread
From: Kevin Rodgers @ 2008-11-08 20:43 UTC (permalink / raw)
  To: help-gnu-emacs

Ian Eure wrote:
> Any file I create on a remote host using tramp's scp method gets a mode 
> of 0600, rather than the 0644 I would like. If I use the (slower) ssh 
> method, the file gets the correct mode.
> 
> What seems to be happening is that the local file gets created with 
> 0600, which is preserved when it's SCP'd over. Indeed, 'tramp-methods 
> shows that the `-p' argument is passed to scp, which does exactly this.
> 
> My umask is 0022 on both ends, which is correct. So tramp seems to be 
> creating the file with 0600 before it copies it.
> 
> Does anyone know how I can fix this?

,----[ C-h f default-file-modes RET ]
| default-file-modes is a built-in function in `C source code'.
| (default-file-modes)
|
| Return the default file protection for created files.
| The value is an integer.
|
| [back]
`----

,----[ C-h f set-default-file-modes RET ]
| set-default-file-modes is a built-in function in `C source code'.
| (set-default-file-modes mode)
|
| Set the file permission bits for newly created files.
| The argument mode should be an integer; only the low 9 bits are used.
| This setting is inherited by subprocesses.
|
| [back]
`----

For the familiar octal notation:

(format "%03o" (default-file-modes))

(set-default-file-modes ?\644)

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: Weird tramp scp permissions issue with
  2008-11-08 20:43 ` Kevin Rodgers
@ 2008-11-08 21:05   ` Ian Eure
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Eure @ 2008-11-08 21:05 UTC (permalink / raw)
  To: Kevin Rodgers; +Cc: help-gnu-emacs

On Nov 8, 2008, at 12:43 PM, Kevin Rodgers wrote:

> Ian Eure wrote:
>> Any file I create on a remote host using tramp's scp method gets a  
>> mode of 0600, rather than the 0644 I would like. If I use the  
>> (slower) ssh method, the file gets the correct mode.
>> What seems to be happening is that the local file gets created with  
>> 0600, which is preserved when it's SCP'd over. Indeed, 'tramp- 
>> methods shows that the `-p' argument is passed to scp, which does  
>> exactly this.
>> My umask is 0022 on both ends, which is correct. So tramp seems to  
>> be creating the file with 0600 before it copies it.
>> Does anyone know how I can fix this?
>
> ,----[ C-h f default-file-modes RET ]
> ,----[ C-h f set-default-file-modes RET ]
>
> For the familiar octal notation:
>
> (format "%03o" (default-file-modes))
>
This shows the default mode is "755", not 0600. If this were the  
source of the problem, all files created with Emacs would be created  
with that mode, not just ones with Tramp. Files created locally, or on  
a remote machine via the ssh method get the correct (0644) mode. Only  
files created on a remote machine with the scp method get mode 0600.

Digging through tramp.el, I found: tramp-set-auto-save-file-modes,  
"Set permissions of autosaved remote files to the original  
permissions." It has a hard-coded "0600" in it, and this is the only  
place I see any specific permissions in the Tramp source. I changed  
that to 0644, and eval'd the function. It didn't change anything, I  
still get the same behavior.


  - Ian




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

* Re: Weird tramp scp permissions issue with
  2008-11-07 17:30 Weird tramp scp permissions issue with Ian Eure
  2008-11-08 20:43 ` Kevin Rodgers
@ 2008-11-16 18:59 ` Michael Albinus
  2008-11-16 19:07   ` Ian Eure
  1 sibling, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2008-11-16 18:59 UTC (permalink / raw)
  To: Ian Eure; +Cc: help-gnu-emacs

Ian Eure <ian@digg.com> writes:

> Any file I create on a remote host using tramp's scp method gets a
> mode of 0600, rather than the 0644 I would like. If I use the (slower)
> ssh method, the file gets the correct mode.
>
> What seems to be happening is that the local file gets created with
> 0600, which is preserved when it's SCP'd over. Indeed, 'tramp-methods
> shows that the `-p' argument is passed to scp, which does exactly
> this.
>
> My umask is 0022 on both ends, which is correct. So tramp seems to be
> creating the file with 0600 before it copies it.
>
> Does anyone know how I can fix this?

Which Tramp version do you use? With Tramp 2.1.15-pre, which I have
running, I see 0644 permissions for a new file with both ssh and scp
methods.

>  - Ian

Best regards, Michael.




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

* Re: Weird tramp scp permissions issue with
  2008-11-16 18:59 ` Michael Albinus
@ 2008-11-16 19:07   ` Ian Eure
  2008-11-16 19:59     ` Michael Albinus
  0 siblings, 1 reply; 8+ messages in thread
From: Ian Eure @ 2008-11-16 19:07 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

On Nov 16, 2008, at 10:59 AM, Michael Albinus wrote:

> Ian Eure <ian@digg.com> writes:
>
>> Any file I create on a remote host using tramp's scp method gets a
>> mode of 0600, rather than the 0644 I would like. If I use the  
>> (slower)
>> ssh method, the file gets the correct mode.
>>
>> What seems to be happening is that the local file gets created with
>> 0600, which is preserved when it's SCP'd over. Indeed, 'tramp-methods
>> shows that the `-p' argument is passed to scp, which does exactly
>> this.
>>
>> My umask is 0022 on both ends, which is correct. So tramp seems to be
>> creating the file with 0600 before it copies it.
>>
>> Does anyone know how I can fix this?
>
> Which Tramp version do you use? With Tramp 2.1.15-pre, which I have
> running, I see 0644 permissions for a new file with both ssh and scp
> methods.
>
I'm using whatever comes with Emacs 22.

I installed 2.1.14, and the problem went away. But it also broke vc- 
dired, and maybe other vc stuff:

Loading vc... [2 times]
byte-code: Recursive `require' for feature `tramp-compat'

The vc-mode stuff from Emacs 23 CVS doesn't work for me, either.

  - Ian




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

* Re: Weird tramp scp permissions issue with
  2008-11-16 19:07   ` Ian Eure
@ 2008-11-16 19:59     ` Michael Albinus
  2008-11-16 20:57       ` ian
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2008-11-16 19:59 UTC (permalink / raw)
  To: Ian Eure; +Cc: help-gnu-emacs

Ian Eure <ian@digg.com> writes:

> I'm using whatever comes with Emacs 22.
>
> I installed 2.1.14, and the problem went away. But it also broke vc-
> dired, and maybe other vc stuff:
>
> Loading vc... [2 times]
> byte-code: Recursive `require' for feature `tramp-compat'
>
> The vc-mode stuff from Emacs 23 CVS doesn't work for me, either.

Both vc and tramp have been changed significantly in Emacs 23. Could
you, please, start a vanilla Emacs 23 by "emacs -Q" ?

If it doesn't help, I would like to see Tramp traces, after
tramp-verbose has been set to 8.

>  - Ian

Best regards, Michael.




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

* Re: Weird tramp scp permissions issue with
  2008-11-16 19:59     ` Michael Albinus
@ 2008-11-16 20:57       ` ian
  2008-11-17  4:50         ` Michael Albinus
  0 siblings, 1 reply; 8+ messages in thread
From: ian @ 2008-11-16 20:57 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs@gnu.org

On Nov 16, 2008, at 11:59 AM, Michael Albinus <michael.albinus@gmx.de>  
wrote:

> Ian Eure <ian@digg.com> writes:
>
>> I'm using whatever comes with Emacs 22.
>>
>> I installed 2.1.14, and the problem went away. But it also broke vc-
>> dired, and maybe other vc stuff:
>>
>> Loading vc... [2 times]
>> byte-code: Recursive `require' for feature `tramp-compat'
>>
>> The vc-mode stuff from Emacs 23 CVS doesn't work for me, either.
>
> Both vc and tramp have been changed significantly in Emacs 23. Could
> you, please, start a vanilla Emacs 23 by "emacs -Q" ?
>
> If it doesn't help, I would like to see Tramp traces, after
> tramp-verbose has been set to 8.

I should clarify that I'm not running Emacs 23, I'm running 22 with vc  
transplanted from Emacs 23.

I can still do some debugging with what I have, if you think it would  
be useful.




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

* Re: Weird tramp scp permissions issue with
  2008-11-16 20:57       ` ian
@ 2008-11-17  4:50         ` Michael Albinus
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Albinus @ 2008-11-17  4:50 UTC (permalink / raw)
  To: ian; +Cc: help-gnu-emacs@gnu.org

ian@digg.com writes:

> I should clarify that I'm not running Emacs 23, I'm running 22 with vc
> transplanted from Emacs 23.

Oops. I'm not so familiar with vc to be of help for you.

For Tramp, you shall use a clean install from a delivered Tramp release,
because Tramp performs several checks during its installation, for
example which Emacs version is running. The Tramp files from Emacs 23
are already prepared for that Emacs version.

If done, please start "emacs -Q", adapt load-path for Tramp, require
'tramp, and see how it works.

> I can still do some debugging with what I have, if you think it would
> be useful.

Yes, that will be the option when there are still problems.

Best regards, Michael.




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

end of thread, other threads:[~2008-11-17  4:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 17:30 Weird tramp scp permissions issue with Ian Eure
2008-11-08 20:43 ` Kevin Rodgers
2008-11-08 21:05   ` Ian Eure
2008-11-16 18:59 ` Michael Albinus
2008-11-16 19:07   ` Ian Eure
2008-11-16 19:59     ` Michael Albinus
2008-11-16 20:57       ` ian
2008-11-17  4:50         ` Michael Albinus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).