Re: undesirable behaviour when copying to sshfs/sftp hosts

Jared Henley <[email protected]> Thu, 02 Aug 2012 13:28:31 +1000
Newsgroups gmane.comp.desktop.rox.devel
Message-ID <[email protected]>
Here's a patch to change the invocation of cp:

596c596
<     const char *argv[] =3D {"cp", "-pRf", NULL, NULL, NULL};
---
 >     const char *argv[] =3D {"cp", "-Rf", "--preserve=3Dmode,timestamps", =

NULL, NULL, NULL};


On 23/07/12 08:34, Jared Henley wrote:
> Hi,
>
> I use Rox-filer for all my file manager needs, and it does an awesome
> job. But recently
> it's giving me trouble when copying to an sshfs mount. I typically get
> the following:
>
> cp: failed to preserve ownership for =91sshfs/newfile2=92: Permission den=
ied
>
> This is not surprising, as rox appears to use "cp -p" to do the actual
> copy, and because
> the UIDs of the source and target users are different, a chown is
> required, but fails
> since regular users can't chown files.
>
> The big problem is that the copied files are left with permissions of
> 600. This is a security
> feature of cp (I've already sent a message to the coreutils mailing
> list), but it causes me
> trouble becase I need the permissions to be 660 in order to collaborate
> with a group.
> Manually changing the permissions is possible, but is time-consuming and
> error-prone.
>
> Can we either:
>
> * change rox's invocation of cp to use plain old "cp" (which seems to
> preserve permissions
> anyway, in my experience) or "cp --preserve=3Dmode"
>
> or
>
> * add an option to either enable the above, or use the existing default
> behaviour.
>
> I can probably supply a patch for the first option, if it's the way to go.
>
> Regards,
> Jared Henley
>
>
> -------------------------------------------------------------------------=
-----
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> rox-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rox-devel
>

-- =

Jared Henley
0458 268 956

Pelena Energy
(ABN 19 082 368 330)

www.pelena.com.au
Dorrigo factory and Main Office
33 Dome Road
Dorrigo NSW 2453
Australia
ph ++61 (0)2 66571720
Fax ++61 (0)2 66571722




---------------------------------------------------------------------------=
---
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and =

threat landscape has changed and how IT managers can respond. Discussions =

will include endpoint security, mobile security and the latest in malware =

threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/