Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ set(DTK_VERSION_MAJOR 6)
find_package(DtkBuildHelper REQUIRED)
find_package(Dtk${DTK_VERSION_MAJOR} REQUIRED COMPONENTS Tools)

include(CTest)

macro(install_symlink filepath wantsdir)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/link/${wantsdir}/)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/${filepath} ${PROJECT_BINARY_DIR}/link/${wantsdir}/${filepath})
Expand Down
3 changes: 1 addition & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ Architecture: any
Depends:
jq,
sed (>= 4),
dde-daemon (>= 6.1.102),
deepin-security-loader,
dde-daemon (>= 6.1.26),
libdtkdata (>=5.7.18),
libdtk6core (>=6.0.38),
systemd,
Expand Down
32 changes: 0 additions & 32 deletions misc/dde-session-loader-wrapper.in

This file was deleted.

22 changes: 0 additions & 22 deletions src/dde-session/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ file(GLOB_RECURSE DBUS_TYPES ${PROJECT_SOURCE_DIR}/dbus/types/*)

add_executable(dde-session
main.cpp
securityloaderhelper.h
securityloaderhelper.cpp
environmentsmanager.h
environmentsmanager.cpp
othersmanager.h
Expand Down Expand Up @@ -102,23 +100,3 @@ target_include_directories(dde-session PUBLIC
)

install(TARGETS dde-session DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS dde-session DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/deepin)

configure_file(${PROJECT_SOURCE_DIR}/misc/dde-session-loader-wrapper.in
${PROJECT_BINARY_DIR}/misc/dde-session-loader-wrapper
@ONLY)

install(PROGRAMS ${PROJECT_BINARY_DIR}/misc/dde-session-loader-wrapper
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/deepin)

if(BUILD_TESTING)
add_executable(securityloaderhelper_test
securityloaderhelper_test.cpp
securityloaderhelper.cpp
)
target_link_libraries(securityloaderhelper_test
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::DBus
)
add_test(NAME securityloaderhelper_test COMMAND securityloaderhelper_test)
endif()
16 changes: 2 additions & 14 deletions src/dde-session/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <DLog>

#include <systemd/sd-daemon.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/prctl.h>
Expand All @@ -27,7 +28,6 @@
#include "impl/iowait/iowaitwatcher.h"
#include "environmentsmanager.h"
#include "othersmanager.h"
#include "securityloaderhelper.h"

DCORE_USE_NAMESPACE

Expand Down Expand Up @@ -77,11 +77,7 @@ int main(int argc, char *argv[])
parser.addVersionOption();

QCommandLineOption systemd(QStringList{"d", "systemd-service", "wait for systemd services"});
QCommandLineOption fd1(QStringLiteral("fd1"), QStringLiteral("security loader request pipe"), QStringLiteral("fd"));
QCommandLineOption fd2(QStringLiteral("fd2"), QStringLiteral("security loader response pipe"), QStringLiteral("fd"));
parser.addOption(systemd);
parser.addOption(fd1);
parser.addOption(fd2);
parser.process(app);

DLogManager::registerJournalAppender();
Expand Down Expand Up @@ -116,15 +112,6 @@ int main(int argc, char *argv[])
}

/* ---systemd-service--- */
QString securityLoaderError;
const SecurityLoaderInfo loaderInfo = parseSecurityLoaderFds(parser.isSet(fd1), parser.value(fd1),
parser.isSet(fd2), parser.value(fd2),
&securityLoaderError);
const QString systemBusUniqueName = systemBusConnection().baseService();
if (loaderInfo.loaded && !authorizePowerCaller(loaderInfo, systemBusUniqueName, &securityLoaderError)) {
qCritical() << "Security loader handshake failed:" << securityLoaderError;
return EXIT_FAILURE;
}

auto* session = new Session(&app);
new Session1Adaptor(session);
Expand Down Expand Up @@ -169,6 +156,7 @@ int main(int argc, char *argv[])
qInfo() << "pipe read finish, app exit.";
QMetaObject::invokeMethod(qApp, &QCoreApplication::quit, Qt::QueuedConnection);
});
sd_notify(0, "READY=1");

return app.exec();
}
Loading
Loading