From 078252077370315f106bb0bb0b73d555bdccdcea Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Sun, 4 Aug 2019 23:39:24 -0700 Subject: [PATCH] Remove getenv() --- macssh/source/ssh/ssh2.c | 33 --------------------------------- macssh/source/ssh/ssh2.h | 1 - 2 files changed, 34 deletions(-) diff --git a/macssh/source/ssh/ssh2.c b/macssh/source/ssh/ssh2.c index 8e08f36..ca01578 100755 --- a/macssh/source/ssh/ssh2.c +++ b/macssh/source/ssh/ssh2.c @@ -137,20 +137,6 @@ char username[256]; static char gmessage[512]; -static char *envp[] = { - "HOME", - "LOGNAME", - "TERM", - "DISPLAY" -}; - -enum { - kEnvHome = 0, - kEnvLogName, - kEnvTerm, - kEnvDisplay -}; - struct CachedPass { struct CachedPass *link; lshcontext *context; @@ -163,25 +149,6 @@ struct CachedPass *gcachedpass = NULL; int gcachepasscount = 0; int gcachepassdelay = 120; /* 2 minutes */ -/* - * getenv - */ - -char *getenv(const char *var) -{ - int i; - - lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey); - if ( context ) { - for ( i = 0; i < sizeof(envp) / sizeof(char *); i++ ) { - if ( strcmp( var, envp[i] ) == 0 ) { - return context->_envv[i]; - } - } - } - return NULL; -} - /* * openlog */ diff --git a/macssh/source/ssh/ssh2.h b/macssh/source/ssh/ssh2.h index bb503d4..464e3ca 100755 --- a/macssh/source/ssh/ssh2.h +++ b/macssh/source/ssh/ssh2.h @@ -64,7 +64,6 @@ typedef struct lshcontext { int _verbosing; int _debugging; - char *_envv[4]; // "HOME", "LOGNAME", "TERM", "DISPLAY" char _term[64]; // home and logname never change char _display[64]; // home and logname never change char _kpassword[64];