-int total=0;
-const char *allowed[]={ PERMITTED_ENV_LIST };
-const char **allp,**envp;
-char *dup=NULL,*s;
-
-retry:
- for (envp=environ;*envp;envp++) {
- if (dup) free(dup);
- dup=strdup(*envp);
- if ((s=strchr(dup,'='))) *s='\0';
- for (allp=allowed;allp<allowed+LENGTH(allowed);allp++)
- if (!strcmp(dup,*allp)) goto ok;
- if (total++>1000)
- EXITLOG("Unable to clean environment for CVS pserver: %s",*envp);
- unsetenv(dup);
- goto retry;
-ok:;
- }