diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-11 20:21:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-11 20:21:27 +0000 |
commit | 10e41144596fc9ced40fc349d9ecd099b1c2ea19 (patch) | |
tree | 88ab04e475ff5a4cd889cb082f5760b6e0bf5e4e /kdm/kfrontend/kgreeter.cpp | |
parent | 4aed2c8219774f5d797760606b8489a92ddc5163 (diff) | |
download | tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.tar.gz tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.zip |
Initial import of Trinity 3.5.11 to kdebase
Extends krandrtray, adds iccconfig kcontrol module, adds run dialog autocomplete and lots of bugfixes
Will need to check for commit warnings and repair as encountered
Also needs full compile test
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1061475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdm/kfrontend/kgreeter.cpp')
-rw-r--r-- | kdm/kfrontend/kgreeter.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/kdm/kfrontend/kgreeter.cpp b/kdm/kfrontend/kgreeter.cpp index 574f4e340..407b3d879 100644 --- a/kdm/kfrontend/kgreeter.cpp +++ b/kdm/kfrontend/kgreeter.cpp @@ -55,6 +55,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <qpushbutton.h> #include <qtooltip.h> #include <qaccel.h> +#include <qstring.h> #include <qeventloop.h> #include <pwd.h> @@ -173,6 +174,13 @@ void KGreeter::insertUser( const QImage &default_pix, const QString &username, struct passwd *ps ) { + if (setegid( ps->pw_gid )) + return; + if (seteuid( ps->pw_uid )) { + setegid(0); + return; + } + if (userList) userList->append( username ); if (!userView) @@ -236,6 +244,9 @@ KGreeter::insertUser( const QImage &default_pix, realname.append( "\n" ).append( username ); new UserListViewItem( userView, realname, QPixmap( p ), username ); } + + seteuid( 0 ); + setegid( 0 ); } class KCStringList : public QValueList<QCString> { @@ -282,15 +293,8 @@ KGreeter::insertUsers() { struct passwd *ps; - // XXX remove seteuid-voodoo when we run as nobody if (!(ps = getpwnam( "nobody" ))) return; - if (setegid( ps->pw_gid )) - return; - if (seteuid( ps->pw_uid )) { - setegid(0); - return; - } QImage default_pix; if (userView) { @@ -354,17 +358,12 @@ KGreeter::insertUsers() if (userList) userList->sort(); } - - // XXX remove seteuid-voodoo when we run as nobody - seteuid( 0 ); - setegid( 0 ); } void KGreeter::putSession( const QString &type, const QString &name, bool hid, const char *exe ) { int prio = exe ? (!strcmp( exe, "default" ) ? 0 : - !strcmp( exe, "custom" ) ? 1 : !strcmp( exe, "failsafe" ) ? 3 : 2) : 2; for (uint i = 0; i < sessionTypes.size(); i++) if (sessionTypes[i].type == type) { @@ -392,7 +391,6 @@ KGreeter::insertSessions() } } putSession( "default", i18n("Default"), false, "default" ); - putSession( "custom", i18n("Custom"), false, "custom" ); putSession( "failsafe", i18n("Failsafe"), false, "failsafe" ); qBubbleSort( sessionTypes ); for (uint i = 0; i < sessionTypes.size() && !sessionTypes[i].hid; i++) { @@ -610,7 +608,6 @@ KGreeter::verifySetUser( const QString &user ) slotUserEntered(); } - KStdGreeter::KStdGreeter() : KGreeter() , clock( 0 ) |