summaryrefslogtreecommitdiffstats
path: root/kdm
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-25 08:33:19 -0500
committerSlávek Banko <slavek.banko@axis.cz>2013-04-25 17:39:40 +0200
commit83299a9d01c3ea0d0b20f13d1e123a4d7916a329 (patch)
tree17137893bd4a980f62bc73bd4af486608b3df063 /kdm
parent67afcf177ecfb742d1c90b644795e4e66537fa7f (diff)
downloadtdebase-83299a9d01c3ea0d0b20f13d1e123a4d7916a329.tar.gz
tdebase-83299a9d01c3ea0d0b20f13d1e123a4d7916a329.zip
Ensure that tdm always reacquires root ownership after user listing is complete
This resolves Bug 1402 (cherry picked from commit 33dc3f2d3960e4a7e5d51b00a6e511a7e326d36f)
Diffstat (limited to 'kdm')
-rw-r--r--kdm/kfrontend/kgreeter.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/kdm/kfrontend/kgreeter.cpp b/kdm/kfrontend/kgreeter.cpp
index 6a236ef81..bb53d4afa 100644
--- a/kdm/kfrontend/kgreeter.cpp
+++ b/kdm/kfrontend/kgreeter.cpp
@@ -193,8 +193,9 @@ KGreeter::KGreeter( bool framed )
connect( userView, TQT_SIGNAL(doubleClicked( TQListViewItem * )),
TQT_SLOT(accept()) );
}
- if (_userCompletion)
+ if (_userCompletion) {
userList = new TQStringList;
+ }
sessMenu = new TQPopupMenu( this );
connect( sessMenu, TQT_SIGNAL(activated( int )),
@@ -374,10 +375,14 @@ KGreeter::insertUser( const TQImage &default_pix,
return;
}
- if (userList)
+ if (userList) {
userList->append( username );
- if (!userView)
+ }
+ if (!userView) {
+ seteuid(0);
+ setegid(0);
return;
+ }
int dp = 0, nd = 0;
if (_faceSource == FACE_USER_ONLY ||
@@ -396,8 +401,9 @@ KGreeter::insertUser( const TQImage &default_pix,
int fd, ico;
if ((fd = open( fn.data(), O_RDONLY | O_NONBLOCK )) < 0) {
fn.truncate( fn.length() - 5 );
- if ((fd = open( fn.data(), O_RDONLY | O_NONBLOCK )) < 0)
+ if ((fd = open( fn.data(), O_RDONLY | O_NONBLOCK )) < 0) {
continue;
+ }
ico = 0;
} else
ico = 1;
@@ -405,8 +411,7 @@ KGreeter::insertUser( const TQImage &default_pix,
f.open( IO_ReadOnly, fd );
int fs = f.size();
if (fs > (ico ? FILE_LIMIT_ICON : FILE_LIMIT_IMAGE) * 1000) {
- LogWarn( "%s exceeds file size limit (%dkB)\n",
- fn.data(), ico ? FILE_LIMIT_ICON : FILE_LIMIT_IMAGE );
+ LogWarn( "%s exceeds file size limit (%dkB)\n", fn.data(), ico ? FILE_LIMIT_ICON : FILE_LIMIT_IMAGE );
continue;
}
TQByteArray fc( fs );
@@ -423,8 +428,9 @@ KGreeter::insertUser( const TQImage &default_pix,
}
p = ir.image();
TQSize ns( 48, 48 );
- if (p.size() != ns)
+ if (p.size() != ns) {
p = p.convertDepth( 32 ).smoothScale( ns, TQ_ScaleMin );
+ }
break;
} while (--nd >= 0);
@@ -439,8 +445,9 @@ KGreeter::insertUser( const TQImage &default_pix,
p.load( _faceDir + "/../pics/users/" + randomFace + ".png" );
}
- if ( p.isNull() )
+ if ( p.isNull() ) {
p = default_pix;
+ }
TQString realname = KStringHandler::from8Bit( ps->pw_gecos );
realname.truncate( realname.find( ',' ) );
@@ -499,8 +506,9 @@ KGreeter::insertUsers(int limit_users)
{
struct passwd *ps;
- if (!(ps = getpwnam( "nobody" )))
+ if (!(ps = getpwnam( "nobody" ))) {
return;
+ }
TQImage default_pix;
if (userView) {