summaryrefslogtreecommitdiffstats
path: root/kdm/kfrontend
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-10-02 03:00:23 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-10-02 03:00:23 +0000
commit52fcbf9fceb7b4fc9a5a8a94352e58496591771f (patch)
tree293aa409ddfce9c6bfff9711f5a1deebeef51afc /kdm/kfrontend
parentac7b651712fdff7328d33322072f37e5bb68c6e1 (diff)
downloadtdebase-52fcbf9fceb7b4fc9a5a8a94352e58496591771f.tar.gz
tdebase-52fcbf9fceb7b4fc9a5a8a94352e58496591771f.zip
[CRITICAL] Repair KDM user list with LDAP
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1181776 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdm/kfrontend')
-rw-r--r--kdm/kfrontend/kgreeter.cpp65
1 files changed, 34 insertions, 31 deletions
diff --git a/kdm/kfrontend/kgreeter.cpp b/kdm/kfrontend/kgreeter.cpp
index fb3a3aacc..bd2e2651a 100644
--- a/kdm/kfrontend/kgreeter.cpp
+++ b/kdm/kfrontend/kgreeter.cpp
@@ -400,7 +400,7 @@ KGreeter::insertUsers(int limit_users)
}
if (_showUsers == SHOW_ALL) {
UserList noUsers( _noUsers );
- TQDict<int> dupes( 1000 );
+ TQDict<int> dupes( 1000 ); // Potential crash risk with buffer overrun?
TQStringList toinsert;
int count = 0;
for (setpwent(); (ps = getpwent()) != 0;) {
@@ -421,36 +421,39 @@ KGreeter::insertUsers(int limit_users)
}
}
}
- if ( limit_users >= 0 && ++count > limit_users ) {
- utmpname( _PATH_WTMP );
- setutxent();
- toinsert = TQStringList();
- dupes.clear();
-
- for ( count = 0; count < limit_users; ) {
- struct utmpx * ent = getutxent();
- if ( !ent )
- break;
- struct passwd *ps = getpwnam( ent->ut_user );
- if (ps && *ps->pw_dir && *ps->pw_shell &&
- (ps->pw_uid >= (unsigned)_lowUserId ||
- !ps->pw_uid && _showRoot) &&
- ps->pw_uid <= (unsigned)_highUserId &&
- !noUsers.hasUser( ps->pw_name ) &&
- !noUsers.hasGroup( ps->pw_gid ))
- {
- TQString username( TQFile::decodeName( ent->ut_user ) );
- if (!dupes.find( username )) {
- dupes.insert( username, (int *)-1 );
- toinsert.append( username );
- count++;
- }
- }
-
-
- }
- endutxent();
- }
+ // FIXME: OpenSUSE added this code
+ // For some reason it does not allow LDAP users to be listed (!),
+ // therefore it was deactivated. It should be repaired and reactivated.
+// if ( limit_users >= 0 && ++count > limit_users ) {
+// utmpname( _PATH_WTMP );
+// setutxent();
+// toinsert = TQStringList();
+// dupes.clear();
+//
+// for ( count = 0; count < limit_users; ) {
+// struct utmpx * ent = getutxent();
+// if ( !ent )
+// break;
+// struct passwd *ps = getpwnam( ent->ut_user );
+// if (ps && *ps->pw_dir && *ps->pw_shell &&
+// (ps->pw_uid >= (unsigned)_lowUserId ||
+// !ps->pw_uid && _showRoot) &&
+// ps->pw_uid <= (unsigned)_highUserId &&
+// !noUsers.hasUser( ps->pw_name ) &&
+// !noUsers.hasGroup( ps->pw_gid ))
+// {
+// TQString username( TQFile::decodeName( ent->ut_user ) );
+// if (!dupes.find( username )) {
+// dupes.insert( username, (int *)-1 );
+// toinsert.append( username );
+// count++;
+// }
+// }
+//
+//
+// }
+// endutxent();
+// }
for ( TQStringList::ConstIterator it = toinsert.begin();
it != toinsert.end(); ++it )