Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/file/file.h
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | |||||
89 | #if HAVE_POSIX_ACL | 89 | #if HAVE_POSIX_ACL | ||
90 | static bool isExtendedACL(acl_t acl); | 90 | static bool isExtendedACL(acl_t acl); | ||
91 | #endif | 91 | #endif | ||
92 | 92 | | |||
93 | protected: | 93 | protected: | ||
94 | void virtual_hook(int id, void *data) override; | 94 | void virtual_hook(int id, void *data) override; | ||
95 | 95 | | |||
96 | private: | 96 | private: | ||
97 | bool createUDSEntry(const QString &filename, const QByteArray &path, KIO::UDSEntry &entry, | | |||
98 | KIO::StatDetails details); | | |||
99 | int setACL(const char *path, mode_t perm, bool _directoryDefault); | 97 | int setACL(const char *path, mode_t perm, bool _directoryDefault); | ||
100 | QString getUserName(KUserId uid) const; | 98 | QString getUserName(KUserId uid) const; | ||
101 | QString getGroupName(KGroupId gid) const; | 99 | QString getGroupName(KGroupId gid) const; | ||
102 | bool deleteRecursive(const QString &path); | 100 | bool deleteRecursive(const QString &path); | ||
103 | 101 | | |||
104 | void fileSystemFreeSpace(const QUrl &url); // KF6 TODO: Turn into virtual method in SlaveBase | 102 | void fileSystemFreeSpace(const QUrl &url); // KF6 TODO: Turn into virtual method in SlaveBase | ||
105 | 103 | | |||
106 | bool privilegeOperationUnitTestMode(); | 104 | bool privilegeOperationUnitTestMode(); | ||
107 | PrivilegeOperationReturnValue execWithElevatedPrivilege(ActionType action, const QVariantList &args, int errcode); | 105 | PrivilegeOperationReturnValue execWithElevatedPrivilege(ActionType action, const QVariantList &args, int errcode); | ||
108 | PrivilegeOperationReturnValue tryOpen(QFile &f, const QByteArray &path, int flags, int mode, int errcode); | 106 | PrivilegeOperationReturnValue tryOpen(QFile &f, const QByteArray &path, int flags, int mode, int errcode); | ||
109 | 107 | | |||
110 | // We want to execute chmod/chown/utime with elevated privileges (in copy & put) | 108 | // We want to execute chmod/chown/utime with elevated privileges (in copy & put) | ||
111 | // only during the brief period privileges are elevated. If it's not the case show | 109 | // only during the brief period privileges are elevated. If it's not the case show | ||
112 | // a warning and continue. | 110 | // a warning and continue. | ||
113 | PrivilegeOperationReturnValue tryChangeFileAttr(ActionType action, const QVariantList &args, int errcode); | 111 | PrivilegeOperationReturnValue tryChangeFileAttr(ActionType action, const QVariantList &args, int errcode); | ||
114 | 112 | | |||
115 | void redirect(const QUrl &url); | 113 | void redirect(const QUrl &url); | ||
116 | 114 | | |||
117 | // Close without calling finish(). Use this to close after error. | 115 | // Close without calling finish(). Use this to close after error. | ||
118 | void closeWithoutFinish(); | 116 | void closeWithoutFinish(); | ||
119 | 117 | | |||
120 | private: | 118 | private: | ||
121 | mutable QHash<KUserId, QString> mUsercache; | | |||
122 | mutable QHash<KGroupId, QString> mGroupcache; | | |||
123 | QFile *mFile; | 119 | QFile *mFile; | ||
124 | 120 | | |||
125 | bool testMode = false; | 121 | bool testMode = false; | ||
126 | KIO::StatDetails getStatDetails(); | 122 | KIO::StatDetails getStatDetails(); | ||
127 | }; | 123 | }; | ||
128 | 124 | | |||
129 | #endif | 125 | #endif |