(*** This bug was imported into bugs.kde.org ***) Package: kdm Version: KDE 2.1.1 Severity: wishlist Installed from: Not Specified Compiler: Not Specified OS: Not Specified OS/Compiler notes: Not Specified For ease of configuration it would be nice to have the possibility to add groups to the Users= and NoUsers= lines in kdmrc. So that You just specify something like Users=@users and all the users in that group show up in the login screen. We came accross this topic when enabling Windows 2000 daomin logins to our Samba server. We needed to add a "machine user" for every new Windows 2000 host that also shows up in the KDM login screen. Now every Windows 2000 machine user is in a special group that we would like to be able to put in NoUsers= (Submitted via bugs.kde.org)
--Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Hi! Attached is a patch to kdm 2.2.2 that allows to put groups in the "User=" line of kdmrc. The group name must start with the @-sign to mark the name as a group name. With that patch it is possible to show only members of one or some specific groups in the kdm login dialog. Greetings -- Robert Sander Department Head Information Systems www.epigenomics.com Kastanienallee 24 +493024345330 10435 Berlin --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename="kdm.patch" diff -ru kdm.orig/kfrontend/kgreeter.cpp kdm/kfrontend/kgreeter.cpp --- kdm.orig/kfrontend/kgreeter.cppMon Jul 30 03:27:19 2001 +++ kdm/kfrontend/kgreeter.cppTue Mar 12 18:02:31 2002 @@ -626 +627 @@ #include <sys/param.h> #include <pwd.h> +#include <grp.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -16513 +16628 @@ endpwent(); } else { QStringList::ConstIterator it = kdmcfg->_users.begin(); +const char *grp_name; for( ; it != kdmcfg->_users.end(); ++it) { - QPixmap p( locate("user_pic" - *it + QString::fromLatin1(".png"))); - if( p.isNull()) -p = default_pix; - QIconViewItem *item = new QIconViewItem( iconview *it p); - item->setDragEnabled(false); + grp_name = (*it).ascii(); + if (grp_name && grp_name[0] == '@') { + group *grp; + grp = getgrnam(grp_name+1); + if (grp) { + while (*(grp->gr_mem)) { + kdmcfg->_users.append(QString::fromUtf8(*(grp->gr_mem))); + grp->gr_mem++; + } + // free(grp); + } + free((void *)grp_name); + } else { + QPixmap p( locate("user_pic" + *it + QString::fromLatin1(".png"))); + if( p.isNull()) + p = default_pix; + QIconViewItem *item = new QIconViewItem( iconview *it p); + item->setDragEnabled(false); + } } } if( kdmcfg->_sortUsers) --Nq2Wo0NMKNjxTN9z--
implemented for kde 3.3. note that the options were renamed to SelectedUsers and HiddenUsers some time ago. NoPassUsers now accepts groups as well.