GNU bug report logs -
#12014
cp -p fails to preserve permissions on sshfs
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
These days I'm frequently using sshfs to access a remote server running
Linux.
I like to use Rox-Filer, which copies files using "cp -p". I always get
permission
denied errors trying to change ownership, which is expected. But then the
permissions of the copied file are always 600, which causes problems
since the
files need to be group-readable. The umask on the server is 002.
Below is some test output to demonstrate what happens.
[pe <at> hope ~]$ sshfs ja <at> localhost:/home/ja sshfs
ja <at> localhost's password:
[pe <at> hope ~]$ touch sshfs/newfile
[pe <at> hope ~]$ ls -l sshfs/newfile
-rw-rw-r-- 1 ja ja 0 Jul 20 08:35 sshfs/newfile
[pe <at> hope ~]$ touch newfile2
[pe <at> hope ~]$ cp -p newfile2 sshfs
cp: failed to preserve ownership for ‘sshfs/newfile2’: Permission denied
[pe <at> hope ~]$ ls -l sshfs/newfile2
-rw------- 1 ja ja 0 Jul 20 08:36 sshfs/newfile2
[pe <at> hope ~]$ rm sshfs/newfile2
[pe <at> hope ~]$ cp newfile2 sshfs
[pe <at> hope ~]$ ls -l sshfs/newfile2
-rw-rw-r-- 1 ja ja 0 Jul 20 08:37 sshfs/newfile2
Is there some security reason why the permissions fall back to 600 when the
chown fails, or is this a bug?
Jared Henley
This bug report was last modified 6 years and 298 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.