Subversion Repositories wimsdev

Rev

Rev 10 | Rev 7076 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10 Rev 3840
Line 225... Line 225...
225
        stat("bin",&st); execuid=execgid=st.st_uid;
225
        stat("bin",&st); execuid=execgid=st.st_uid;
226
        if(test_must()) goto abandon;
226
        if(test_must()) goto abandon;
227
        goto ex;
227
        goto ex;
228
    }
228
    }
229
    if(chroot("../chroot")==0) {
229
    if(chroot("../chroot")==0) {
230
        chdir("/tmp");
230
        (void)chdir("/tmp");
231
        lim.rlim_cur=lim.rlim_max=PROC_QUOTA;
231
        lim.rlim_cur=lim.rlim_max=PROC_QUOTA;
232
        setrlimit(RLIMIT_NPROC,&lim);
232
        setrlimit(RLIMIT_NPROC,&lim);
233
        setenv("PATH",chroot_path,1);
233
        setenv("PATH",chroot_path,1);
234
        p=getenv("w_wims_session"); if(p && *p) {
234
        p=getenv("w_wims_session"); if(p && *p) {
235
            snprintf(tmpbuf,sizeof(tmpbuf),"/tmp/sessions/%s",p);
235
            snprintf(tmpbuf,sizeof(tmpbuf),"/tmp/sessions/%s",p);
236
            p=strchr(tmpbuf,'_'); if(p) *p=0;
236
            p=strchr(tmpbuf,'_'); if(p) *p=0;
237
            setenv("TMPDIR",tmpbuf,1);
237
            setenv("TMPDIR",tmpbuf,1);
238
            setenv("tmp_dir",tmpbuf,1);
238
            setenv("tmp_dir",tmpbuf,1);
239
            p=getenv("w_wims_priv_chroot");
239
            p=getenv("w_wims_priv_chroot");
240
            if(p && strstr(p,"tmpdir")!=NULL)
240
            if(p && strstr(p,"tmpdir")!=NULL)
241
              chdir(tmpbuf);
241
              (void)chdir(tmpbuf);
242
        }
242
        }
243
    }
243
    }
244
    else if(test_must()) goto abandon;
244
    else if(test_must()) goto abandon;
245
    ex:
245
    ex:
246
    if(setregid(execgid,execgid)<0) goto abandon;
246
    if(setregid(execgid,execgid)<0) goto abandon;