From owner-svn-src-head@FreeBSD.ORG Sat Jul 19 21:04:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 357571DC; Sat, 19 Jul 2014 21:04:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 089B72EA7; Sat, 19 Jul 2014 21:04:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JL4Ls4076756; Sat, 19 Jul 2014 21:04:21 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JL4LkC076754; Sat, 19 Jul 2014 21:04:21 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407192104.s6JL4LkC076754@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 19 Jul 2014 21:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268890 - head/lib/libpam/modules/pam_group X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 21:04:22 -0000 Author: des Date: Sat Jul 19 21:04:21 2014 New Revision: 268890 URL: http://svnweb.freebsd.org/changeset/base/268890 Log: Add support for the "account" facility. PR: 115164 MFC after: 1 week Modified: head/lib/libpam/modules/pam_group/pam_group.8 head/lib/libpam/modules/pam_group/pam_group.c Modified: head/lib/libpam/modules/pam_group/pam_group.8 ============================================================================== --- head/lib/libpam/modules/pam_group/pam_group.8 Sat Jul 19 20:59:08 2014 (r268889) +++ head/lib/libpam/modules/pam_group/pam_group.8 Sat Jul 19 21:04:21 2014 (r268890) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2011 +.Dd July 19, 2014 .Dt PAM_GROUP 8 .Os .Sh NAME @@ -48,6 +48,11 @@ .Sh DESCRIPTION The group service module for PAM accepts or rejects users based on their membership in a particular file group. +.Nm pam_group +provides functionality for two PAM categories: authentication and +account management. +In terms of the module-type parameter, they are the ``auth'' and +``account'' features. .Pp The following options may be passed to the .Nm Modified: head/lib/libpam/modules/pam_group/pam_group.c ============================================================================== --- head/lib/libpam/modules/pam_group/pam_group.c Sat Jul 19 20:59:08 2014 (r268889) +++ head/lib/libpam/modules/pam_group/pam_group.c Sat Jul 19 21:04:21 2014 (r268890) @@ -47,15 +47,14 @@ __FBSDID("$FreeBSD$"); #include #define PAM_SM_AUTH +#define PAM_SM_ACCOUNT #include #include #include - -PAM_EXTERN int -pam_sm_authenticate(pam_handle_t *pamh, int flags __unused, - int argc __unused, const char *argv[] __unused) +static int +pam_group(pam_handle_t *pamh) { int local, remote; const char *group, *user; @@ -121,6 +120,14 @@ pam_sm_authenticate(pam_handle_t *pamh, } PAM_EXTERN int +pam_sm_authenticate(pam_handle_t *pamh, int flags __unused, + int argc __unused, const char *argv[] __unused) +{ + + return (pam_group(pamh)); +} + +PAM_EXTERN int pam_sm_setcred(pam_handle_t * pamh __unused, int flags __unused, int argc __unused, const char *argv[] __unused) { @@ -128,4 +135,12 @@ pam_sm_setcred(pam_handle_t * pamh __unu return (PAM_SUCCESS); } +PAM_EXTERN int +pam_sm_acct_mgmt(pam_handle_t *pamh, int flags __unused, + int argc __unused, const char *argv[] __unused) +{ + + return (pam_group(pamh)); +} + PAM_MODULE_ENTRY("pam_group");