GNU bug report logs - #12014
cp -p fails to preserve permissions on sshfs

Previous Next

Package: coreutils;

Reported by: Jared Henley <jared.henley <at> pelena.com.au>

Date: Sat, 21 Jul 2012 21:17:03 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jared Henley <jared.henley <at> pelena.com.au>
To: bug-coreutils <at> gnu.org
Subject: cp -p fails to preserve permissions on sshfs
Date: Fri, 20 Jul 2012 09:10:31 +1000
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.