Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 63659 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]
post-3.3.2-kdelibs-kate.diff
post-3.3.2-kdelibs-kate.diff (text/plain), 2.16 KB, created by
Carsten Lohrke (RETIRED)
on 2005-07-17 18:29:25 UTC
(
hide
)
Description:
post-3.3.2-kdelibs-kate.diff
Filename:
MIME Type:
Creator:
Carsten Lohrke (RETIRED)
Created:
2005-07-17 18:29:25 UTC
Size:
2.16 KB
patch
obsolete
>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();
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 Raw
Actions:
View
Attachments on
bug 98735
:
63200
| 63659 |
63660