Permissions when using file_move
David Faure
david at mandrakesoft.com
Sun Dec 8 21:29:30 GMT 2002
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sunday 08 December 2002 14:09, Andras Mantia wrote:
> Hi,
>
> is it normal when I use KIO::file_move to move a file which permissions 600
> octal (R/W by the user), even if I specify 660 octal (R/W user & group) in
> the KIO::file_move as the permissions parameter, the resulted file will still
> have 600? I use:
> KIO::file_move(source, dest, 432, true, false, false);
>
> - source has permission mode 384
> - dest exists and has permission mode 432
> - the result is that dest is correctly overwritten with source, but the
> permission remains 384.
This should fix it.
Index: file.cc
===================================================================
RCS file: /home/kde/kdelibs/kioslave/file/file.cc,v
retrieving revision 1.128
diff -u -p -r1.128 file.cc
- --- file.cc 2 Dec 2002 11:48:35 -0000 1.128
+++ file.cc 8 Dec 2002 21:26:21 -0000
@@ -396,8 +396,8 @@ void FileProtocol::put( const KURL& url,
}
}
- - // set final permissions, if the file was just created
- - if ( _mode != -1 && !orig_exists )
+ // set final permissions
+ if ( _mode != -1 )
{
if (::chmod(_dest_orig.data(), _mode) != 0)
{
Hmm, this reverts a commit of mine...
revision 1.98
date: 2001/01/10 01:18:05; author: faure; state: Exp; lines: +3 -3
Don't chmod an existing file in put()
Ouch. Not sure anymore why I did that change (>1 year ago).
Can't make up my mind on this. Anyone ? :)
- --
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE987m672KcVAmwbhARAvnWAJ983kMyRvNqiTKdTbMQDWfV4CbfigCfZxXY
jZ+HU5B8obh8+tP+Zh1bdWo=
=sZW5
-----END PGP SIGNATURE-----
More information about the kde-core-devel
mailing list