Fixed use of SAK in lock process when autologin is used in TDM.

This resolves bug 2945.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/30/head
Michele Calgaro 5 years ago
parent c80e5d45b7
commit 7aa9258f19
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -46,20 +46,9 @@
#include <ksimpleconfig.h> #include <ksimpleconfig.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include "scrnsave.h" #include "scrnsave.h"
#include <fixx11h.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>; template class TQPtrList<SaverConfig>;
const uint widgetEventMask = // X event mask const uint widgetEventMask = // X event mask
@ -94,7 +83,13 @@ KScreenSaver::KScreenSaver(TQWidget *parent, const char *name, const TQStringLis
mTesting = false; mTesting = false;
struct stat st; 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 // Add non-TDE path
TDEGlobal::dirs()->addResourceType("scrsav", TDEGlobal::dirs()->addResourceType("scrsav",

@ -54,14 +54,6 @@
# include <fixx11h.h> # include <fixx11h.h>
#endif #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; TQXLibWindowList trinity_desktop_lock_hidden_window_list;
@ -376,7 +368,13 @@ int main( int argc, char **argv )
struct stat st; struct stat st;
KSimpleConfig* tdmconfig; 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");
// Create new LockProcess, which also spawns threads inheriting the blocked signal mask // Create new LockProcess, which also spawns threads inheriting the blocked signal mask
trinity_desktop_lock_process = new LockProcess; trinity_desktop_lock_process = new LockProcess;

@ -15,6 +15,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${DBUS_INCLUDE_DIRS} ${DBUS_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/tdm/kfrontend
) )
link_directories( 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 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 ) 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 ) if( WITH_XDMCP )
set( XDMCP_LIBRARIES "Xdmcp" ) set( XDMCP_LIBRARIES "Xdmcp" )

@ -576,12 +576,12 @@ StartRemoteLogin( struct display *d )
/* Let's try again with some standard paths */ /* Let's try again with some standard paths */
argv[0] = (char *)realloc(argv[0], strlen("/usr/X11R6/bin/X") + 1); argv[0] = (char *)realloc(argv[0], strlen("/usr/X11R6/bin/X") + 1);
if (argv[0] != NULL) { if (argv[0] != NULL) {
argv[0] = "/usr/X11R6/bin/X"; strcpy(argv[0], "/usr/X11R6/bin/X");
Debug( "exec %\"[s\n", argv ); Debug( "exec %\"[s\n", argv );
(void)execv( argv[0], argv ); (void)execv( argv[0], argv );
LogError( "X server %\"s cannot be executed\n", argv[0] ); 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 ); Debug( "exec %\"[s\n", argv );
(void)execv( argv[0], argv ); (void)execv( argv[0], argv );
LogError( "X server %\"s cannot be executed\n", argv[0] ); LogError( "X server %\"s cannot be executed\n", argv[0] );

@ -34,6 +34,8 @@ from the copyright holder.
* subdaemon event loop, etc. * subdaemon event loop, etc.
*/ */
#include "tdmconfig.h"
#include "dm.h" #include "dm.h"
#include "dm_error.h" #include "dm_error.h"
@ -49,6 +51,8 @@ from the copyright holder.
#include "consolekit.h" #include "consolekit.h"
#endif #endif
#define TSAK_FIFO_FILE "/tmp/tdesocket-global/tsak"
struct display *td; struct display *td;
const char *td_setup = "auto"; const char *td_setup = "auto";
@ -576,6 +580,27 @@ ManageSession( struct display *d )
goto regreet; 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; tdiff = time( 0 ) - td->hstent->lastExit - td->openDelay;
if (AutoLogon( tdiff )) { if (AutoLogon( tdiff )) {
if (!Verify( conv_auto, FALSE )) if (!Verify( conv_auto, FALSE ))

@ -2011,10 +2011,11 @@ Description:
Key: UseSAK Key: UseSAK
Type: bool Type: bool
Default: false Default: false
User: core
User: greeter User: greeter
Instance: #:*/false Instance: #:*/false
Comment: Comment:
SAK Use SAK
Description: Description:
If true then the SAK anti-spoofing dialog will be utilized If true then the SAK anti-spoofing dialog will be utilized

@ -67,8 +67,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <pwd.h> #include <pwd.h>
#define TSAK_FIFO_FILE "/tmp/tdesocket-global/tsak"
bool argb_visual_available = false; bool argb_visual_available = false;
bool has_twin = false; bool has_twin = false;
bool is_themed = false; bool is_themed = false;
@ -217,7 +215,6 @@ kg_main( const char *argv0 )
TDEApplication::disableAutoDcopRegistration(); TDEApplication::disableAutoDcopRegistration();
TDECrash::setSafer( true ); TDECrash::setSafer( true );
TDEProcess *tsak = 0;
TDEProcess *kbdl = 0; TDEProcess *kbdl = 0;
TDEProcess *ccsm = 0; TDEProcess *ccsm = 0;
TDEProcess *proc = 0; TDEProcess *proc = 0;
@ -230,25 +227,6 @@ kg_main( const char *argv0 )
#else #else
trinity_desktop_lock_use_sak = false; trinity_desktop_lock_use_sak = false;
#endif #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 && if (trinity_desktop_synchronize_keyboard_lights &&
TQString(getenv("DISPLAY")).startsWith(":")) { TQString(getenv("DISPLAY")).startsWith(":")) {

Loading…
Cancel
Save