diff options
author | des <des@FreeBSD.org> | 2003-02-08 20:19:10 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2003-02-08 20:19:10 +0000 |
commit | 5945314a7a72384610ca7385f7bf6aa3bda5288b (patch) | |
tree | fed8b5a364d4c157738c801d03ae5340db91afee /contrib/openpam | |
parent | 08e4475303c898401b648428de379ac49d83aa72 (diff) | |
download | FreeBSD-src-5945314a7a72384610ca7385f7bf6aa3bda5288b.zip FreeBSD-src-5945314a7a72384610ca7385f7bf6aa3bda5288b.tar.gz |
MFP4: return the actual value of the requested variable (#24840)
Diffstat (limited to 'contrib/openpam')
-rw-r--r-- | contrib/openpam/lib/pam_getenv.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/openpam/lib/pam_getenv.c b/contrib/openpam/lib/pam_getenv.c index a00c7cf..58ad283 100644 --- a/contrib/openpam/lib/pam_getenv.c +++ b/contrib/openpam/lib/pam_getenv.c @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/openpam/lib/pam_getenv.c#10 $ + * $P4: //depot/projects/openpam/lib/pam_getenv.c#12 $ */ #include <stdlib.h> @@ -52,16 +52,23 @@ char * pam_getenv(pam_handle_t *pamh, const char *name) { + char *str; int i; - ENTER(); + ENTERS(name); if (pamh == NULL) RETURNS(NULL); if (name == NULL || strchr(name, '=') != NULL) RETURNS(NULL); if ((i = openpam_findenv(pamh, name, strlen(name))) == -1) RETURNS(NULL); - RETURNS(strdup(pamh->env[i])); + for (str = pamh->env[i]; *str != '\0'; ++str) { + if (*str == '=') { + ++str; + break; + } + } + RETURNS(str); } /** |