Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/file/file.cpp
Context not available. | |||||
1331 | } else { | 1331 | } else { | ||
---|---|---|---|---|---|
1332 | //qDebug() << "QFile::remove" << itemPath; | 1332 | //qDebug() << "QFile::remove" << itemPath; | ||
1333 | if (!QFile::remove(itemPath)) { | 1333 | if (!QFile::remove(itemPath)) { | ||
1334 | error(KIO::ERR_CANNOT_DELETE, itemPath); | 1334 | if (errno == EACCES || errno == EPERM) { | ||
1335 | return false; | 1335 | if (!execWithRoot(QStringLiteral("del"), QStringLiteral("delete_file"), itemPath, WARN_PRIVILEDGE_DEL)) { | ||
1336 | error(KIO::ERR_ACCESS_DENIED, itemPath); | ||||
1337 | return false; | ||||
1338 | } | ||||
1339 | } else { | ||||
1340 | error(KIO::ERR_CANNOT_DELETE, itemPath); | ||||
1341 | return false; | ||||
1342 | } | ||||
1336 | } | 1343 | } | ||
1337 | } | 1344 | } | ||
1338 | } | 1345 | } | ||
Context not available. | |||||
1340 | Q_FOREACH (const QString &itemPath, dirsToDelete) { | 1347 | Q_FOREACH (const QString &itemPath, dirsToDelete) { | ||
1341 | //qDebug() << "QDir::rmdir" << itemPath; | 1348 | //qDebug() << "QDir::rmdir" << itemPath; | ||
1342 | if (!dir.rmdir(itemPath)) { | 1349 | if (!dir.rmdir(itemPath)) { | ||
1343 | error(KIO::ERR_CANNOT_DELETE, itemPath); | 1350 | if (errno == EACCES || errno == EPERM) { | ||
1344 | return false; | 1351 | if (!execWithRoot(QStringLiteral("del"), QStringLiteral("delete_dir"), itemPath, WARN_PRIVILEDGE_RMDIR)) { | ||
1352 | error(KIO::ERR_ACCESS_DENIED, itemPath); | ||||
1353 | return false; | ||||
1354 | } | ||||
1355 | } else { | ||||
1356 | error(KIO::ERR_CANNOT_DELETE, itemPath); | ||||
1357 | return false; | ||||
1358 | } | ||||
1345 | } | 1359 | } | ||
1346 | } | 1360 | } | ||
1347 | return true; | 1361 | return true; | ||
Context not available. | |||||
1394 | } | 1408 | } | ||
1395 | 1409 | | |||
1396 | bool proceed = true; | 1410 | bool proceed = true; | ||
1397 | if (kauthStatus == KAuth::Action::AuthorizedStatus && !mPriviledgeOpStarted) { | 1411 | if (kauthStatus == KAuth::Action::AuthorizedStatus | ||
1412 | && !mPriviledgeOpStarted | ||||
1413 | && metaData(QLatin1String("ShowInternalWarning")) == QStringLiteral("true")) { | ||||
1398 | mPriviledgeOpStarted = true; | 1414 | mPriviledgeOpStarted = true; | ||
1399 | proceed = showWarning(warning); | 1415 | proceed = showWarning(warning); | ||
1400 | } | 1416 | } | ||
Context not available. |