From 715a67e80b96feda5c585533be1d54298fc318ed Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 4 Apr 2001 02:31:56 +0000 Subject: [PATCH] * setenv.c: Add conditionals for compilation of setenv, unsetenv, and getenv such that they only get compiled if they don't already exist. [pullup from krb5-1-2-2-branch] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13142 dc483132-0cff-0310-8789-dd5450dbe970 --- src/clients/ksu/ChangeLog | 6 ++++++ src/clients/ksu/setenv.c | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/clients/ksu/ChangeLog b/src/clients/ksu/ChangeLog index 2cf085124..0772244a1 100644 --- a/src/clients/ksu/ChangeLog +++ b/src/clients/ksu/ChangeLog @@ -1,3 +1,9 @@ +2001-04-03 Tom Yu + + * setenv.c: Add conditionals for compilation of setenv, unsetenv, + and getenv such that they only get compiled if they don't already + exist. [pullup from krb5-1-2-2-branch] + 2000-10-17 Ezra Peisach * krb_auth_su.c (krb5_get_tkt_via_passwd): Argument to diff --git a/src/clients/ksu/setenv.c b/src/clients/ksu/setenv.c index 96d4a1e9e..2633a9d11 100644 --- a/src/clients/ksu/setenv.c +++ b/src/clients/ksu/setenv.c @@ -25,6 +25,7 @@ * Set the value of the environmental variable "name" to be * "value". If rewrite is set, replace any current value. */ +#ifndef HAVE_SETENV setenv(name, value, rewrite) register char *name, *value; int rewrite; @@ -77,11 +78,13 @@ setenv(name, value, rewrite) for (*C++ = '='; *C++ = *value++;); return(0); } +#endif /* * unsetenv(name) -- * Delete environmental variable "name". */ +#ifndef HAVE_UNSETENV void unsetenv(name) char *name; @@ -96,6 +99,7 @@ unsetenv(name) if (!(*P = *(P + 1))) break; } +#endif /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. @@ -119,6 +123,7 @@ unsetenv(name) * getenv -- * Returns ptr to value associated with name, if any, else NULL. */ +#ifndef HAVE_GETENV char * getenv(name) char *name; @@ -128,6 +133,7 @@ getenv(name) return(_findenv(name, &offset)); } +#endif /* * _findenv -- @@ -136,9 +142,8 @@ getenv(name) * environmental array, for use by setenv(3) and unsetenv(3). * Explicitly removes '=' in argument name. * - * This routine *should* be a static; don't use it. */ -char * +static char * _findenv(name, offset) register char *name; int *offset; -- 2.26.2