summaryrefslogtreecommitdiffstats
path: root/tdm/backend
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2019-03-31 23:49:47 +0900
committerMichele Calgaro <[email protected]>2019-03-31 23:49:47 +0900
commit4ed967f2cb719aabd74f80be4ccb60a6594b089a (patch)
treebae95a71715861710fc6ee2ca63525808dd98284 /tdm/backend
parent2bf7659ed8669c62f4252b5cf7a5000c96ddd521 (diff)
downloadtdebase-4ed967f2cb719aabd74f80be4ccb60a6594b089a.tar.gz
tdebase-4ed967f2cb719aabd74f80be4ccb60a6594b089a.zip
Fixed use of SAK in lock process when autologin is used in TDM.
This resolves bug 2945. Manually cherry-picked from commit 7aa9258f. Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'tdm/backend')
-rw-r--r--tdm/backend/CMakeLists.txt3
-rw-r--r--tdm/backend/dm.c4
-rw-r--r--tdm/backend/session.c25
3 files changed, 29 insertions, 3 deletions
diff --git a/tdm/backend/CMakeLists.txt b/tdm/backend/CMakeLists.txt
index da3f3ac03..bece8be72 100644
--- a/tdm/backend/CMakeLists.txt
+++ b/tdm/backend/CMakeLists.txt
@@ -15,6 +15,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}
${DBUS_INCLUDE_DIRS}
+ ${CMAKE_SOURCE_DIR}/tdm/kfrontend
)
link_directories(
@@ -27,7 +28,7 @@ add_custom_command( OUTPUT config.ci
COMMAND perl -w ${CMAKE_SOURCE_DIR}/tdm/confproc.pl ${CMAKE_SOURCE_DIR}/tdm/config.def config.ci
DEPENDS ${CMAKE_SOURCE_DIR}/tdm/confproc.pl ${CMAKE_SOURCE_DIR}/tdm/config.def )
-set_property( SOURCE auth.c APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/config.ci )
+set_property( SOURCE auth.c session.c APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/config.ci )
if( WITH_XDMCP )
set( XDMCP_LIBRARIES "Xdmcp" )
diff --git a/tdm/backend/dm.c b/tdm/backend/dm.c
index cd672f39a..996059c87 100644
--- a/tdm/backend/dm.c
+++ b/tdm/backend/dm.c
@@ -570,12 +570,12 @@ StartRemoteLogin( struct display *d )
/* Let's try again with some standard paths */
argv[0] = (char *)realloc(argv[0], strlen("/usr/X11R6/bin/X") + 1);
if (argv[0] != NULL) {
- argv[0] = "/usr/X11R6/bin/X";
+ strcpy(argv[0], "/usr/X11R6/bin/X");
Debug( "exec %\"[s\n", argv );
(void)execv( argv[0], argv );
LogError( "X server %\"s cannot be executed\n", argv[0] );
- argv[0] = "/usr/bin/X"; /* Shorter than the previous file name */
+ strcpy(argv[0], "/usr/bin/X"); // Shorter than the previous file name
Debug( "exec %\"[s\n", argv );
(void)execv( argv[0], argv );
LogError( "X server %\"s cannot be executed\n", argv[0] );
diff --git a/tdm/backend/session.c b/tdm/backend/session.c
index 4b5f372db..0bcd92d5f 100644
--- a/tdm/backend/session.c
+++ b/tdm/backend/session.c
@@ -34,6 +34,8 @@ from the copyright holder.
* subdaemon event loop, etc.
*/
+
+#include "tdmconfig.h"
#include "dm.h"
#include "dm_error.h"
@@ -49,6 +51,8 @@ from the copyright holder.
#include "consolekit.h"
#endif
+#define TSAK_FIFO_FILE "/tmp/tdesocket-global/tsak"
+
struct display *td;
const char *td_setup = "auto";
@@ -576,6 +580,27 @@ ManageSession( struct display *d )
goto regreet;
}
+ int start_tsak = 0;
+#ifdef BUILD_TSAK
+ start_tsak = d->useSAK;
+#endif
+ if (start_tsak) {
+ if (system(KDE_BINDIR "/tsak checkdeps") != 0) {
+ start_tsak = 0;
+ }
+ }
+ if (start_tsak) {
+ int ret_pid = fork();
+ if (ret_pid == 0) {
+ // Child process
+ system(KDE_BINDIR "/tsak");
+ exit(0);
+ }
+ }
+ else {
+ remove(TSAK_FIFO_FILE);
+ }
+
tdiff = time( 0 ) - td->hstent->lastExit - td->openDelay;
if (AutoLogon( tdiff )) {
if (!Verify( conv_auto, FALSE ))