Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/file/file_unix.cpp
Show All 24 Lines | |||||
25 | 25 | | |||
26 | #include "file.h" | 26 | #include "file.h" | ||
27 | 27 | | |||
28 | #include <config-kioslave-file.h> | 28 | #include <config-kioslave-file.h> | ||
29 | 29 | | |||
30 | #include <QFile> | 30 | #include <QFile> | ||
31 | #include <QDir> | 31 | #include <QDir> | ||
32 | #include <qplatformdefs.h> | 32 | #include <qplatformdefs.h> | ||
33 | #include <QStandardPaths> | ||||
33 | 34 | | |||
34 | #include <QDebug> | 35 | #include <QDebug> | ||
35 | #include <kconfiggroup.h> | 36 | #include <kconfiggroup.h> | ||
36 | #include <klocalizedstring.h> | 37 | #include <klocalizedstring.h> | ||
37 | #include <kmountpoint.h> | 38 | #include <kmountpoint.h> | ||
38 | 39 | | |||
39 | #include <errno.h> | 40 | #include <errno.h> | ||
40 | #if HAVE_SYS_XATTR_H | 41 | #if HAVE_SYS_XATTR_H | ||
41 | #include <sys/xattr.h> | 42 | #include <sys/xattr.h> | ||
42 | #endif | 43 | #endif | ||
43 | #include <utime.h> | 44 | #include <utime.h> | ||
44 | 45 | | |||
45 | #include <KAuth> | 46 | #include <KAuth> | ||
47 | #include <KRandom> | ||||
46 | 48 | | |||
47 | #include "fdreceiver.h" | 49 | #include "fdreceiver.h" | ||
48 | 50 | | |||
49 | //sendfile has different semantics in different platforms | 51 | //sendfile has different semantics in different platforms | ||
50 | #if defined HAVE_SENDFILE && defined Q_OS_LINUX | 52 | #if defined HAVE_SENDFILE && defined Q_OS_LINUX | ||
51 | #define USE_SENDFILE 1 | 53 | #define USE_SENDFILE 1 | ||
52 | #endif | 54 | #endif | ||
53 | 55 | | |||
Show All 13 Lines | 67 | if (src.st_ino == dest.st_ino && | |||
67 | return true; | 69 | return true; | ||
68 | } | 70 | } | ||
69 | 71 | | |||
70 | return false; | 72 | return false; | ||
71 | } | 73 | } | ||
72 | 74 | | |||
73 | static const QString socketPath() | 75 | static const QString socketPath() | ||
74 | { | 76 | { | ||
75 | return QStringLiteral("org_kde_kio_file_helper_%1").arg(getpid()); | 77 | const QString runtimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); | ||
78 | return QStringLiteral("%1/filehelper%2%3").arg(runtimeDir).arg(KRandom::randomString(6)).arg(getpid()); | ||||
76 | } | 79 | } | ||
77 | 80 | | |||
78 | bool FileProtocol::privilegeOperationUnitTestMode() | 81 | bool FileProtocol::privilegeOperationUnitTestMode() | ||
79 | { | 82 | { | ||
80 | return (metaData(QStringLiteral("UnitTesting")) == QLatin1String("true")) | 83 | return (metaData(QStringLiteral("UnitTesting")) == QLatin1String("true")) | ||
81 | && (requestPrivilegeOperation() == KIO::OperationAllowed); | 84 | && (requestPrivilegeOperation() == KIO::OperationAllowed); | ||
82 | } | 85 | } | ||
83 | 86 | | |||
▲ Show 20 Lines • Show All 790 Lines • Show Last 20 Lines |