summaryrefslogtreecommitdiff
path: root/modules/pam_group
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_group')
-rw-r--r--modules/pam_group/group.conf9
-rw-r--r--modules/pam_group/group.conf.5.xml16
-rw-r--r--modules/pam_group/pam_group.c3
3 files changed, 24 insertions, 4 deletions
diff --git a/modules/pam_group/group.conf b/modules/pam_group/group.conf
index b766becb..7c07a260 100644
--- a/modules/pam_group/group.conf
+++ b/modules/pam_group/group.conf
@@ -1,5 +1,5 @@
#
-# This is the configuration file for the pam_group module.
+# This is the configuration file for the pam_group module.
#
#
@@ -95,5 +95,12 @@
#xsh; tty* ;*;Al0900-1800;floppy
#
+# yet another example: any member of the group 'admin' running
+# 'xsh' on tty*, is granted access (at any time) to the group 'plugdev'
+#
+
+#xsh; tty* ;%admin;Al0000-2400;plugdev
+
+#
# End of group.conf file
#
diff --git a/modules/pam_group/group.conf.5.xml b/modules/pam_group/group.conf.5.xml
index 9c008eb0..3a7e3f5d 100644
--- a/modules/pam_group/group.conf.5.xml
+++ b/modules/pam_group/group.conf.5.xml
@@ -52,13 +52,15 @@
<para>
The third field, the <replaceable>users</replaceable>
- field, is a logic list of users or a netgroup of users to whom this
- rule applies.
+ field, is a logic list of users, or a UNIX group, or a netgroup of
+ users to whom this rule applies. Group names are preceded by a '%'
+ symbol, while netgroup names are preceded by a '@' symbol.
</para>
<para>
For these items the simple wildcard '*' may be used only once.
- With netgroups no wildcards or logic operators are allowed.
+ With UNIX groups or netgroups no wildcards or logic operators
+ are allowed.
</para>
<para>
@@ -111,6 +113,14 @@
xsh; tty* ;sword;!Wk0900-1800;games, sound
xsh; tty* ;*;Al0900-1800;floppy
</programlisting>
+ <para>
+ Any member of the group 'admin' running 'xsh' on tty*,
+ is granted access (at any time) to the group 'plugdev'
+ </para>
+ <programlisting>
+xsh; tty* ;%admin;Al0000-2400;plugdev
+ </programlisting>
+
</refsect1>
<refsect1 id="group.conf-see_also">
diff --git a/modules/pam_group/pam_group.c b/modules/pam_group/pam_group.c
index 3dc7f78e..310b2622 100644
--- a/modules/pam_group/pam_group.c
+++ b/modules/pam_group/pam_group.c
@@ -660,6 +660,9 @@ static int check_account(pam_handle_t *pamh, const char *service,
/* If buffer starts with @, we are using netgroups */
if (buffer[0] == '@')
good &= innetgr (&buffer[1], NULL, user, NULL);
+ /* otherwise, if the buffer starts with %, it's a UNIX group */
+ else if (buffer[0] == '%')
+ good &= pam_modutil_user_in_group_nam_nam(pamh, user, &buffer[1]);
else
good &= logic_field(pamh,user, buffer, count, is_same);
D(("with user: %s", good ? "passes":"fails" ));