pam_nologin.c (156915) | pam_nologin.c (170510) |
---|---|
1/*- 2 * Copyright 2001 Mark R V Murray 3 * All rights reserved. 4 * Copyright (c) 2001 Networks Associates Technology, Inc. 5 * All rights reserved. 6 * 7 * Portions of this software were developed for the FreeBSD Project by 8 * ThinkSec AS and NAI Labs, the Security Research Division of Network --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#include <sys/cdefs.h> | 1/*- 2 * Copyright 2001 Mark R V Murray 3 * All rights reserved. 4 * Copyright (c) 2001 Networks Associates Technology, Inc. 5 * All rights reserved. 6 * 7 * Portions of this software were developed for the FreeBSD Project by 8 * ThinkSec AS and NAI Labs, the Security Research Division of Network --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/lib/libpam/modules/pam_nologin/pam_nologin.c 156915 2006-03-20 16:56:08Z wkoszek $"); | 38__FBSDID("$FreeBSD: head/lib/libpam/modules/pam_nologin/pam_nologin.c 170510 2007-06-10 18:57:20Z yar $"); |
39 40#include <sys/types.h> 41#include <sys/stat.h> 42#include <fcntl.h> 43#include <login_cap.h> 44#include <pwd.h> 45#include <stdio.h> 46#include <stdlib.h> 47#include <unistd.h> 48 | 39 40#include <sys/types.h> 41#include <sys/stat.h> 42#include <fcntl.h> 43#include <login_cap.h> 44#include <pwd.h> 45#include <stdio.h> 46#include <stdlib.h> 47#include <unistd.h> 48 |
49#define PAM_SM_AUTH | 49#define PAM_SM_ACCOUNT |
50 51#include <security/pam_appl.h> 52#include <security/pam_modules.h> 53#include <security/pam_mod_misc.h> 54 55#define NOLOGIN "/var/run/nologin" 56 57static char nologin_def[] = NOLOGIN; 58 59PAM_EXTERN int | 50 51#include <security/pam_appl.h> 52#include <security/pam_modules.h> 53#include <security/pam_mod_misc.h> 54 55#define NOLOGIN "/var/run/nologin" 56 57static char nologin_def[] = NOLOGIN; 58 59PAM_EXTERN int |
60pam_sm_authenticate(pam_handle_t *pamh, int flags __unused, | 60pam_sm_acct_mgmt(pam_handle_t *pamh, int flags __unused, |
61 int argc __unused, const char *argv[] __unused) 62{ 63 login_cap_t *lc; 64 struct passwd *pwd; 65 struct stat st; 66 int retval, fd; 67 const char *user, *nologin; 68 char *mtmp; --- 37 unchanged lines hidden (view full) --- 106 } 107 108 if (retval != PAM_SUCCESS) 109 PAM_VERBOSE_ERROR("Administrator refusing you: %s", NOLOGIN); 110 111 return (retval); 112} 113 | 61 int argc __unused, const char *argv[] __unused) 62{ 63 login_cap_t *lc; 64 struct passwd *pwd; 65 struct stat st; 66 int retval, fd; 67 const char *user, *nologin; 68 char *mtmp; --- 37 unchanged lines hidden (view full) --- 106 } 107 108 if (retval != PAM_SUCCESS) 109 PAM_VERBOSE_ERROR("Administrator refusing you: %s", NOLOGIN); 110 111 return (retval); 112} 113 |
114PAM_EXTERN int 115pam_sm_setcred(pam_handle_t *pamh __unused, int flags __unused, 116 int argc __unused, const char *argv[] __unused) 117{ 118 119 return (PAM_SUCCESS); 120} 121 | |
122PAM_MODULE_ENTRY("pam_nologin"); | 114PAM_MODULE_ENTRY("pam_nologin"); |