summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Lohrke <carlo@gentoo.org>2005-07-18 16:25:54 +0000
committerCarsten Lohrke <carlo@gentoo.org>2005-07-18 16:25:54 +0000
commit6a94cd873d1d5f06967762eca1082b8a56b9dd4b (patch)
treec8d49bdd0f0d6aae13e1bd6bb7306d38c970f35d /kde-base/kdelibs/files
parentstyle fix (diff)
downloadgentoo-2-6a94cd873d1d5f06967762eca1082b8a56b9dd4b.tar.gz
gentoo-2-6a94cd873d1d5f06967762eca1082b8a56b9dd4b.tar.bz2
gentoo-2-6a94cd873d1d5f06967762eca1082b8a56b9dd4b.zip
ackup file permission leak in kate
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'kde-base/kdelibs/files')
-rw-r--r--kde-base/kdelibs/files/digest-kdelibs-3.3.2-r107
-rw-r--r--kde-base/kdelibs/files/post-3.3.2-kdelibs-kate.diff58
2 files changed, 65 insertions, 0 deletions
diff --git a/kde-base/kdelibs/files/digest-kdelibs-3.3.2-r10 b/kde-base/kdelibs/files/digest-kdelibs-3.3.2-r10
new file mode 100644
index 000000000000..c50a640d5a54
--- /dev/null
+++ b/kde-base/kdelibs/files/digest-kdelibs-3.3.2-r10
@@ -0,0 +1,7 @@
+MD5 0473fb4c6c2cd2bc0f267cfa201f3fd8 kdelibs-3.3.2.tar.bz2 15623180
+MD5 7309e259ae1f29be08bbb70e580da3fb post-3.3.2-kdelibs-dcop.patch 1903
+MD5 b92182b7734e4ff145a08d9755448ec7 post-3.3.2-kdelibs-idn-2.patch 4212
+MD5 acc1153e58b45f92b43747dbc6693e41 post-3.3.2-kdelibs-kimgio-fixed.diff 53212
+MD5 d3658e90acec6ff140463ed2fd0e7736 post-3.3.2-kdelibs-kio.diff 1640
+MD5 d2e513a039ba44becf5728b983b78fc4 post-3.3.2-kdelibs-htmlframes2.patch 1202
+MD5 fe67157b26a8cdf5bcfa1898cdf3b154 post-3.3.2-kdelibs-kioslave.patch 663
diff --git a/kde-base/kdelibs/files/post-3.3.2-kdelibs-kate.diff b/kde-base/kdelibs/files/post-3.3.2-kdelibs-kate.diff
new file mode 100644
index 000000000000..8977df8f1c9f
--- /dev/null
+++ b/kde-base/kdelibs/files/post-3.3.2-kdelibs-kate.diff
@@ -0,0 +1,58 @@
+Index: kate/part/katedocument.cpp
+===================================================================
+--- kate/part/katedocument.cpp (revision 433695)
++++ kate/part/katedocument.cpp (revision 433696)
+@@ -47,7 +47,9 @@
+
+ #include <kio/job.h>
+ #include <kio/netaccess.h>
++#include <kio/kfileitem.h>
+
++
+ #include <kparts/event.h>
+
+ #include <klocale.h>
+@@ -2619,14 +2621,38 @@
+
+ bool KateDocument::save()
+ {
+- // FIXME reorder for efficiency, prompt user in case of failure
+ bool l ( url().isLocalFile() );
+- if ( ( ( l && config()->backupFlags() & KateDocumentConfig::LocalFiles ) ||
+- ( ! l && config()->backupFlags() & KateDocumentConfig::RemoteFiles ) )
+- && isModified() ) {
++
++ if ( ( l && config()->backupFlags() & KateDocumentConfig::LocalFiles )
++ || ( ! l && config()->backupFlags() & KateDocumentConfig::RemoteFiles ) )
++ {
+ KURL u( url().directory(false) + config()->backupPrefix() + url().fileName() + config()->backupSuffix() );
+- if ( ! KIO::NetAccess::upload( url().path(), u, kapp->mainWidget() ) )
++
++ kdDebug () << "backup src file name: " << url() << endl;
++ kdDebug () << "backup dst file name: " << u << endl;
++
++ // get the right permissions, start with safe default
++ mode_t perms = 0600;
++ KIO::UDSEntry fentry;
++ if (KIO::NetAccess::stat (url(), fentry, kapp->mainWidget()))
++ {
++ kdDebug () << "stating succesfull: " << url() << endl;
++ KFileItem item (fentry, url());
++ perms = item.permissions();
++ }
++
++ // first del existing file if any, than copy over the file we have
++ // failure if a: the existing file could not be deleted, b: the file could not be copied
++ if ( (!KIO::NetAccess::exists( u, false, kapp->mainWidget() ) || KIO::NetAccess::del( u, kapp->mainWidget() ))
++ && KIO::NetAccess::file_copy( url(), u, perms, true, false, kapp->mainWidget() ) )
++ {
++ kdDebug(13020)<<"backing up successfull ("<<url().prettyURL()<<" -> "<<u.prettyURL()<<")"<<endl;
++ }
++ else
++ {
+ kdDebug(13020)<<"backing up failed ("<<url().prettyURL()<<" -> "<<u.prettyURL()<<")"<<endl;
++ // FIXME: notify user for real ;)
++ }
+ }
+
+ return KParts::ReadWritePart::save();