[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/kdm
From: Oswald Buddenhagen <ossi () kde ! org>
Date: 2007-11-10 18:59:20
Message-ID: 1194721160.468961.23685.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 735053 by ossi:
when the user session requested a shutdown that needs confirmation or a
password, don't put the dialog at the start of the next kdm session (and
thus reset/disconnect the x server in between), but do it in the current
kdm session after the user session exits.
BUG: 104249
M +46 -28 backend/dm.c
M +1 -0 backend/dm.h
M +1 -0 backend/greet.h
M +12 -13 backend/session.c
M +4 -2 kfrontend/kgapp.cpp
--- trunk/KDE/kdebase/workspace/kdm/backend/dm.c #735052:735053
@@ -625,6 +625,18 @@
}
+static void
+sessionDone( struct display *d )
+{
+ d->userSess = -1;
+ if (d->userName)
+ free( d->userName );
+ d->userName = 0;
+ if (d->sessName)
+ free( d->sessName );
+ d->sessName = 0;
+}
+
void
setNLogin( struct display *d,
const char *nuser, const char *npass, char *nargs, int rl )
@@ -640,6 +652,7 @@
static void
processDPipe( struct display *d )
{
+ struct disphist *he;
char *user, *pass, *args;
int cmd;
GTalk dpytalk;
@@ -665,6 +678,31 @@
d->userName = gRecvStr();
d->sessName = gRecvStr();
break;
+ case D_UnUser:
+ sessionDone( d );
+ he = d->hstent;
+ if (he->sdRec.how) {
+ if (he->sdRec.force == SHUT_ASK &&
+ (anyUserLogins( -1 ) || d->allowShutdown == SHUT_ROOT))
+ {
+ gSendInt( TRUE );
+ } else {
+ if (!sdRec.how || sdRec.force != SHUT_FORCE ||
+ !((d->allowNuke == SHUT_NONE && sdRec.uid != he->sdRec.uid) ||
+ (d->allowNuke == SHUT_ROOT && he->sdRec.uid)))
+ {
+ if (sdRec.osname)
+ free( sdRec.osname );
+ sdRec = he->sdRec;
+ } else if (he->sdRec.osname)
+ free( he->sdRec.osname );
+ he->sdRec.how = 0;
+ he->sdRec.osname = 0;
+ gSendInt( FALSE );
+ }
+ } else
+ gSendInt( FALSE );
+ break;
case D_ReLogin:
user = gRecvStr();
pass = gRecvStr();
@@ -787,6 +825,11 @@
gSendInt( sdRec.uid );
gSendStr( sdRec.osname );
break;
+ case G_QryDpyShutdown:
+ gSendInt( d->hstent->sdRec.how );
+ gSendInt( d->hstent->sdRec.uid );
+ gSendStr( d->hstent->sdRec.osname );
+ break;
case G_List:
listSessions( gRecvInt(), d, 0, emitXSessG, emitTTYSessG );
gSendInt( 0 );
@@ -1489,37 +1532,12 @@
"endState = %d, serverCmd = %d, GoodExit = %d\n",
d->name, endState, serverCmd, goodExit );
- d->userSess = -1;
- if (d->userName)
- free( d->userName );
- d->userName = 0;
- if (d->sessName)
- free( d->sessName );
- d->sessName = 0;
+ sessionDone( d );
he = d->hstent;
he->lastExit = now;
he->goodExit = goodExit;
- if (he->sdRec.how) {
- if (he->sdRec.force == SHUT_ASK &&
- (anyUserLogins( -1 ) || d->allowShutdown == SHUT_ROOT))
- {
- endState = DS_RESTART;
- } else {
- if (!sdRec.how || sdRec.force != SHUT_FORCE ||
- !((d->allowNuke == SHUT_NONE && sdRec.uid != he->sdRec.uid) ||
- (d->allowNuke == SHUT_ROOT && he->sdRec.uid)))
- {
- if (sdRec.osname)
- free( sdRec.osname );
- sdRec = he->sdRec;
- if (now < sdRec.timeout || wouldShutdown())
- endState = DS_REMOVE;
- } else if (he->sdRec.osname)
- free( he->sdRec.osname );
- he->sdRec.how = 0;
- he->sdRec.osname = 0;
- }
- }
+ if (sdRec.how && sdRec.start == TO_INF)
+ endState = DS_REMOVE;
if (d->status == zombie)
rStopDisplay( d, d->zstatus );
else {
--- trunk/KDE/kdebase/workspace/kdm/backend/dm.h #735052:735053
@@ -352,6 +352,7 @@
#define D_ChooseHost 4
#define D_RemoteHost 5
#define D_XConnOk 6
+#define D_UnUser 7
extern int debugLevel;
--- trunk/KDE/kdebase/workspace/kdm/backend/greet.h #735052:735053
@@ -182,6 +182,7 @@
# define BO_IO -3
#define G_Console 116 /* ; async */
#define G_AutoLogin 117 /* ; async */
+#define G_QryDpyShutdown 118 /* ; int, int, str */
/*
* Command codes core -> config reader
--- trunk/KDE/kdebase/workspace/kdm/backend/session.c #735052:735053
@@ -571,19 +571,6 @@
/* NOTREACHED */
#endif
- if (d->hstent->sdRec.how) {
- openGreeter();
- gSendInt( G_ConfShutdown );
- gSendInt( d->hstent->sdRec.how );
- gSendInt( d->hstent->sdRec.uid );
- gSendStr( d->hstent->sdRec.osname );
- if ((cmd = ctrlGreeterWait( TRUE )) != G_Ready) {
- logError( "Received unknown command %d from greeter\n", cmd );
- closeGreeter( TRUE );
- }
- goto regreet;
- }
-
tdiff = time( 0 ) - td->hstent->lastExit - td->openDelay;
if (autoLogon( tdiff )) {
if (!verify( conv_auto, FALSE ))
@@ -668,6 +655,18 @@
sleep( 10 );
sessionExit( EX_AL_RESERVER_DPY );
}
+
+ gSet( &mstrtalk );
+ gSendInt( D_UnUser );
+ if (gRecvInt()) {
+ openGreeter();
+ gSendInt( G_ConfShutdown );
+ if ((cmd = ctrlGreeterWait( TRUE )) != G_Ready) {
+ logError( "Received unknown command %d from greeter\n", cmd );
+ closeGreeter( TRUE );
+ }
+ }
+
sessionExit( EX_NORMAL ); /* XXX maybe EX_REMANAGE_DPY? -- enable in dm.c! */
}
--- trunk/KDE/kdebase/workspace/kdm/kfrontend/kgapp.cpp #735052:735053
@@ -261,14 +261,16 @@
int cmd = gRecvInt();
if (cmd == G_ConfShutdown) {
+ gSet( 1 );
+ gSendInt( G_QryDpyShutdown );
int how = gRecvInt(), uid = gRecvInt();
char *os = gRecvStr();
+ gSet( 0 );
KDMSlimShutdown::externShutdown( how, os, uid );
if (os)
free( os );
gSendInt( G_Ready );
- _autoLoginDelay = 0;
- continue;
+ break;
}
if (cmd == G_ErrorGreet) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic