Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 63200 Details for
Bug 98735
kde-base/kdelibs Kate backup file permission leak (CAN-2005-1920)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
post-3.4.0-kdelibs-kate.diff
post-3.4.0-kdelibs-kate.diff (text/plain), 2.06 KB, created by
Sune Kloppenborg Jeppesen (RETIRED)
on 2005-07-11 22:37:54 UTC
(
hide
)
Description:
post-3.4.0-kdelibs-kate.diff
Filename:
MIME Type:
Creator:
Sune Kloppenborg Jeppesen (RETIRED)
Created:
2005-07-11 22:37:54 UTC
Size:
2.06 KB
patch
obsolete
>--- kate/part/katedocument.cpp (revision 403907) >+++ kate/part/katedocument.cpp (revision 403908) >@@ -45,7 +45,9 @@ > > #include <kio/job.h> > #include <kio/netaccess.h> >+#include <kio/kfileitem.h> > >+ > #include <kparts/event.h> > > #include <klocale.h> >@@ -2749,15 +2751,39 @@ > > 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() ); > u.setFileName( 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();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 98735
: 63200 |
63659
|
63660