Bug 27559 - Groups in Users= and NoUsers= lines
Summary: Groups in Users= and NoUsers= lines
Status: RESOLVED FIXED
Alias: None
Product: kdm
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Other
: NOR wishlist
Target Milestone: ---
Assignee: kdm bugs tracker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-06-22 09:03 UTC by gurubert-kdm
Modified: 2008-05-19 17:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gurubert-kdm 2001-06-22 08:59:12 UTC
(*** 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)
Comment 1 Robert Sander 2002-03-12 17:27:28 UTC
--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--
Comment 2 Oswald Buddenhagen 2004-01-25 15:55:12 UTC
implemented for kde 3.3.
note that the options were renamed to SelectedUsers and HiddenUsers some time ago.
NoPassUsers now accepts groups as well.