ソースを参照

Fixed session locking at login. This resolves bug 2874.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/2/head
Michele Calgaro 10ヶ月前
コミット
a359fef24e
3個のファイルの変更28行の追加12行の削除
  1. 2
    0
      kdesktop/CMakeLists.txt
  2. 26
    0
      kdesktop/lockeng.cc
  3. 0
    12
      starttde

+ 2
- 0
kdesktop/CMakeLists.txt ファイルの表示

@@ -81,6 +81,8 @@ tde_add_executable( kxdglauncher
81 81
 ##### kdesktop (tdeinit) ########################
82 82
 
83 83
 set( target kdesktop )
84
+set_source_files_properties( lockeng.cc PROPERTIES COMPILE_FLAGS -DKDE_CONFDIR=\\"${TDE_CONFIG_DIR}\\" )
85
+
84 86
 
85 87
 set( ${target}_SRCS
86 88
   main.cc krootwm.cc xautolock.cc kdiconview.cc init.cc

+ 26
- 0
kdesktop/lockeng.cc ファイルの表示

@@ -10,6 +10,7 @@
10 10
 #include <config.h>
11 11
 
12 12
 #include <stdlib.h>
13
+#include <sys/stat.h>
13 14
 
14 15
 #include <ksslcertificate.h>
15 16
 
@@ -19,6 +20,7 @@
19 20
 #include <kstandarddirs.h>
20 21
 #include <tdeapplication.h>
21 22
 #include <kservicegroup.h>
23
+#include <ksimpleconfig.h>
22 24
 #include <kdebug.h>
23 25
 #include <kuser.h>
24 26
 #include <tdelocale.h>
@@ -165,6 +167,30 @@ SaverEngine::SaverEngine()
165 167
 	sigaddset(&mThreadBlockSet, SIGTTIN);
166 168
 	pthread_sigmask(SIG_BLOCK, &mThreadBlockSet, NULL);
167 169
 
170
+	// Wait for the saver process to signal ready...
171
+	if (!waitForLockProcessStart()) {
172
+		kdDebug( 1204 ) << "Failed to initialize kdesktop_lock (unexpected termination)!" << endl;
173
+	}
174
+
175
+	// lock the desktop if required
176
+	KSimpleConfig *config;
177
+  struct stat st;
178
+  if (stat( KDE_CONFDIR "/tdm/tdmdistrc" , &st) == 0) {
179
+    config = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmdistrc" ));
180
+  }
181
+  else {
182
+    config = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmrc" ));
183
+  }
184
+  config->setGroup("X-:0-Core");
185
+  bool autoLoginEnable = config->readBoolEntry("AutoLoginEnable", false);
186
+  bool autoLoginLocked = config->readBoolEntry("AutoLoginLocked", false);
187
+  if (autoLoginEnable && autoLoginLocked) {
188
+		mLockProcess.kill(SIGTTOU);
189
+		mLockProcess.kill(SIGUSR1);
190
+	}
191
+	delete config;
192
+	config = NULL;
193
+
168 194
 	// Initialize SmartCard readers
169 195
 	TDEGenericDevice *hwdevice;
170 196
 	TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();

+ 0
- 12
starttde ファイルの表示

@@ -745,18 +745,6 @@ if test $? -ne 0; then
745 745
 fi
746 746
 echo "[starttde] tdeinit started successfully." 1>&2
747 747
 
748
-# If the session should be locked from the start (locked autologin),
749
-# lock now and do the rest of the TDE startup underneath the locker.
750
-# FIXME
751
-# kdesktop needs to be notified of this locker process somehow so that
752
-# it does not attempt to launch its own locker process on startup!
753
-if test -n "$dl"; then
754
-  $TDEDIR/bin/kwrapper kdesktop_lock --forcelock &
755
-  # Give it some time for starting up. This is somewhat unclean; some
756
-  # notification would be better.
757
-  sleep 1
758
-fi
759
-
760 748
 # Finally, give the session control to the session manager.
761 749
 # See tdebase/ksmserver for the description of the rest of the startup sequence.
762 750
 # When set, the TDEWM environment variable will be used as Trinity's

読み込み中…
キャンセル
保存