#include <string.h>
#include <errno.h>
-extern const char **environ;
-
-#define SETUID 613 /* "pserver" user UID */
-#define SETGID 613 /* "pserver" group GID */
-#define PERMITTED_ENV_LIST "PWD"
+#define SETUID 503 /* "pserver" user UID */
+#define SETGID 503 /* "pserver" group GID */
+#define CHROOT_DIR "/home/lace/pserver"
#define EXEC_PATHNAME "/usr/bin/cvs"
int main(int argc,char **argv)
{
-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:;
- }
+ FUNCCHK(clearenv);
FUNCCHK(setenv,"PATH","/usr/bin",1);
- FUNCCHK(chroot,"/home/short/pserver");
+ FUNCCHK(chroot,CHROOT_DIR);
FUNCCHK(chdir,"/");
FUNCCHK(setgid,SETGID);
FUNCCHK(setuid,SETUID);