fix(opslogexport): stop root service writing to user home, export via… - #482
Conversation
There was a problem hiding this comment.
Sorry @GongHeng2017, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Warning
详情 {
"export": {
"application/dbusproxy/dldbushandler.cpp": {
"a": [
"bool DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<bool> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded:\" << reply.value();"
],
"b": [
"QString DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<QString> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded, root temp dir:\" << reply.value();"
]
},
"application/dbusproxy/dldbushandler.h": {
"a": [
" bool exportOpsLog();"
],
"b": [
" QString exportOpsLog();"
]
},
"application/dbusproxy/dldbusinterface.h": {
"a": [
" inline QDBusPendingReply<bool> exportOpsLog()"
],
"b": [
" inline QDBusPendingReply<QString> exportOpsLog()"
]
},
"application/logallexportthread.cpp": {
"a": [
" DLDBusHandler::instance(this)->exportOpsLog();",
" Utils::exportSomeOpsLogs(opsLogPath, userHomePath);"
],
"b": [
" QString rootTempDir = DLDBusHandler::instance(this)->exportOpsLog();",
" qCWarning(logExportAll) << \"exportOpsLog returned empty or non-existent root temp dir, root-side ops logs may be missing\";",
" Utils::exportUserPermissionOpsLogs(opsLogPath, userHomePath);"
]
},
"application/utils.cpp": {
"a": [
"void Utils::exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir)"
],
"b": [
"void Utils::exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionKernelLogs(const QString &outDir)",
"void Utils::exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir)",
" Utils::exportUserPermissionAppLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionSystemLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionKernelLogs(outDir);",
" Utils::exportUserPermissionDDELogs(outDir, userHomeDir);"
]
},
"application/utils.h": {
"a": [
" static void exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir);"
],
"b": [
" static void exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionKernelLogs(const QString &outDir);",
" static void exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir);"
]
},
"logViewerService/assets/data/com.deepin.logviewer.xml": {
"b": [
" <method name=\"exportOpsLog\">"
]
},
"logViewerService/assets/data/deepin-log-viewer-daemon.service": {
"b": [
"# exportOpsLog \u9700\u8981\u5728 /var/log \u4e0b\u521b\u5efa\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\uff0c\u987b\u663e\u5f0f\u653e\u5f00\u5199\u6743\u9650"
]
},
"logViewerService/logviewerservice.cpp": {
"a": [
"bool LogViewerService::exportOpsLog()"
],
"b": [
"QString LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"exportOpsLog: failed to remove stale temp dir:\" << oldPath;",
" qCWarning(logService) << \"exportOpsLog: failed to create temporary dir under /var/log:\" << tmpOpsDir.errorString();"
]
},
"logViewerService/logviewerservice.h": {
"a": [
" Q_SCRIPTABLE bool exportOpsLog();"
],
"b": [
" Q_SCRIPTABLE QString exportOpsLog();"
]
},
"logViewerService/opslogexport.cpp": {
"a": [
" qWarning() << \"Failed to chown export path:\" << path << \"error:\" << strerror(errno);"
],
"b": [
" qWarning() << \"OpsLogExport::run: target directory safety check failed, aborting export\";",
" * target_dir \u7531 LogViewerService::exportOpsLog() \u901a\u8fc7 QTemporaryDir \u5728 /var/log \u4e0b",
" // - exportAptLogs/exportUosSteLogs/exportUosSteTwoLogs \u7b49\u540c\u6837\u662f\u6574\u76ee\u5f55 cp -rP\uff0c"
]
}
}
} |
a2bce5f to
82a79c4
Compare
|
Warning
详情 {
"export": {
"application/dbusproxy/dldbushandler.cpp": {
"a": [
"bool DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<bool> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded:\" << reply.value();"
],
"b": [
"QString DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<QString> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded, root temp dir:\" << reply.value();"
]
},
"application/dbusproxy/dldbushandler.h": {
"a": [
" bool exportOpsLog();"
],
"b": [
" QString exportOpsLog();"
]
},
"application/dbusproxy/dldbusinterface.h": {
"a": [
" inline QDBusPendingReply<bool> exportOpsLog()"
],
"b": [
" inline QDBusPendingReply<QString> exportOpsLog()"
]
},
"application/logallexportthread.cpp": {
"a": [
" DLDBusHandler::instance(this)->exportOpsLog();",
" Utils::exportSomeOpsLogs(opsLogPath, userHomePath);"
],
"b": [
" QString rootTempDir = DLDBusHandler::instance(this)->exportOpsLog();",
" qCWarning(logExportAll) << \"exportOpsLog returned empty or non-existent root temp dir, root-side ops logs may be missing\";",
" Utils::exportUserPermissionOpsLogs(opsLogPath, userHomePath);"
]
},
"application/opslogpaths.h": {
"b": [
"// \u524d\u7aef\uff08application/utils.cpp \u7684 exportUserPermissionOpsLogs \u7cfb\u5217\uff09\u4e0e",
"// root \u670d\u52a1\uff08logViewerService/opslogexport.cpp \u7684 createOpsLogDirStruct\uff09\u5fc5\u987b"
]
},
"application/utils.cpp": {
"a": [
"void Utils::exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir)"
],
"b": [
"void Utils::exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionKernelLogs(const QString &outDir)",
"void Utils::exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir)",
" Utils::exportUserPermissionAppLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionSystemLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionKernelLogs(outDir);",
" Utils::exportUserPermissionDDELogs(outDir, userHomeDir);"
]
},
"application/utils.h": {
"a": [
" static void exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir);"
],
"b": [
" static void exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionKernelLogs(const QString &outDir);",
" static void exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir);"
]
},
"logViewerService/assets/data/com.deepin.logviewer.xml": {
"b": [
" <method name=\"exportOpsLog\">"
]
},
"logViewerService/assets/data/deepin-log-viewer-daemon.service": {
"b": [
"# exportOpsLog \u9700\u8981\u5728 /var/log \u4e0b\u521b\u5efa\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\uff0c\u987b\u663e\u5f0f\u653e\u5f00\u5199\u6743\u9650"
]
},
"logViewerService/logviewerservice.cpp": {
"a": [
"bool LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller home directory for export log\";"
],
"b": [
"QString LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller identity for export log\";",
" qCWarning(logService) << \"exportOpsLog: failed to remove stale temp dir:\" << oldPath;",
" qCWarning(logService) << \"exportOpsLog: failed to create temporary dir under /var/log:\" << tmpOpsDir.errorString();"
]
},
"logViewerService/logviewerservice.h": {
"a": [
" Q_SCRIPTABLE bool exportOpsLog();"
],
"b": [
" Q_SCRIPTABLE QString exportOpsLog();"
]
},
"logViewerService/opslogexport.cpp": {
"b": [
" qWarning() << \"OpsLogExport::run: target directory safety check failed, aborting export\";",
" * target_dir \u7531 LogViewerService::exportOpsLog() \u901a\u8fc7 QTemporaryDir \u5728 /var/log \u4e0b",
" // exportOpsLog \u8fd4\u56de\u81f3\u524d\u7aef\u62f7\u8d1d\u5b8c\u6210\u7684\u65f6\u95f4\u7a97\u5185\u8bfb\u53d6 auth.log/syslog \u7b49\u654f\u611f\u65e5\u5fd7\u3002"
]
}
}
} |
82a79c4 to
cbb34a5
Compare
|
Warning
详情 {
"export": {
"application/dbusproxy/dldbushandler.cpp": {
"a": [
"bool DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<bool> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded:\" << reply.value();"
],
"b": [
"QString DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<QString> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded, root temp dir:\" << reply.value();"
]
},
"application/dbusproxy/dldbushandler.h": {
"a": [
" bool exportOpsLog();"
],
"b": [
" QString exportOpsLog();"
]
},
"application/dbusproxy/dldbusinterface.h": {
"a": [
" inline QDBusPendingReply<bool> exportOpsLog()"
],
"b": [
" inline QDBusPendingReply<QString> exportOpsLog()"
]
},
"application/logallexportthread.cpp": {
"a": [
" DLDBusHandler::instance(this)->exportOpsLog();",
" Utils::exportSomeOpsLogs(opsLogPath, userHomePath);"
],
"b": [
" QString rootTempDir = DLDBusHandler::instance(this)->exportOpsLog();",
" qCWarning(logExportAll) << \"exportOpsLog returned empty or non-existent root temp dir, root-side ops logs may be missing\";",
" Utils::exportUserPermissionOpsLogs(opsLogPath, userHomePath);"
]
},
"application/opslogpaths.h": {
"b": [
"// \u524d\u7aef\uff08application/utils.cpp \u7684 exportUserPermissionOpsLogs \u7cfb\u5217\uff09\u4e0e",
"// root \u670d\u52a1\uff08logViewerService/opslogexport.cpp \u7684 createOpsLogDirStruct\uff09\u5fc5\u987b"
]
},
"application/utils.cpp": {
"a": [
"void Utils::exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir)"
],
"b": [
"void Utils::exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionKernelLogs(const QString &outDir)",
"void Utils::exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir)",
" Utils::exportUserPermissionAppLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionSystemLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionKernelLogs(outDir);",
" Utils::exportUserPermissionDDELogs(outDir, userHomeDir);"
]
},
"application/utils.h": {
"a": [
" static void exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir);"
],
"b": [
" static void exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionKernelLogs(const QString &outDir);",
" static void exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir);"
]
},
"logViewerService/assets/data/com.deepin.logviewer.xml": {
"b": [
" <method name=\"exportOpsLog\">"
]
},
"logViewerService/assets/data/deepin-log-viewer-daemon.service": {
"b": [
"# exportOpsLog \u9700\u8981\u5728 /var/log \u4e0b\u521b\u5efa\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\uff0c\u987b\u663e\u5f0f\u653e\u5f00\u5199\u6743\u9650"
]
},
"logViewerService/logviewerservice.cpp": {
"a": [
"bool LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller home directory for export log\";"
],
"b": [
"QString LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller identity for export log\";",
" qCWarning(logService) << \"exportOpsLog: failed to remove stale temp dir:\" << oldPath;",
" qCWarning(logService) << \"exportOpsLog: failed to create temporary dir under /var/log:\" << tmpOpsDir.errorString();"
]
},
"logViewerService/logviewerservice.h": {
"a": [
" Q_SCRIPTABLE bool exportOpsLog();"
],
"b": [
" Q_SCRIPTABLE QString exportOpsLog();"
]
},
"logViewerService/opslogexport.cpp": {
"a": [
" qWarning() << \"Failed to chown export path:\" << path << \"error:\" << strerror(errno);"
],
"b": [
" qWarning() << \"OpsLogExport::run: target directory safety check failed, aborting export\";",
" * target_dir \u7531 LogViewerService::exportOpsLog() \u901a\u8fc7 QTemporaryDir \u5728 /var/log \u4e0b",
" // - 0750/0640 \u800c\u975e 0755/0644\uff1a\u4ec5 caller \u540c\u7ec4\u53ef\u8bfb\uff0c\u907f\u514d\u4efb\u610f\u672c\u5730\u7528\u6237\u5728 exportOpsLog",
" qWarning() << \"Failed to chgrp export path:\" << path << \"error:\" << strerror(errno);"
]
}
}
} |
cbb34a5 to
45900f0
Compare
|
Warning
详情 {
"export": {
"application/dbusproxy/dldbushandler.cpp": {
"a": [
"bool DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<bool> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded:\" << reply.value();"
],
"b": [
"QString DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<QString> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded, root temp dir:\" << reply.value();"
]
},
"application/dbusproxy/dldbushandler.h": {
"a": [
" bool exportOpsLog();"
],
"b": [
" QString exportOpsLog();"
]
},
"application/dbusproxy/dldbusinterface.h": {
"a": [
" inline QDBusPendingReply<bool> exportOpsLog()"
],
"b": [
" inline QDBusPendingReply<QString> exportOpsLog()"
]
},
"application/logallexportthread.cpp": {
"a": [
" DLDBusHandler::instance(this)->exportOpsLog();",
" Utils::exportSomeOpsLogs(opsLogPath, userHomePath);"
],
"b": [
" QString rootTempDir = DLDBusHandler::instance(this)->exportOpsLog();",
" qCWarning(logExportAll) << \"exportOpsLog returned empty or non-existent root temp dir, root-side ops logs may be missing\";",
" Utils::exportUserPermissionOpsLogs(opsLogPath, userHomePath);"
]
},
"application/opslogpaths.h": {
"b": [
"// \u524d\u7aef\uff08application/utils.cpp \u7684 exportUserPermissionOpsLogs \u7cfb\u5217\uff09\u4e0e",
"// root \u670d\u52a1\uff08logViewerService/opslogexport.cpp \u7684 createOpsLogDirStruct\uff09\u5fc5\u987b"
]
},
"application/utils.cpp": {
"a": [
"void Utils::exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir)"
],
"b": [
"void Utils::exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionKernelLogs(const QString &outDir)",
"void Utils::exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir)",
" Utils::exportUserPermissionAppLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionSystemLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionKernelLogs(outDir);",
" Utils::exportUserPermissionDDELogs(outDir, userHomeDir);"
]
},
"application/utils.h": {
"a": [
" static void exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir);"
],
"b": [
" static void exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionKernelLogs(const QString &outDir);",
" static void exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir);"
]
},
"logViewerService/assets/data/com.deepin.logviewer.xml": {
"b": [
" <method name=\"exportOpsLog\">"
]
},
"logViewerService/assets/data/deepin-log-viewer-daemon.service": {
"b": [
"# exportOpsLog \u9700\u8981\u5728 /var/log \u4e0b\u521b\u5efa\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\uff0c\u987b\u663e\u5f0f\u653e\u5f00\u5199\u6743\u9650"
]
},
"logViewerService/logviewerservice.cpp": {
"a": [
"bool LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller home directory for export log\";"
],
"b": [
"QString LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller identity for export log\";",
" qCWarning(logService) << \"exportOpsLog: failed to create temporary dir under /var/log:\" << tmpOpsDir.errorString();",
" // \u6388\u6743\u6821\u9a8c\uff1a\u4e0e exportOpsLog \u4e00\u81f4\uff0c\u4f7f\u7528 s_Action_View\u3002",
" // \u65e0\u53c2\u8bbe\u8ba1\uff1a\u6e05\u7406\u7684\u662f\u670d\u52a1\u7aef\u5728 exportOpsLog \u4e2d\u7f13\u5b58\u7684\u672c\u8fdb\u7a0b\u4e34\u65f6\u76ee\u5f55\u8def\u5f84\uff0c"
]
},
"logViewerService/logviewerservice.h": {
"a": [
" Q_SCRIPTABLE bool exportOpsLog();"
],
"b": [
" Q_SCRIPTABLE QString exportOpsLog();",
" // \u6e05\u7406 exportOpsLog \u5728 /var/log \u4e0b\u521b\u5efa\u7684\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\u3002\u65e0\u53c2\uff1a\u6e05\u7406\u7684\u662f\u670d\u52a1\u7aef\u7f13\u5b58",
" QString m_opsTempDir; // exportOpsLog \u521b\u5efa\u7684 /var/log \u4e34\u65f6\u76ee\u5f55\u8def\u5f84\uff0c\u4f9b removeOpsLogTempDir \u6e05\u7406"
]
},
"logViewerService/opslogexport.cpp": {
"a": [
" qWarning() << \"Failed to chown export path:\" << path << \"error:\" << strerror(errno);"
],
"b": [
" qWarning() << \"OpsLogExport::run: target directory safety check failed, aborting export\";",
" * target_dir \u7531 LogViewerService::exportOpsLog() \u901a\u8fc7 QTemporaryDir \u5728 /var/log \u4e0b",
" // - 0750/0640 \u800c\u975e 0755/0644\uff1a\u4ec5 caller \u540c\u7ec4\u53ef\u8bfb\uff0c\u907f\u514d\u4efb\u610f\u672c\u5730\u7528\u6237\u5728 exportOpsLog",
" qWarning() << \"Failed to chgrp export path:\" << path << \"error:\" << strerror(errno);"
]
}
}
} |
45900f0 to
ad08fc3
Compare
|
Warning
详情 {
"export": {
"application/dbusproxy/dldbushandler.cpp": {
"a": [
"bool DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<bool> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded:\" << reply.value();"
],
"b": [
"QString DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<QString> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded, root temp dir:\" << reply.value();"
]
},
"application/dbusproxy/dldbushandler.h": {
"a": [
" bool exportOpsLog();"
],
"b": [
" QString exportOpsLog();"
]
},
"application/dbusproxy/dldbusinterface.h": {
"a": [
" inline QDBusPendingReply<bool> exportOpsLog()"
],
"b": [
" inline QDBusPendingReply<QString> exportOpsLog()"
]
},
"application/logallexportthread.cpp": {
"a": [
" DLDBusHandler::instance(this)->exportOpsLog();",
" Utils::exportSomeOpsLogs(opsLogPath, userHomePath);"
],
"b": [
" QString rootTempDir = DLDBusHandler::instance(this)->exportOpsLog();",
" qCWarning(logExportAll) << \"exportOpsLog returned empty or non-existent root temp dir, root-side ops logs may be missing\";",
" Utils::exportUserPermissionOpsLogs(opsLogPath, userHomePath);"
]
},
"application/opslogpaths.h": {
"b": [
"// \u524d\u7aef\uff08application/utils.cpp \u7684 exportUserPermissionOpsLogs \u7cfb\u5217\uff09\u4e0e",
"// root \u670d\u52a1\uff08logViewerService/opslogexport.cpp \u7684 createOpsLogDirStruct\uff09\u5fc5\u987b"
]
},
"application/utils.cpp": {
"a": [
"void Utils::exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir)"
],
"b": [
"// \u5b89\u5168\u62f7\u8d1d\u8f85\u52a9\uff1a\u5bf9\u9f50 root \u4fa7 opslogexport.cpp \u7684\u7b26\u53f7\u94fe\u63a5\u9632\u62a4\u7b56\u7565\u3002",
"void Utils::exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionKernelLogs(const QString &outDir)",
"void Utils::exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir)",
" Utils::exportUserPermissionAppLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionSystemLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionKernelLogs(outDir);",
" Utils::exportUserPermissionDDELogs(outDir, userHomeDir);"
]
},
"application/utils.h": {
"a": [
" static void exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir);"
],
"b": [
" static void exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionKernelLogs(const QString &outDir);",
" static void exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir);"
]
},
"logViewerService/assets/data/com.deepin.logviewer.xml": {
"b": [
" <method name=\"exportOpsLog\">"
]
},
"logViewerService/assets/data/deepin-log-viewer-daemon.service": {
"b": [
"# exportOpsLog \u9700\u8981\u5728 /var/log \u4e0b\u521b\u5efa\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\uff0c\u987b\u663e\u5f0f\u653e\u5f00\u5199\u6743\u9650"
]
},
"logViewerService/logviewerservice.cpp": {
"a": [
"bool LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller home directory for export log\";"
],
"b": [
"QString LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller identity for export log\";",
" qCWarning(logService) << \"exportOpsLog: failed to create temporary dir under /var/log:\" << tmpOpsDir.errorString();",
" // \u6388\u6743\u6821\u9a8c\uff1a\u4e0e exportOpsLog \u4e00\u81f4\uff0c\u4f7f\u7528 s_Action_View\u3002",
" // \u65e0\u53c2\u8bbe\u8ba1\uff1a\u6e05\u7406\u7684\u662f\u670d\u52a1\u7aef\u5728 exportOpsLog \u4e2d\u7f13\u5b58\u7684\u672c\u8fdb\u7a0b\u4e34\u65f6\u76ee\u5f55\u8def\u5f84\uff0c"
]
},
"logViewerService/logviewerservice.h": {
"a": [
" Q_SCRIPTABLE bool exportOpsLog();"
],
"b": [
" Q_SCRIPTABLE QString exportOpsLog();",
" // \u6e05\u7406 exportOpsLog \u5728 /var/log \u4e0b\u521b\u5efa\u7684\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\u3002\u65e0\u53c2\uff1a\u6e05\u7406\u7684\u662f\u670d\u52a1\u7aef\u7f13\u5b58",
" QString m_opsTempDir; // exportOpsLog \u521b\u5efa\u7684 /var/log \u4e34\u65f6\u76ee\u5f55\u8def\u5f84\uff0c\u4f9b removeOpsLogTempDir \u6e05\u7406"
]
},
"logViewerService/opslogexport.cpp": {
"a": [
" qWarning() << \"Failed to chown export path:\" << path << \"error:\" << strerror(errno);"
],
"b": [
" qWarning() << \"OpsLogExport::run: target directory safety check failed, aborting export\";",
" * target_dir \u7531 LogViewerService::exportOpsLog() \u901a\u8fc7 QTemporaryDir \u5728 /var/log \u4e0b",
" // - 0750/0640 \u800c\u975e 0755/0644\uff1a\u4ec5 caller \u540c\u7ec4\u53ef\u8bfb\uff0c\u907f\u514d\u4efb\u610f\u672c\u5730\u7528\u6237\u5728 exportOpsLog",
" qWarning() << \"Failed to chgrp export path:\" << path << \"error:\" << strerror(errno);"
]
}
}
} |
ad08fc3 to
4142b4d
Compare
|
Warning
详情 {
"export": {
"application/dbusproxy/dldbushandler.cpp": {
"a": [
"bool DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<bool> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded:\" << reply.value();"
],
"b": [
"QString DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<QString> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded, root temp dir:\" << reply.value();"
]
},
"application/dbusproxy/dldbushandler.h": {
"a": [
" bool exportOpsLog();"
],
"b": [
" QString exportOpsLog();"
]
},
"application/dbusproxy/dldbusinterface.h": {
"a": [
" inline QDBusPendingReply<bool> exportOpsLog()"
],
"b": [
" inline QDBusPendingReply<QString> exportOpsLog()"
]
},
"application/logallexportthread.cpp": {
"a": [
" DLDBusHandler::instance(this)->exportOpsLog();",
" Utils::exportSomeOpsLogs(opsLogPath, userHomePath);"
],
"b": [
" QString rootTempDir = DLDBusHandler::instance(this)->exportOpsLog();",
" qCWarning(logExportAll) << \"exportOpsLog returned empty or non-existent root temp dir, root-side ops logs may be missing\";",
" Utils::exportUserPermissionOpsLogs(opsLogPath, userHomePath);"
]
},
"application/opslogpaths.h": {
"b": [
"// \u524d\u7aef\uff08application/utils.cpp \u7684 exportUserPermissionOpsLogs \u7cfb\u5217\uff09\u4e0e",
"// root \u670d\u52a1\uff08logViewerService/opslogexport.cpp \u7684 createOpsLogDirStruct\uff09\u5fc5\u987b"
]
},
"application/utils.cpp": {
"a": [
"void Utils::exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir)"
],
"b": [
"// \u5b89\u5168\u62f7\u8d1d\u8f85\u52a9\uff1a\u5bf9\u9f50 root \u4fa7 opslogexport.cpp \u7684\u7b26\u53f7\u94fe\u63a5\u9632\u62a4\u7b56\u7565\u3002",
"void Utils::exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionKernelLogs(const QString &outDir)",
"void Utils::exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir)",
" Utils::exportUserPermissionAppLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionSystemLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionKernelLogs(outDir);",
" Utils::exportUserPermissionDDELogs(outDir, userHomeDir);"
]
},
"application/utils.h": {
"a": [
" static void exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir);"
],
"b": [
" static void exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionKernelLogs(const QString &outDir);",
" static void exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir);"
]
},
"logViewerService/assets/data/com.deepin.logviewer.xml": {
"b": [
" <method name=\"exportOpsLog\">"
]
},
"logViewerService/assets/data/deepin-log-viewer-daemon.service": {
"b": [
"# exportOpsLog \u9700\u8981\u5728 /var/log \u4e0b\u521b\u5efa\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\uff0c\u987b\u663e\u5f0f\u653e\u5f00\u5199\u6743\u9650"
]
},
"logViewerService/logviewerservice.cpp": {
"a": [
"bool LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller home directory for export log\";"
],
"b": [
"QString LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller identity for export log\";",
" qCWarning(logService) << \"exportOpsLog: failed to create temporary dir under /var/log:\" << tmpOpsDir.errorString();",
" // \u6388\u6743\u6821\u9a8c\uff1a\u4e0e exportOpsLog \u4e00\u81f4\uff0c\u4f7f\u7528 s_Action_View\u3002",
" // \u65e0\u53c2\u8bbe\u8ba1\uff1a\u6e05\u7406\u7684\u662f\u670d\u52a1\u7aef\u5728 exportOpsLog \u4e2d\u7f13\u5b58\u7684\u672c\u8fdb\u7a0b\u4e34\u65f6\u76ee\u5f55\u8def\u5f84\uff0c"
]
},
"logViewerService/logviewerservice.h": {
"a": [
" Q_SCRIPTABLE bool exportOpsLog();"
],
"b": [
" Q_SCRIPTABLE QString exportOpsLog();",
" // \u6e05\u7406 exportOpsLog \u5728 /var/log \u4e0b\u521b\u5efa\u7684\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\u3002\u65e0\u53c2\uff1a\u6e05\u7406\u7684\u662f\u670d\u52a1\u7aef\u7f13\u5b58",
" QString m_opsTempDir; // exportOpsLog \u521b\u5efa\u7684 /var/log \u4e34\u65f6\u76ee\u5f55\u8def\u5f84\uff0c\u4f9b removeOpsLogTempDir \u6e05\u7406"
]
},
"logViewerService/opslogexport.cpp": {
"a": [
" qWarning() << \"Failed to chown export path:\" << path << \"error:\" << strerror(errno);"
],
"b": [
" qWarning() << \"OpsLogExport::run: target directory safety check failed, aborting export\";",
" * target_dir \u7531 LogViewerService::exportOpsLog() \u901a\u8fc7 QTemporaryDir \u5728 /var/log \u4e0b",
" // - 0750/0640 \u800c\u975e 0755/0644\uff1a\u4ec5 caller \u540c\u7ec4\u53ef\u8bfb\uff0c\u907f\u514d\u4efb\u610f\u672c\u5730\u7528\u6237\u5728 exportOpsLog",
" qWarning() << \"Failed to chgrp export path:\" << path << \"error:\" << strerror(errno);"
]
}
}
} |
… /var/log Root service no longer writes into the caller's home dir; it creates a random temp dir under /var/log, exports system logs there, and returns the path. The frontend collects user-permission logs itself and copies the root-exported logs out. cp -rP avoids following symlinks, target dir is validated under /var/log, perms tightened to 0755/0644. root 服务不再写入用户家目录,改为在 /var/log 下创建随机临时目录导出系统 日志并返回路径;前端自行收集用户权限日志并拷贝 root 导出的内容。cp -rP 不跟随符号链接,校验目标目录位于 /var/log,权限收紧为 0755/0644。 Log: 重构运维日志导出,root 不再写入用户家目录 Influence: 消除 root 服务写入用户家目录的符号链接攻击面,改由 root 在 /var/log 随机目录导出、前端拷贝,提升安全性。
4142b4d to
60e1fe7
Compare
|
Warning
详情 {
"export": {
"application/dbusproxy/dldbushandler.cpp": {
"a": [
"bool DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<bool> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded:\" << reply.value();"
],
"b": [
"QString DLDBusHandler::exportOpsLog()",
" QDBusPendingReply<QString> reply = m_dbus->exportOpsLog();",
" qCDebug(logDBusHandler) << \"exportOpsLog succeeded, root temp dir:\" << reply.value();"
]
},
"application/dbusproxy/dldbushandler.h": {
"a": [
" bool exportOpsLog();"
],
"b": [
" QString exportOpsLog();"
]
},
"application/dbusproxy/dldbusinterface.h": {
"a": [
" inline QDBusPendingReply<bool> exportOpsLog()"
],
"b": [
" inline QDBusPendingReply<QString> exportOpsLog()"
]
},
"application/logallexportthread.cpp": {
"a": [
" DLDBusHandler::instance(this)->exportOpsLog();",
" Utils::exportSomeOpsLogs(opsLogPath, userHomePath);"
],
"b": [
" QString rootTempDir = DLDBusHandler::instance(this)->exportOpsLog();",
" qCWarning(logExportAll) << \"exportOpsLog returned empty or non-existent root temp dir, root-side ops logs may be missing\";",
" Utils::exportUserPermissionOpsLogs(opsLogPath, userHomePath);"
]
},
"application/opslogpaths.h": {
"b": [
"// \u524d\u7aef\uff08application/utils.cpp \u7684 exportUserPermissionOpsLogs \u7cfb\u5217\uff09\u4e0e",
"// root \u670d\u52a1\uff08logViewerService/opslogexport.cpp \u7684 createOpsLogDirStruct\uff09\u5fc5\u987b"
]
},
"application/utils.cpp": {
"a": [
"void Utils::exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir)"
],
"b": [
"// \u5b89\u5168\u62f7\u8d1d\u8f85\u52a9\uff1a\u5bf9\u9f50 root \u4fa7 opslogexport.cpp \u7684\u7b26\u53f7\u94fe\u63a5\u9632\u62a4\u7b56\u7565\u3002",
"void Utils::exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionKernelLogs(const QString &outDir)",
"void Utils::exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir)",
"void Utils::exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir)",
" Utils::exportUserPermissionAppLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionSystemLogs(outDir, userHomeDir);",
" Utils::exportUserPermissionKernelLogs(outDir);",
" Utils::exportUserPermissionDDELogs(outDir, userHomeDir);"
]
},
"application/utils.h": {
"a": [
" static void exportSomeOpsLogs(const QString &outDir, const QString &userHomeDir);"
],
"b": [
" static void exportUserPermissionAppLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionSystemLogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionKernelLogs(const QString &outDir);",
" static void exportUserPermissionDDELogs(const QString &outDir, const QString &userHomeDir);",
" static void exportUserPermissionOpsLogs(const QString &outDir, const QString &userHomeDir);"
]
},
"logViewerService/assets/data/com.deepin.logviewer.xml": {
"b": [
" <method name=\"exportOpsLog\">"
]
},
"logViewerService/assets/data/deepin-log-viewer-daemon.service": {
"b": [
"# exportOpsLog \u9700\u8981\u5728 /var/log \u4e0b\u521b\u5efa\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\uff0c\u987b\u663e\u5f0f\u653e\u5f00\u5199\u6743\u9650"
]
},
"logViewerService/logviewerservice.cpp": {
"a": [
"bool LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller home directory for export log\";"
],
"b": [
"QString LogViewerService::exportOpsLog()",
" qCWarning(logService) << \"Failed to get caller identity for export log\";",
" qCWarning(logService) << \"exportOpsLog: failed to create temporary dir under /var/log:\" << tmpOpsDir.errorString();",
" // \u6388\u6743\u6821\u9a8c\uff1a\u4e0e exportOpsLog \u4e00\u81f4\uff0c\u4f7f\u7528 s_Action_View\u3002",
" // \u65e0\u53c2\u8bbe\u8ba1\uff1a\u6e05\u7406\u7684\u662f\u670d\u52a1\u7aef\u5728 exportOpsLog \u4e2d\u6309\u5f53\u524d\u8c03\u7528\u8005\u7f13\u5b58\u7684\u672c\u8fdb\u7a0b\u4e34\u65f6\u76ee\u5f55\u8def\u5f84\uff0c"
]
},
"logViewerService/logviewerservice.h": {
"a": [
" Q_SCRIPTABLE bool exportOpsLog();"
],
"b": [
" Q_SCRIPTABLE QString exportOpsLog();",
" // \u6e05\u7406 exportOpsLog \u5728 /var/log \u4e0b\u521b\u5efa\u7684\u4e34\u65f6\u5bfc\u51fa\u76ee\u5f55\u3002\u65e0\u53c2\uff1a\u6e05\u7406\u7684\u662f\u670d\u52a1\u7aef\u7f13\u5b58",
" // exportOpsLog \u521b\u5efa\u7684 /var/log \u4e34\u65f6\u76ee\u5f55\u8def\u5f84\uff0c\u6309 D-Bus \u8c03\u7528\u65b9 unique bus name \u9694\u79bb\u5b58\u50a8\uff0c",
" // \u6309 fd-relative \u5b89\u5168\u65b9\u5f0f\u5220\u9664 exportOpsLog \u4ea7\u751f\u7684 /var/log \u4e34\u65f6\u76ee\u5f55\uff08path \u4e3a\u7f13\u5b58\u8def\u5f84\uff09\u3002"
]
},
"logViewerService/opslogexport.cpp": {
"a": [
" qWarning() << \"Failed to chown export path:\" << path << \"error:\" << strerror(errno);"
],
"b": [
" qWarning() << \"OpsLogExport::run: target directory safety check failed, aborting export\";",
" * target_dir \u7531 LogViewerService::exportOpsLog() \u901a\u8fc7 QTemporaryDir \u5728 /var/log \u4e0b",
" // - 0750/0640 \u800c\u975e 0755/0644\uff1a\u4ec5 caller \u540c\u7ec4\u53ef\u8bfb\uff0c\u907f\u514d\u4efb\u610f\u672c\u5730\u7528\u6237\u5728 exportOpsLog",
" qWarning() << \"Failed to chgrp export path:\" << path << \"error:\" << strerror(errno);"
]
}
}
} |
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // utils.cpp 中的 safeCpSkipSymlinks 优化:增加空列表检查,避免极端情况下执行无效的 cp 命令
static void safeCpSkipSymlinks(const QStringList &sources, const QString &dest, bool recursive)
{
QStringList validSources;
for (const QString &src : sources) {
if (QFileInfo(src).isSymLink()) {
qCWarning(logUtils) << "skip symlink source to avoid DoS:" << src;
continue;
}
validSources << src;
}
// 防御性检查:若所有源路径均为符号链接被过滤,直接返回,避免执行 "cp -P dest" 导致命令报错
if (validSources.isEmpty()) {
qCWarning(logUtils) << "no valid sources to copy after symlink filtering, skipping cp";
return;
}
QStringList args;
args << "-P"; // 不跟随源参数自身及递归树内的符号链接
if (recursive)
args << "-r";
args << validSources << dest;
Utils::executeCmd("cp", args);
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: GongHeng2017, max-lvs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
23fb3f5
into
linuxdeepin:release/eagle
… /var/log
Root service no longer writes into the caller's home dir; it creates a random temp dir under /var/log, exports system logs there, and returns the path. The frontend collects user-permission logs itself and copies the root-exported logs out. cp -rP avoids following symlinks, target dir is validated under /var/log, perms tightened to 0755/0644.
root 服务不再写入用户家目录,改为在 /var/log 下创建随机临时目录导出系统
日志并返回路径;前端自行收集用户权限日志并拷贝 root 导出的内容。cp -rP
不跟随符号链接,校验目标目录位于 /var/log,权限收紧为 0755/0644。
Log: 重构运维日志导出,root 不再写入用户家目录
Influence: 消除 root 服务写入用户家目录的符号链接攻击面,改由 root 在 /var/log 随机目录导出、前端拷贝,提升安全性。