Bug 224910 - KIO changing files permissions on upload
Summary: KIO changing files permissions on upload
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 225158 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-01-30 19:44 UTC by Jakub Caban
Modified: 2012-01-06 22:12 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Caban 2010-01-30 19:44:18 UTC
Version:            (using Devel)
Compiler:          GCC 4.4 
OS:                Linux
Installed from:    Compiled sources

I faced this  problem trying out KDevelop4 on KDE 4.3.95. When I upload any file from my drive to remote machine, it has changed file permissions to 600 after upload.

Niko Sams provided small test application to test if this is KIO problem:

http://websvn.kde.org/*checkout*/trunk/extragear/sdk/kdevelop-plugins/upload/tests/permissions.cpp

When I ran it:

My command was:

tests/permssions ~/[path]/index.php sftp://[server]/[path]/index.php

On my computer:
ls -l ~/[path]/index.php
-rw-r--r-- 1 lustmored lustmored 899 Jan 28 21:35 /[path]/index.php

Remote:
-rw------- 1 [user] [user] 899 Jan 30 19:16 index.php

I see permission change. It happens every time I create new file on remote this way. I found that copying files using drag'n'drop in Dolphin works without problem (at least when I tested it).

How to reproduce:
- download this test application
- upload anything to remote server

Expected behavior:
- File created on remote with same permissions

Actual result:
- File created on remote with 600

I will be happy to provide any more informations, but don't know what could be useful, so please just ask.
Comment 1 Jakub Caban 2010-02-02 00:20:56 UTC
In KDE 4.3.98 the problem still exists with exactly same symptoms.

Could someone please comment on this is it my configuration mismatch (I use Gentoo ebuild all the way) or when it will get fixed?

Thanks in advance
Comment 2 Jakub Caban 2010-02-06 14:18:08 UTC
In KDE 4.4.0 from SVN tag the problem still exists in exactly same way.

I have additionally tried using command-line sftp to check if my comp and server are all OK, and it uploaded index.php with perms 644, so everything works OK from simple sftp. But unfortunately not KIO.
Comment 3 Jakub Caban 2010-02-17 14:18:14 UTC
Just to let you know - released 4.4 sill has the issue.
Comment 4 Dominik Haumann 2010-02-19 12:17:33 UTC
*** Bug 225158 has been marked as a duplicate of this bug. ***
Comment 5 Jakub Caban 2010-03-05 17:05:46 UTC
4.4.1 - still same problem
Comment 6 Jakub Caban 2010-04-12 18:49:00 UTC
4.4.2 problem still occurs. Is anybody interested in this one? I really can provide any information you could ever need, as am really really interested in that one.
Comment 7 Jakub Caban 2010-07-24 14:45:59 UTC
In KDE 4.4.92 the problem still exists. I will test with RC3 when it will compile.
Comment 8 Jakub Caban 2010-07-26 15:04:48 UTC
In 4.4.95 no change...
Comment 9 Milian Wolff 2010-09-13 11:49:31 UTC
does this only happen with sftp?

and the problem is probably that the KIO client creates a temp file for the upload, once that is done moves it to the destination. The temp file will have the default permissions as set by umask on the server.

A fix would be to copy the permissions of the destination to the temp file before overwriting the destination.
Comment 10 Dawit Alemayehu 2012-01-06 22:12:46 UTC
This should be fixed in KDE 4.8.0 as a result of the speed up patch committed before KDE 4.8 beta. See https://git.reviewboard.kde.org/r/103109.