Remove getenv()

This commit is contained in:
Brendan Shanks 2019-08-04 23:39:24 -07:00
parent 19f2abd166
commit 0782520773
2 changed files with 0 additions and 34 deletions

View File

@ -137,20 +137,6 @@ char username[256];
static char gmessage[512]; static char gmessage[512];
static char *envp[] = {
"HOME",
"LOGNAME",
"TERM",
"DISPLAY"
};
enum {
kEnvHome = 0,
kEnvLogName,
kEnvTerm,
kEnvDisplay
};
struct CachedPass { struct CachedPass {
struct CachedPass *link; struct CachedPass *link;
lshcontext *context; lshcontext *context;
@ -163,25 +149,6 @@ struct CachedPass *gcachedpass = NULL;
int gcachepasscount = 0; int gcachepasscount = 0;
int gcachepassdelay = 120; /* 2 minutes */ 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 * openlog
*/ */

View File

@ -64,7 +64,6 @@ typedef struct lshcontext {
int _verbosing; int _verbosing;
int _debugging; int _debugging;
char *_envv[4]; // "HOME", "LOGNAME", "TERM", "DISPLAY"
char _term[64]; // home and logname never change char _term[64]; // home and logname never change
char _display[64]; // home and logname never change char _display[64]; // home and logname never change
char _kpassword[64]; char _kpassword[64];