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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12014 in the body.
You can then email your comments to 12014 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#12014; Package coreutils. (Sat, 21 Jul 2012 21:17:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jared Henley <jared.henley <at> pelena.com.au>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 21 Jul 2012 21:17:03 GMT) Full text and rfc822 format available.

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




Information forwarded to bug-coreutils <at> gnu.org:
bug#12014; Package coreutils. (Sun, 22 Jul 2012 03:43:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jared Henley <jared.henley <at> pelena.com.au>
Cc: 12014 <at> debbugs.gnu.org
Subject: Re: bug#12014: cp -p fails to preserve permissions on sshfs
Date: Sat, 21 Jul 2012 22:35:59 -0500
On 07/19/2012 06:10 PM, Jared Henley wrote:
> Is there some security reason why the permissions fall back to 600 when the
>
> chown fails

Absolutely.  The user has indicated the desire for
a file to be owned by U with permissions P, but
as chown failed the file is owned by V, where V is
not U.  In that case, changing the file's permissions
to P would grant access to people who would not have
access if the user's request could be satisfied.

Presumably the --preserve option could be used
to get the behavior you want.




Information forwarded to bug-coreutils <at> gnu.org:
bug#12014; Package coreutils. (Mon, 15 Oct 2018 17:31:01 GMT) Full text and rfc822 format available.

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

From: Assaf Gordon <assafgordon <at> gmail.com>
Cc: 12014 <at> debbugs.gnu.org
Subject: Re: bug#12014: cp -p fails to preserve permissions on sshfs
Date: Mon, 15 Oct 2018 11:30:21 -0600
tags 12014 notabug
close  12014
stop

(triaging old bugs)

Hello,

On 21/07/12 09:35 PM, Paul Eggert wrote:
> On 07/19/2012 06:10 PM, Jared Henley wrote:
>> Is there some security reason why the permissions fall back to 600 when the
>>
>> chown fails
> 
> Absolutely.  The user has indicated the desire for
> a file to be owned by U with permissions P,[...]
[...]
> Presumably the --preserve option could be used
> to get the behavior you want.

With no further follow-ups, I'm closing this bug.
Discussion can continue by replying to this thread.

-assaf






Added tag(s) notabug. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 15 Oct 2018 17:31:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 12014 <at> debbugs.gnu.org and Jared Henley <jared.henley <at> pelena.com.au> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 15 Oct 2018 17:31:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 13 Nov 2018 12:24:04 GMT) Full text and rfc822 format available.

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.