Changeset View
Changeset View
Standalone View
Standalone View
x11/kde4-workspace/files/patch-kdm__backend__client.c
--- kdm/backend/client.c.orig 2014-11-06 23:36:58.000000000 +0100 | --- kdm/backend/client.c.orig 2015-06-26 03:17:21 UTC | ||||
+++ kdm/backend/client.c 2015-03-09 13:20:24.870430799 +0100 | +++ kdm/backend/client.c | ||||
@@ -1322,6 +1322,9 @@ | @@ -1322,6 +1322,9 @@ startClient(volatile int *pid) | ||||
char ckDeviceBuf[20] = ""; | char ckDeviceBuf[20] = ""; | ||||
const char *ckDevice = ckDeviceBuf; | const char *ckDevice = ckDeviceBuf; | ||||
dbus_bool_t isLocal; | dbus_bool_t isLocal; | ||||
+# ifdef BSD | +# ifdef BSD | ||||
+ FILE *proc; | + FILE *proc; | ||||
+# endif | +# endif | ||||
#endif | #endif | ||||
char *failsafeArgv[2]; | char *failsafeArgv[2]; | ||||
char *buf, *buf2; | char *buf, *buf2; | ||||
@@ -1353,6 +1356,13 @@ | @@ -1353,6 +1356,13 @@ startClient(volatile int *pid) | ||||
# ifdef HAVE_VTS | # ifdef HAVE_VTS | ||||
if (td->serverVT > 0) | if (td->serverVT > 0) | ||||
sprintf(ckDeviceBuf, "/dev/tty%d", td->serverVT); | sprintf(ckDeviceBuf, "/dev/tty%d", td->serverVT); | ||||
+# elif defined(BSD) | +# elif defined(BSD) | ||||
+ if ((proc = popen( "/usr/local/libexec/ck-get-x11-display-device", "r" ))) { | + if ((proc = popen( "/usr/local/libexec/ck-get-x11-display-device", "r" ))) { | ||||
+ fscanf( proc, "%s", ckDeviceBuf ); | + fscanf( proc, "%s", ckDeviceBuf ); | ||||
+ pclose(proc); | + pclose(proc); | ||||
+ if (strcmp( ckDeviceBuf, "usage" ) == 0 || strcmp( ckDeviceBuf, "ERROR:" ) == 0) | + if (strcmp( ckDeviceBuf, "usage" ) == 0 || strcmp( ckDeviceBuf, "ERROR:" ) == 0) | ||||
+ ckDeviceBuf[0] = '\0'; | + ckDeviceBuf[0] = '\0'; | ||||
+ } | + } | ||||
# endif | # endif | ||||
isLocal = ((td->displayType & d_location) == dLocal); | isLocal = ((td->displayType & d_location) == dLocal); | ||||
# ifdef XDMCP | # ifdef XDMCP | ||||
@@ -1532,7 +1542,7 @@ | @@ -1532,7 +1542,7 @@ startClient(volatile int *pid) | ||||
environ = pam_env; | environ = pam_env; | ||||
# endif | # endif | ||||
removeCreds = True; /* set it first - i don't trust PAM's rollback */ | removeCreds = True; /* set it first - i don't trust PAM's rollback */ | ||||
- pretc = pam_setcred(pamh, 0); | - pretc = pam_setcred(pamh, 0); | ||||
+ pretc = pam_setcred(pamh, PAM_ESTABLISH_CRED); | + pretc = pam_setcred(pamh, PAM_ESTABLISH_CRED); | ||||
reInitErrorLog(); | reInitErrorLog(); | ||||
# ifndef HAVE_PAM_GETENVLIST | # ifndef HAVE_PAM_GETENVLIST | ||||
pam_env = environ; | pam_env = environ; |