openpam_findenv.c (91094) | openpam_findenv.c (91100) |
---|---|
1/*- 2 * Copyright (c) 2002 Networks Associates Technologies, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by ThinkSec AS and 6 * NAI Labs, the Security Research Division of Network Associates, Inc. 7 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 8 * DARPA CHATS research program. --- 27 unchanged lines hidden (view full) --- 36 37#include <string.h> 38 39#include <security/pam_appl.h> 40 41#include "openpam_impl.h" 42 43/* | 1/*- 2 * Copyright (c) 2002 Networks Associates Technologies, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by ThinkSec AS and 6 * NAI Labs, the Security Research Division of Network Associates, Inc. 7 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 8 * DARPA CHATS research program. --- 27 unchanged lines hidden (view full) --- 36 37#include <string.h> 38 39#include <security/pam_appl.h> 40 41#include "openpam_impl.h" 42 43/* |
44 * OpenPAM internal 45 * |
|
44 * Locate an environment variable 45 */ 46 47int 48openpam_findenv(pam_handle_t *pamh, 49 const char *name, 50 size_t len) 51{ 52 int i; 53 54 if (pamh == NULL) 55 return (-1); 56 57 for (i = 0; i < pamh->env_count; ++i) 58 if (strncmp(pamh->env[i], name, len) == 0 && 59 pamh->env[i][len] == '=') 60 return (i); 61 return (-1); 62} | 46 * Locate an environment variable 47 */ 48 49int 50openpam_findenv(pam_handle_t *pamh, 51 const char *name, 52 size_t len) 53{ 54 int i; 55 56 if (pamh == NULL) 57 return (-1); 58 59 for (i = 0; i < pamh->env_count; ++i) 60 if (strncmp(pamh->env[i], name, len) == 0 && 61 pamh->env[i][len] == '=') 62 return (i); 63 return (-1); 64} |
65 66/* 67 * NODOC 68 */ |
|