diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-03-31 23:49:47 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-03-31 23:49:47 +0900 |
commit | 4ed967f2cb719aabd74f80be4ccb60a6594b089a (patch) | |
tree | bae95a71715861710fc6ee2ca63525808dd98284 | |
parent | 2bf7659ed8669c62f4252b5cf7a5000c96ddd521 (diff) | |
download | tdebase-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 <michele.calgaro@yahoo.it>
-rw-r--r-- | kcontrol/screensaver/scrnsave.cpp | 19 | ||||
-rw-r--r-- | kdesktop/lock/main.cc | 16 | ||||
-rw-r--r-- | tdm/backend/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tdm/backend/dm.c | 4 | ||||
-rw-r--r-- | tdm/backend/session.c | 25 | ||||
-rw-r--r-- | tdm/config.def | 3 | ||||
-rw-r--r-- | tdm/kfrontend/kgapp.cpp | 22 |
7 files changed, 45 insertions, 47 deletions
diff --git a/kcontrol/screensaver/scrnsave.cpp b/kcontrol/screensaver/scrnsave.cpp index a0b26ae46..b66f7bbd6 100644 --- a/kcontrol/screensaver/scrnsave.cpp +++ b/kcontrol/screensaver/scrnsave.cpp @@ -46,20 +46,9 @@ #include <ksimpleconfig.h> #include <X11/Xlib.h> - #include "scrnsave.h" - #include <fixx11h.h> -#define OPEN_TDMCONFIG_AND_SET_GROUP \ -if( stat( KDE_CONFDIR "/tdm/tdmdistrc" , &st ) == 0) { \ - mTDMConfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmdistrc" )); \ -} \ -else { \ - mTDMConfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmrc" )); \ -} \ -mTDMConfig->setGroup("X-:*-Greeter"); - template class TQPtrList<SaverConfig>; const uint widgetEventMask = // X event mask @@ -94,7 +83,13 @@ KScreenSaver::KScreenSaver(TQWidget *parent, const char *name, const TQStringLis mTesting = false; struct stat st; - OPEN_TDMCONFIG_AND_SET_GROUP + if( stat( KDE_CONFDIR "/tdm/tdmdistrc" , &st ) == 0) { + mTDMConfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmdistrc" )); + } + else { + mTDMConfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmrc" )); + } + mTDMConfig->setGroup("X-:*-Greeter"); // Add non-TDE path TDEGlobal::dirs()->addResourceType("scrsav", diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc index a79f6924f..e0ba2b662 100644 --- a/kdesktop/lock/main.cc +++ b/kdesktop/lock/main.cc @@ -54,14 +54,6 @@ # include <fixx11h.h> #endif -#define OPEN_TDMCONFIG_AND_SET_GROUP \ -if( stat( KDE_CONFDIR "/tdm/tdmdistrc" , &st ) == 0) { \ - tdmconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmdistrc" )); \ -} \ -else { \ - tdmconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmrc" )); \ -} \ -tdmconfig->setGroup("X-:*-Greeter"); TQXLibWindowList trinity_desktop_lock_hidden_window_list; @@ -369,7 +361,13 @@ int main( int argc, char **argv ) struct stat st; KSimpleConfig* tdmconfig; - OPEN_TDMCONFIG_AND_SET_GROUP + if( stat( KDE_CONFDIR "/tdm/tdmdistrc" , &st ) == 0) { + tdmconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmdistrc" )); + } + else { + tdmconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmrc" )); + } + tdmconfig->setGroup("X-:*-Greeter"); trinity_desktop_lock_process = new LockProcess; 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 )) diff --git a/tdm/config.def b/tdm/config.def index 124887f20..5cfc56ed5 100644 --- a/tdm/config.def +++ b/tdm/config.def @@ -2011,10 +2011,11 @@ Description: Key: UseSAK Type: bool Default: false +User: core User: greeter Instance: #:*/false Comment: - SAK + Use SAK Description: If true then the SAK anti-spoofing dialog will be utilized diff --git a/tdm/kfrontend/kgapp.cpp b/tdm/kfrontend/kgapp.cpp index b1495c8af..4ea540285 100644 --- a/tdm/kfrontend/kgapp.cpp +++ b/tdm/kfrontend/kgapp.cpp @@ -66,8 +66,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <pwd.h> -#define TSAK_FIFO_FILE "/tmp/tdesocket-global/tsak" - bool argb_visual_available = false; bool has_twin = false; bool is_themed = false; @@ -215,7 +213,6 @@ kg_main( const char *argv0 ) TDEApplication::disableAutoDcopRegistration(); TDECrash::setSafer( true ); - TDEProcess *tsak = 0; TDEProcess *kbdl = 0; TDEProcess *proc = 0; TDEProcess *comp = 0; @@ -227,25 +224,6 @@ kg_main( const char *argv0 ) #else trinity_desktop_lock_use_sak = false; #endif - if (trinity_desktop_lock_use_sak) { - if (system(KDE_BINDIR "/tsak checkdeps") != 0) { - trinity_desktop_lock_use_sak = false; - } - } - if (trinity_desktop_lock_use_sak) { - tsak = new TDEProcess; - *tsak << TQCString( argv0, strrchr( argv0, '/' ) - argv0 + 2 ) + "tsak"; - tsak->start(TDEProcess::Block, TDEProcess::AllOutput); - } - else { - remove(TSAK_FIFO_FILE); - } - if (tsak) { - tsak->closeStdin(); - tsak->closeStdout(); - tsak->detach(); - delete tsak; - } if (trinity_desktop_synchronize_keyboard_lights && TQString(getenv("DISPLAY")).startsWith(":")) { |