Ole Laursen <[email protected]> writes:

> Hi!

Hi,

> I get a "Wrong type argument: arrayp, nil" error which I traced to the
> fact that for some reason the files on the remote host have the
> permission "---xrwxr--". So there is no read access for the owner.
> This is a bit weird, but it actually works on the remote server (I'm
> logging in as a normal user, owner of the file is root). I didn't
> setup the server end. :)

That's correct. If you are not the owner of a file, but in the same
group, just the group permission are checked ("rwx"):

--8<---------------cut here---------------start------------->8---
slbpky:~> ls -al /tmp/123
---xrwxr-- 1 root root 5 2010-02-17 09:42 /tmp/123*
slbpky:~> cat /tmp/123
456
--8<---------------cut here---------------end--------------->8---

If you are the owner of a file, the owner bits are used for checking
file permissions. And these are "--x":

--8<---------------cut here---------------start------------->8---
slbpky:~> ls -al /tmp/123
---xrwxr-- 1 albinus albinus 5 2010-02-17 09:42 /tmp/123*
slbpky:~> cat /tmp/123
cat: /tmp/123: Permission denied
--8<---------------cut here---------------end--------------->8---

> So tramp transfers the file and makes it unreadable. I guess this
> shouldn't happen. I'm not sure why I can't read the file when I'm
> still in the group. But I can't. I'm on Ubuntu, by the way. A simple
> check to make sure owner always gets read permission would probably
> suffice?

When Tramp copies a file, it preserves file permissions and
timestamps. Usually, this is desired. But in the file insertion case via
a temporary file, the appended patch might be useful (towards the trunk
in Tramp's CVS repository).

Best regards, Michael.

*** /home/s30relt1/tester/albinus/tramp/lisp/tramp.el.~1~	2010-02-16 16:29:29.860004000 +0100
--- /home/s30relt1/tester/albinus/tramp/lisp/tramp.el	2010-02-17 10:33:45.930002000 +0100
***************
*** 4790,4801 ****
  			tramp-temp-buffer-file-name)
  		       (t (file-local-copy filename)))))
  
  	      (when (and (null remote-copy)
  			 (tramp-get-method-parameter
  			  method 'tramp-copy-keep-tmpfile))
  		;; We keep the local file for performance reasons,
  		;; useful for "rsync".
- 		(set-file-modes local-copy (tramp-octal-to-decimal "0600"))
  		(setq tramp-temp-buffer-file-name local-copy)
  		(put 'tramp-temp-buffer-file-name 'permanent-local t))
  
--- 4790,4805 ----
  			tramp-temp-buffer-file-name)
  		       (t (file-local-copy filename)))))
  
+ 	      ;; When the file is not readable for the owner, it
+ 	      ;; cannot be inserted, even it is redable for the group
+ 	      ;; or for everybody.
+ 	      (set-file-modes local-copy (tramp-octal-to-decimal "0600"))
+ 
  	      (when (and (null remote-copy)
  			 (tramp-get-method-parameter
  			  method 'tramp-copy-keep-tmpfile))
  		;; We keep the local file for performance reasons,
  		;; useful for "rsync".
  		(setq tramp-temp-buffer-file-name local-copy)
  		(put 'tramp-temp-buffer-file-name 'permanent-local t))
  
_______________________________________________
Tramp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to