Version: 3.2.0 (using KDE 3.2.0, SuSE) Compiler: gcc version 3.3 20030226 (prerelease) (SuSE Linux) OS: Linux (i686) release 2.4.20-4GB konqueror window 1: sftp://user@anyhost:/any/directory konqueror window 2: file://$HOME drag'n'drop an executeable file from window 1 to window 2: file permissions are set from 755 to 644 ...
This is not a bug, but a security feature. It is also not specific to the sftp io-slave. If you copy executables from any remote protocol, the executable flag is always dropped on purpose to protect against malicious remote executions. You have to manually reset the executable flag. I am not sure if there is an option that you can set to circumvent this. Moving to general since the issue is not sftp specific...
It's a rather odd behaviour since sftp (command-line) preserves the flags. Think of copying an autoconf/automake project tree. Many executables, mixed with regular files. Restoring the flags by hand? Not if I can avoid it.
Ahhh... My pervious comment was wrong. The issue has nothing to do with security at all! It seems to be caused by what I think is an outdated assumption in KIO's code. Sent patch to kde-core for peer review...
CVS commit by adawit: - Preserve file premissions when copying from remote protocols that support listing. Fixes BR# 74593. CCMAIL: 74593-done@bugs.kde.org M +1 -3 job.cpp 1.372 --- kdelibs/kio/kio/job.cpp #1.371:1.372 @@ -2903,7 +2903,5 @@ void CopyJob::copyNextFile() // If source isn't local and target is local, we ignore the original permissions // Otherwise, files downloaded from HTTP end up with -r--r--r-- - // But for files coming from TAR, we want to preserve permissions -> we use default perms only if from remote - // The real fix would be KProtocolInfo::inputType(protocol) == T_FILESYSTEM, but we can't access ksycoca from here ! - bool remoteSource = !(*it).uSource.isLocalFile() && ((*it).uSource.protocol() != "tar"); // HACK + bool remoteSource = !KProtocolInfo::supportsListing((*it).uSource); int permissions = ( remoteSource && (*it).uDest.isLocalFile() ) ? -1 : (*it).permissions; KIO::FileCopyJob * copyJob = KIO::file_copy( (*it).uSource, (*it).uDest, permissions, bOverwrite, false, false/*no GUI*/ );