rev 3638 - trunk/packages/kdebase/debian/patches

Christopher Martin chrsmrtn at costa.debian.org
Sat Apr 22 16:48:19 UTC 2006


Author: chrsmrtn
Date: 2006-04-22 16:48:18 +0000 (Sat, 22 Apr 2006)
New Revision: 3638

Added:
   trunk/packages/kdebase/debian/patches/16_kdm_X_path.diff
Log:
Add a patch which should cover partial/borked dist-upgrades, people
with old kdmrc files, etc.

Basically, if the X binary in kdmrc isn't found, try /usr/X11R6/bin/X,
then /usr/bin/X.

Someone who really knows how to code - please check this, and made sure
I'm not doing something really, really, silly or bad. Thanks.


Added: trunk/packages/kdebase/debian/patches/16_kdm_X_path.diff
===================================================================
--- trunk/packages/kdebase/debian/patches/16_kdm_X_path.diff	2006-04-22 16:46:47 UTC (rev 3637)
+++ trunk/packages/kdebase/debian/patches/16_kdm_X_path.diff	2006-04-22 16:48:18 UTC (rev 3638)
@@ -0,0 +1,64 @@
+--- kde.orig/kdm/backend/server.c
++++ kde.patched/kdm/backend/server.c
+@@ -41,6 +41,7 @@
+ #include <X11/Xlib.h>
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <signal.h>
+ 
+ 
+@@ -94,6 +95,21 @@
+ 		(void)Signal( SIGUSR1, SIG_IGN );
+ 		(void)execv( argv[0], argv );
+ 		LogError( "X server %\"s cannot be executed\n", argv[0] );
++		
++		/* 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";
++			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 */
++			Debug( "exec %\"[s\n", argv );
++			(void)execv( argv[0], argv );
++			LogError( "X server %\"s cannot be executed\n", argv[0] );
++		}
++		
+ 		exit( 47 );
+ 	case -1:
+ 		LogError( "X server fork failed\n" );
+--- kde.orig/kdm/backend/dm.c
++++ kde.patched/kdm/backend/dm.c
+@@ -39,6 +39,7 @@
+ #include "dm_error.h"
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+@@ -564,6 +565,21 @@
+ 		Debug( "exec %\"[s\n", argv );
+ 		(void)execv( argv[0], argv );
+ 		LogError( "X server %\"s cannot be executed\n", argv[0] );
++		
++		/* 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";
++			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 */
++			Debug( "exec %\"[s\n", argv );
++			(void)execv( argv[0], argv );
++			LogError( "X server %\"s cannot be executed\n", argv[0] );
++		}
++		
+ 		exit( 1 );
+ 	case -1:
+ 		LogError( "Forking X server for remote login failed: %m" );




More information about the pkg-kde-commits mailing list