Back to index

wims  3.65+svn20090927
Classes | Defines | Enumerations | Functions | Variables
wims.c File Reference
#include "Lib/libwims.h"
#include "wims.h"
#include <sys/socket.h>
#include <sys/un.h>
#include "lines.c"
#include "var.c"
#include "config.c"
#include "cleaning.c"
#include "files.c"
#include "pedia.c"
#include "evalue.c"
#include "test.c"
#include "compare.c"
#include "html.c"
#include "rawmath.c"
#include "texmath.c"
#include "insmath.c"
#include "matrix.c"
#include "score.c"
#include "calc.c"
#include "exec.c"
#include "auth.c"
#include "variables.c"
#include "exam.c"
#include "log.c"

Go to the source code of this file.

Classes

struct  VAR_DEF

Defines

#define WEBMATH   1
#define evalue   strevalue
#define good_agent_no   (sizeof(good_agent)/sizeof(good_agent[0]))
#define bad_agent_no   (sizeof(bad_agent)/sizeof(bad_agent[0]))
#define RO_NAME_NO   (sizeof(ro_name)/sizeof(ro_name[0]))
#define CMD_NO   (sizeof(commands)/sizeof(commands[0]))
#define INTERNAL_NAME_NO   (sizeof(internal_name)/sizeof(internal_name[0]))
#define HTTPD_VAR_NO   (sizeof(httpd_vars)/sizeof(httpd_vars[0]))
#define unsetvarcnt   (sizeof(unsetvars)/sizeof(unsetvars[0]))
#define READSTDIN_WINDOW   4096

Enumerations

enum  { mode_default, mode_popup, mode_raw }
enum  {
  ro_cmd, ro_empty, ro_lang, ro_module,
  ro_session, ro_special_parm, ro_special_parm2, ro_useropts,
  ro_wsession, ro_subsession, ro_win, ro_worksheet
}
enum  {
  cmd_intro, cmd_new, cmd_renew, cmd_reply,
  cmd_config, cmd_hint, cmd_help, cmd_resume,
  cmd_next, cmd_getins, cmd_getframe, cmd_getfile,
  cmd_close, cmd_ref
}
enum  { httpd_apache, httpd_wims }

Functions

void put_special_page (char *pname)
void useropts (void)
void take_httpd_vars (void)
void cookie2session (void)
void determine_font (char *l)
void predetermine_language (void)
void manager_check (void)
void robot_check (void)
void parse_query_string (int len, int type)
void special_cmds (void)
int verify_tables (void)
void config_defaults (void)
void mhelp (void)
void readstdin (int len)
int formdata (char *p)
void getpost (void)
void buffer_init (void)
int main (int argc, char *argv[], char *envp[])

Variables

char * robot_session = "../tmp/robot"
int robot_access = 0
int human_access = 0
int user_error_nolog = 0
char * good_agent []
char * bad_agent []
int debug = 0
char class_dir [MAX_FNAME+1]
struct {
char * name
char * value
user_variable [MAX_VAR_NUM]
int user_var_no
struct VAR_DEF var_def [MAX_VAR_NUM]
int defined_var_total
WORKING_FILE m_file
WORKING_FILE svar_file
WORKING_FILE mcache [MAX_MCACHE]
int mcachecnt
int WORKFILE_LIMIT = 2048*1024
int user_lang = 0
int instex_cnt = 0
int getwimstexsize = 1
char instex_src [MAX_LINELEN+1]
char instex_fname [MAX_LINELEN+1]
char * instex_processor = "tex..gif"
char cookiegot [256]
char cookieset [256]
char cookieheader [64] = "WIMSUSER="
char mpboundary [1024]
int deplen = 0
int confset = 0
enum { ... }  NAME_MODES
int mode = mode_default
int outputing
char * home_module = "home"
char ** environ
int module_defined = 0
char session_prefix [MAX_FNAME+1]
char s2_prefix [MAX_FNAME+1]
char module_prefix [MAX_FNAME+1]
char * stdinbuf
int sesrandomtab [MAX_SESRANDOM]
char multiexec_random [64]
int executed_gotos
int insert_no
int output_length
int isexam = 0
int simuxam = 0
int is_multiexec = 0
int multiexec_index
int direct_datafile = 0
int exec_is_module = 0
char * module_dir = "modules"
int new_session = 0
int good_httpd = 0
int direct_exec = 0
int print_precision = 8
int session_serial
int form_access = 0
int lastout_file = -1
char * instex_style = ""
int instex_usedynamic = 0
int wrapexec = 0
int parm_restore = 0
int exec_wait = 1
int execnt = 0
int readnest
int mfilecnt = 0
int forceresume = 0
int manageable = 0
int ismhelp = 0
int getvar_len
int noout = 0
char tmp_dir [MAX_FNAME+1]
char * bin_dir = "bin"
char cwdbuf [MAX_FNAME+1]
char var_hacking = 0
char * tmp_debug = "no"
char ins_alt [MAX_LINELEN+1]
char * devel_modules = "close"
int isclassmodule = 0
int isdevelmodule = 0
int setcookie = 0
int killpid = 0
char * mathalign_sup1
char * mathalign_sup2
int substnest = 0
int exodepOK = 1
long int startmtime
long int startmtime2
int backslash_insmath = 0
char examlogf [MAX_FNAME+1]
char examlogd [MAX_FNAME+1]
char exam_sheetexo [32]
char loadavg [64]
char * var_readable
char * var_writable
char * var_nr
char * var_nw
char * var_pfx
int hostcquota
int var_noexport
char tmplbuf [MAX_LINELEN+1]
struct tm * now
struct tm Now
time_t nowtime
time_t limtime
time_t limtimex
char nowstr [32]
int rlimit_cpu = 20
int rlimit_fsize = 8388608
int rlimit_as = 209715200
int rlimit_data = 204857600
int rlimit_stack = 2097152
int rlimit_core = 0
int rlimit_rss = 16777216
int rlimit_nproc = 1024
int rlimit_nofile = 512
int rlimit_memlock = 2097152
char * var_str
char * var_def_buf
char job_identifier [32]
char * manager_site = "127.0.0.1"
int manager_https = 0
int wims_sheet = 0
int wims_exo = 0
char * default_form_method = "post"
char lang [16] = "en"
char available_lang [MAX_LANGUAGES][4] = {"en","fr"}
int available_lang_no = 2
char pre_language [4] = ""
char * protocol = "http"
int coord_input = 0
char * ro_name []
enum { ... }  RO_NAMES
int cmd_type
char * commands []
enum { ... }  COMMANDS
struct {
char * name
int stat
internal_name []
char * httpd_vars []
char * unsetvars []
int httpd_type = httpd_apache
char * remote_addr = ""
char * remote_host = ""
char ref_name [2048]
char ref_base [2048]

Class Documentation

struct VAR_DEF

Definition at line 53 of file wims.c.

Class Members
char allow
short int beg
char defined_in_parm
short int end
char log_num
char * name
char unused_padding

Define Documentation

#define bad_agent_no   (sizeof(bad_agent)/sizeof(bad_agent[0]))

Definition at line 40 of file wims.c.

#define CMD_NO   (sizeof(commands)/sizeof(commands[0]))

Definition at line 241 of file wims.c.

Definition at line 26 of file wims.c.

#define good_agent_no   (sizeof(good_agent)/sizeof(good_agent[0]))

Definition at line 34 of file wims.c.

#define HTTPD_VAR_NO   (sizeof(httpd_vars)/sizeof(httpd_vars[0]))

Definition at line 327 of file wims.c.

#define INTERNAL_NAME_NO   (sizeof(internal_name)/sizeof(internal_name[0]))

Definition at line 307 of file wims.c.

Definition at line 981 of file wims.c.

#define RO_NAME_NO   (sizeof(ro_name)/sizeof(ro_name[0]))

Definition at line 229 of file wims.c.

#define unsetvarcnt   (sizeof(unsetvars)/sizeof(unsetvars[0]))

Definition at line 335 of file wims.c.

#define WEBMATH   1

Definition at line 20 of file wims.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
mode_default 
mode_popup 
mode_raw 

Definition at line 85 of file wims.c.

anonymous enum
Enumerator:
ro_cmd 
ro_empty 
ro_lang 
ro_module 
ro_session 
ro_special_parm 
ro_special_parm2 
ro_useropts 
ro_wsession 
ro_subsession 
ro_win 
ro_worksheet 

Definition at line 225 of file wims.c.

anonymous enum
Enumerator:
cmd_intro 
cmd_new 
cmd_renew 
cmd_reply 
cmd_config 
cmd_hint 
cmd_help 
cmd_resume 
cmd_next 
cmd_getins 
cmd_getframe 
cmd_getfile 
cmd_close 
cmd_ref 

Definition at line 236 of file wims.c.

anonymous enum
Enumerator:
httpd_apache 
httpd_wims 

Definition at line 337 of file wims.c.


Function Documentation

void buffer_init ( void  )

Definition at line 1050 of file wims.c.

{
    struct timeval tv;
    
    mcachecnt=readnest=0;
    mpboundary[0]=cookiegot[0]=cookieset[0]=cwdbuf[0]=0;
    rscore_class[0]=rscore_user[0]=multiexec_random[0]=0;
    lastftest[0]=0;
    lastdatafile[0]=0; lastdata=xmalloc(WORKFILE_LIMIT);
    outptr=outbuf;
    instex_src[0]=instex_fname[0]=module_prefix[0]=0;
    examlogf[0]=examlogd[0]=exam_sheetexo[0]=0;
    stdinbuf=NULL;
    mkfname(tmp_dir,"../tmp/forall");
    mkfname(session_dir,"../%s",SESSION_BASE);
    mkfname(s2_dir,"../%s",S2_BASE);
    if(gettimeofday(&tv,NULL)) startmtime=startmtime2=0;
    else {
       startmtime=((tv.tv_sec%10000)*1000+tv.tv_usec/1000);
       startmtime2=(tv.tv_sec%1000)*1000000+tv.tv_usec;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void config_defaults ( void  )

Definition at line 928 of file wims.c.

{
    int i, *pi;
    char **ps;
    
    for(i=0;i<MAIN_CONFIG_NO;i++) {
       pi=main_config[i].address; ps=main_config[i].address;
       if((1&main_config[i].is_integer)==1) 
         printf("DF_%s=%d\n",main_config[i].name, *pi);
       else
         printf("DF_%s=%s\n",main_config[i].name,*ps);
    }
}

Here is the caller graph for this function:

void cookie2session ( void  )

Definition at line 387 of file wims.c.

{
    char cksession[64], psession[32], *ckey, *p;
    char nbuf[MAX_FNAME+1];

    if(mode==mode_popup) return;
    if(cookiegot[0]==0 || ro_cmd==cmd_close) {
       ckset: cookiegot[0]=0; setcookie=1; return;
    }
    p=getvar("special_parm");
    if(p!=NULL && strcmp(p,"ignorecookie")==0) return;
    mystrncpy(cksession,cookiegot,sizeof(cksession));
    ckey=strchr(cksession,'-');
    if(ckey==NULL) goto ckset; else *ckey++=0;
    p=getvar("wims_session"); if(p==NULL) p="";
    if(strstr(p,"new")!=NULL) goto ckset;
    mystrncpy(psession,p,sizeof(psession));
    p=strchr(psession,'_'); if(p!=NULL) *p=0;
    if(psession[0]!=0) {
       if(strcmp(psession,cksession)==0) return;
       if(session_exists(psession)) goto ckset;
       if(session_exists(cksession)) goto change;
    }
    else {
       if(!session_exists(cksession)) return;
       change:
       p=getenv("HTTPS");
       if(p!=NULL && strcasecmp(p,"on")==0) goto ckset;
       mkfname(nbuf,"%s/%s/var",session_dir,cksession);
       getdef(nbuf,"w_wims_ismanager",tmplbuf);
       if(tmplbuf[0]!=0 && tmplbuf[0]!='0') goto ckset;
       getdef(nbuf,"w_wims_protocol",tmplbuf);
       if(strcasecmp(tmplbuf,"https")==0) goto ckset;
       mkfname(nbuf,"%s/%s/var.stat",session_dir,cksession);
       getdef(nbuf,"wims_user",tmplbuf);
       if(tmplbuf[0]!=0) goto ckset;
       force_setvar(ro_name[ro_session],cksession);
       setsesdir(cksession);
       force_setvar("wims_subsession","");
       session_serial=0;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void determine_font ( char *  l)

Definition at line 430 of file wims.c.

{
    int i;
    
    if(l==NULL || *l==0) return;
    for(i=0;i<charname_no && memcmp(charname[i].name,l,2);i++);
    if(i<charname_no) setvar("wims_main_font",charname[i].font);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int formdata ( char *  p)

Definition at line 1003 of file wims.c.

{
    char *pp;
    int inlen;
    char *ctype;
    inlen=0; ctype=getenv("CONTENT_TYPE");
    if(ctype==NULL || strstr(ctype,"multipart/form-data")==NULL
       || (p=strstr(ctype,"boundary="))==NULL) {
       bad: stdinbuf=""; return 0;
    }
    pp=getenv("CONTENT_LENGTH");
    if(pp==NULL) goto bad;
    inlen=atoi(pp); if(inlen<=10) goto bad;
    if(inlen>=MAX_DEPOSITLEN) user_error("parm_too_long");
    stdinbuf=xmalloc(inlen+1); readstdin(inlen);
    p+=strlen("boundary=");
    for(pp=p;myisalnum(*pp) || *pp=='-'; pp++);
    if(pp-p<sizeof(mpboundary)-2) {
       memmove(mpboundary,p,pp-p); mpboundary[pp-p]=0;
    }
              /* empty data */
    if(strstr(stdinbuf,mpboundary)==NULL || strstr(stdinbuf,"name=")==NULL) {
       free(stdinbuf); goto bad;
    }
    form_access=1; post_log();
    return inlen;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void getpost ( void  )

Definition at line 1032 of file wims.c.

{
    int ll;
    char *pp;
    pp=getenv("CONTENT_LENGTH");
    if(pp==NULL || (ll=atoi(pp))<=0) {
       stdinbuf=xmalloc(16); stdinbuf[0]=0;
    }
    else {
       if(ll>QUERY_STRING_LIMIT) user_error("parm_too_long");
       stdinbuf=xmalloc(ll+16); readstdin(ll);
       if(ll>0) {
           setenv("QUERY_STRING",stdinbuf,1);
           form_access=1; post_log();
       }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[],
char *  envp[] 
)

Definition at line 1073 of file wims.c.

{
    char *p, homebuf[MAX_FNAME+1], lbuf[32];
    int inlen=0;
/*    int mfd;
*/
    error1=user_error; error2=module_error; error3=internal_error;
    class_dir[0]=0;
    substitute=substit; buffer_init(); var_init();
       /* WIMS internal locale is always C. */
    setenv("LANG","C",1); umask(022);
    setenv("LANGUAGE","us",1);
    setenv("LC_ALL","C",1);
    if(argc>1) {
       if(strcasecmp(argv[1],"table")==0) {
           if(verify_tables()) internal_error("Table disorder.");
           else printf("Table orders OK.\n");
           return 0;
       }
       if(strcasecmp(argv[1],"version")==0) {
           printf("%s",wims_version); return 0;
       }
       if(strcasecmp(argv[1],"defaults")==0) {
           config_defaults(); return 0;
       }
    }
    p=getenv("SERVER_SOFTWARE"); if(p!=NULL && strcasecmp(p,"WIMS")==0)
      httpd_type=httpd_wims;
    p=getenv("REMOTE_ADDR"); if(p!=NULL) remote_addr=p;
    p=getenv("REMOTE_HOST"); if(p!=NULL) remote_host=p;
    nowtime=time(0); now=localtime(&nowtime);
    memmove(&Now, now, sizeof(Now)); now=&Now;
    snprintf(nowstr,sizeof(nowstr),"%04d%02d%02d.%02d:%02d:%02d",
            (now->tm_year)+1900,(now->tm_mon)+1,now->tm_mday,
            now->tm_hour,now->tm_min,now->tm_sec);
    p=getenv("QUERY_STRING");
    if(p==NULL || *p==0) getpost();
    else if(strncmp(p,"form-data",9)==0) inlen=formdata(p);
    
    force_setvar("wims_now",nowstr);
    snprintf(lbuf,sizeof(lbuf),"%lu",nowtime);
    force_setvar("wims_nowseconds",lbuf);
    nowtime=time(0);
    initalarm();
    
    executed_gotos=insert_no=output_length=0; ins_alt[0]=0;
    setvar("empty","");     /* lock this variable */
    setvar("wims_version",wims_version);
    setvar("wims_version_date",wims_version_date);
    setvar("wims_main_font","utf-8");
    take_httpd_vars();

    main_configure();
    checklogd();
/*    mfd=shm_open(SHM_NAME,O_RDONLY,-1);
    if(mfd==-1) internal_error("Unable to find shared memory.");
    shmptr=mmap(0,SHM_SIZE,PROT_READ,MAP_SHARED,mfd,0);
    if(shmptr==MAP_FAILED) internal_error("Shared memory failure.");
*/
    getppid();       /* this is the first sysmask trigger, must be after checklogd() */
    predetermine_language();
    set_rlimits();
    init_random();
    module_configure();
    set_job_ident();
    m_file.name[0]=0;m_file.linecnt=m_file.linepointer=0;
    p=getenv("QUERY_STRING");
    if(p==NULL || strlen(p)==0) {
       setvar("lang",lang);
       snprintf(homebuf,sizeof(homebuf),"module=%s",home_module);
       p=homebuf;
    }
    if(strlen(p)>=QUERY_STRING_LIMIT) user_error("parm_too_long");
    if(mpboundary[0]==0) {
       var_str=xmalloc(strlen(p)+2);
       parse_query_string(http2env(var_str,p),0);
    }
    else {
       var_str=stdinbuf;
       parse_query_string(inlen,1);
    }
    if(ismhelp) {
       p=getvar(ro_name[ro_cmd]);
       if(p==NULL || (strcmp(p,"help")!=0 && strcmp(p,"getins")!=0)) {
           mhelp(); goto outgo;
       }
    }
    check_exam();
    useropts();
    special_cmds();
    parse_ro_names();
    manager_check();
    access_check(0);
    set_variables();
    determine_font(getvar("module_language"));
    if(!robot_access && session_prefix[0]!=0 && cmd_type!=cmd_help && !ismhelp)
      lastout_file=creat(mkfname(NULL,"%s/%s",s2_prefix,lastout),
                      S_IRUSR|S_IWUSR);
    p=getvar("module_category");
    if(p==NULL || strstr(p,"tool")==NULL) default_form_method="get";
    if(noout) {
       write_logs(); save_session_vars();
       goto outgo;
    }
    if(ismhelp) {
       mhelp();
    }
    else {
       main_phtml_put(html_file);
       if(lastout_file!=-1) {
           flushoutput(); close(lastout_file); putlastout();
       }
       write_logs(); save_session_vars();
    }
    outgo:
    debug_output();
    if(var_str!=stdinbuf) free(var_str);
    delete_pid();
    if(mode!=mode_popup && trusted_module()) {
       p=getvar("wims_mode");
       if(p!=NULL && strcmp(p,"popup")==0) mode=mode_popup;
    }
    if(mode==mode_popup && insert_no==0) {
       p=getvar("wims_mode");
       if(p!=NULL && strcmp(p,"popup")==0) {
           remove_tree(session_prefix); 
           
           remove_tree(s2_prefix);
       }
    }
    return 0;
}
void manager_check ( void  )

Definition at line 482 of file wims.c.

{
    char *p, *pp, buf[16];
    struct stat confstat;
    int i;
    
    manageable=0;
    if(robot_access || *manager_site==0 || checkhost(manager_site)<1)
      goto mend;
    if(manager_https) {
       p=getenv("HTTPS");
       if(p==NULL || strcmp(p,"on")!=0) goto mend;
    }
    if(strcmp(remote_addr,"127.0.0.1")==0) {
       int port, port2;
       char tester[128];
       p=getenv("REMOTE_PORT"); if(p==NULL) goto mend;
       port=atoi(p); if(port<1024 || port>65535) goto mend;
       p=getenv("SERVER_PORT"); if(p==NULL) goto mend;
       port2=atoi(p); if(port2>=10000 || port2<=0) goto mend;
              /* this is very non-portable */
       manageable=1;
       accessfile(tmplbuf,"r","/proc/net/tcp");
       snprintf(tester,sizeof(tester)," 0100007F:%04X 0100007F:%04X ",
               port,port2);
       p=strstr(tmplbuf,tester); 
       if(p!=NULL) {
           pp=strchr(p,'\n'); if(pp!=NULL) *pp=0;
           if(strlen(p)>=75) {
              p=find_word_start(p+70); *find_word_end(p)=0;
              if(atoi(p)==geteuid()) manageable=2;
           }
       }
    }
    else manageable=1;
    i=stat(config_file,&confstat);
    if(i==0 && manageable>0 && (confstat.st_mode&(S_IRWXO|S_IRWXG))!=0) manageable=-1;
    if(manageable>0 && !trusted_module()) manageable=0;
    if(manageable==1) {
       accessfile(tmplbuf,"r","%s/.manager",session_prefix);
       if(strstr(tmplbuf,"yes")!=NULL) manageable=2;
    }
    if(manageable==1) {
       p=getvar(ro_name[ro_module]);
       if(p!=NULL && strncmp(p,"adm/manage",strlen("adm/manage"))==0) {
           struct stat pstat;
           if(stat("../log/.wimspass",&pstat)==0) {
              if((S_IFMT&pstat.st_mode)!=S_IFREG || 
                 ((S_IRWXO|S_IRWXG)&pstat.st_mode)!=0)
                manageable=-2;
           }
       }
    }
    mend:
    mystrncpy(buf,int2str(manageable),sizeof(buf));
    force_setvar("wims_ismanager",buf);
    if(manageable>=2) {
       struct rlimit rlim;
       rlimit_cpu*=10;
       rlim.rlim_cur=rlim.rlim_max=rlimit_cpu;
       setrlimit(RLIMIT_CPU,&rlim);
       mystrncpy(buf,int2str(rlimit_cpu),sizeof(buf));
       setvar("wims_cpu_limit",buf);
       initalarm();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mhelp ( void  )

Definition at line 964 of file wims.c.

{
    char *p, buf[MAX_LINELEN+1];
    main_phtml_put(""); buf[0]=0;
    if(cmd_type!=cmd_help) {
       phtml_put_base("closemhelp.phtml",0);
    }
    else {
       phtml_put_base("mhelpheader.phtml",0);
       p=getvar("special_parm");
       if(p!=NULL && strcmp(p,"about")==0) 
         phtml_put("about.phtml",0);
       else phtml_put("help.phtml",0); phtml_put_base("mhelptail.phtml",0);
       exec_tail(buf);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void parse_query_string ( int  len,
int  type 
)

Definition at line 589 of file wims.c.

{
    int i,j,l,v,cmd_defined;
    int parenth=-1, ll, lb, dlen;
    char *start, *p, *p1, *pt, *b1="";
    
    cmd_defined=0;
    setvar("wims_subsession","");
    ll=lb=0;
    if(type) {
       ll=strlen(mpboundary);
       start=strstr(var_str,mpboundary);
       if(start==NULL) start=var_str+strlen(var_str);
       if(strstr(var_str,"\r\n\r\n")!=NULL) b1="\r\n\r\n";
       else b1="\n\n";
       lb=strlen(b1);
    }
    else start=var_str;
    for(v=0, p1=start;p1<var_str+len;p1+=l) {
       if(type) {
           char *p2, *p3, *p4, *p5;
           p2=p1+ll; p3=memstr(p2,mpboundary,var_str+len-p2); l=p3-p1;
           p=memstr(p2,b1,var_str+len-p2); if(p>=p3) continue;
           p+=lb; if(p3<var_str+len) {
              while(*p3!='\n' && p3>p2) p3--; *p3=0;
              p3--; if(*p3=='\r') *p3=0;
           }
           dlen=p3-p;
           p2=memstr(p2,"name=",p3-p2); if(p2>=p3) continue;
           p2+=strlen("name="); if(*p2=='"') p2++;
           for(p3=p2; myisalnum(*p3) || strchr("._",*p3)!=NULL; p3++);
           if(p3==p2) continue;
           if(p3-p2==strlen("wims_deposit") &&
              strncmp(p2,"wims_deposit",p3-p2)==0) {
              p4=memstr(p1,"filename=",p-p1); if(p4<p) {
                  p4+=strlen("filename="); if(*p4=='"') {
                     p4++; p5=strchr(p4,'"');
                     if(p5==NULL || p5-p4>=MAX_FNAME) goto emptyquote;
                  }
                  else {
                     emptyquote: 
                     for(p5=p4; p5<p && !isspace(*p5) &&
                         strchr(";\"~#*?=,'",*p5)==NULL; p5++);
                  }
                  if(p5>p4) {
                     *p5=0;
                     for(p5--;
                         p5>=p4 && !isspace(*p5) && strchr("/\\:",*p5)==NULL;
                         p5--);
                     if(p5>=p4) p4=p5+1; if(*p4==0) goto noname;
                     if(strstr(p4,"..")!=NULL || *p4=='.')
                       p4="noname.file";
                     setvar("wims_deposit",p4);
                  }
                  else {
                     noname: setvar("wims_deposit","noname.file");
                  }
              }
              deplen=dlen;
           }
           *p3=0; l-=p2-p1; p1=p2;
       }
       else {
           p1=find_word_start(p1);
           l=strlen(p1)+1; p=strchr(p1,'='); 
           if(p==NULL) p=p1+strlen(p1);
           if(*p==0 && l>1) {
              user_variable[v].name="no_name";
              user_variable[v].value=p1;
              coord_input=1;
              goto nnext;
           }
           *p++=0;
       }
              /* empty name or empty value: ignore */
        if(*p1==0 || *p==0) continue;
              /* We do not treat names containing '.' */
       for(pt=strchr(p1,'.'); pt; pt=strchr(++pt,'.')) *pt='_';
              /* Restrictions on variable names */
       for(pt=p1; myisalnum(*pt) || *pt=='_'; pt++);
       if(*pt) continue;
       if(strcmp(p1,"wims_deposit")!=0) _tolinux(p);
              /* This is a restriction:
               * Every parameter must have matching parentheses. */
       if(parenth==-1 && strncmp(p1,"freepar_",strlen("freepar_"))!=0
          && strcmp(p1,"wims_deposit")!=0
          && check_parentheses(p,1)) parenth=v;
       if(strcmp(p1,"special_parm")==0 && strcmp(p,"wims")==0)
         human_access=1;
       j=search_list(ro_name,RO_NAME_NO,sizeof(ro_name[0]),p1);
       if(j>=0) {
           if(j==ro_session) {
              p=find_word_start(p); *find_word_end(p)=0;
              if(strlen(p)>MAX_SESSIONLEN) continue;
              if(strcmp(p,robot_session)==0) p="";
              if(strcasecmp(p,"popup")==0) {
                  mode=mode_popup;
                  force_setvar("wims_mode","popup");
                  force_setvar("session","");
                  continue;
              }
           }
           if(j==ro_module) module_defined=1;
           if(j==ro_cmd) {
              p=find_word_start(p); *find_word_end(p)=0;
              if(strlen(p)>16) continue;
              cmd_defined=1;
           }
           if(j==ro_lang) {
              if(strlen(p)!=2) continue;
              for(i=0;i<available_lang_no && strcmp(available_lang[i],p)!=0;i++);
              if(i<available_lang_no) {user_lang=1; strcpy(lang,p);}
              else continue;
           }
           /* strip leading and trailing '/'s in module name */
           if(j==ro_module) {
              p=find_word_start(p); *find_word_end(p)=0;
              while(*p=='/') p++;
              while(*p!=0 && *(p+strlen(p)-1)=='/') *(p+strlen(p)-1)=0;
              if(strlen(p)>MAX_MODULELEN) continue;
           }
           setvar(p1,p);
           if(j==ro_session && mode!=mode_popup) {
              char *pp, *pr;
              char buf[1024];
              mystrncpy(buf,p,sizeof(buf));
              if((pp=strchr(buf,'.'))!=NULL) {
                  *pp++=0; session_serial=atoi(pp);
                  if(pp<0) pp=0;
              }
              else session_serial=0;
              pp=strchr(buf,'_');
              if(pp!=NULL && (pr=strstr(pp,"_mhelp"))!=NULL) {
                  *pr=0; ismhelp=1; lastout_file=-1;
                  setvar("wims_inssub","mh");
              }
              force_setvar("wims_session",buf);
              if(pp!=NULL) force_setvar("wims_subsession",pp);
           }
           continue;
       }
       user_variable[v].name=p1;
       user_variable[v].value=p;
nnext: v++; if(v>=MAX_VAR_NUM) user_error("too_many_variables");
    }
    user_var_no=v;
    if(parenth>=0) {
       char buf[16];
       mystrncpy(buf,int2str(user_var_no),sizeof(buf));
       setvar("user_var_no",buf);
       for(i=0;i<user_var_no;i++) {
           snprintf(buf,sizeof(buf),"name%d",i);
           setvar(buf,user_variable[i].name);
           snprintf(buf,sizeof(buf),"value%d",i);
           setvar(buf,user_variable[i].value);
       }
       mystrncpy(buf,int2str(parenth),sizeof(buf));
       setvar("bad_parentheses",buf);
       user_error("unmatched_parentheses");
    }
    p=getenv("SCRIPT_NAME"); 
    if(p!=NULL && (p=strstr(p,"/getfile/"))!=NULL) {
       p+=strlen("/getfile/");
       force_setvar(ro_name[ro_cmd],commands[cmd_getfile]);
       force_setvar("special_parm",p);
       cmd_defined=1;
    }
    if(module_defined && !cmd_defined) setvar(ro_name[ro_cmd],commands[cmd_intro]);
    robot_check(); cookie2session();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void predetermine_language ( void  )

Definition at line 439 of file wims.c.

{
    char *p;
    int i,n;

    if(pre_language[0]!=0) p=pre_language;
    else p=getenv("HTTP_ACCEPT_LANGUAGE");
    if(p!=NULL && strlen(p)>=2) {
      for(i=0;i<available_lang_no && memcmp(p,available_lang[i],2)!=0;i++);
      if(i<available_lang_no) goto lend;
    }
    p=getenv("HTTP_USER_AGENT");
    if(p!=NULL && strlen(p)>=5) {
       char *q;
       if((q=strchr(p,'['))!=NULL && islower(*(q+1)) && islower(*(q+2)) && *(q+3)==']') {
           char bb[4];
           bb[0]=*(q+1);bb[1]=*(q+2);bb[2]=0;
           for(i=0;i<available_lang_no && memcmp(bb,available_lang[i],2)!=0;i++);
           if(i<available_lang_no) {
              memmove(lang,bb,2); lang[2]=0;
              goto lend2;
           }
       }
    }
    p=getenv("HTTP_HOST"); if(p==NULL) goto lend2;
    n=strlen(p); if(n<=3 || *(p+n-3)!='.') goto lend2;
    p=p+n-2;
    for(i=0;i<available_lang_no && memcmp(p,available_lang[i],2)!=0;i++);
    if(i<available_lang_no) {
       lend:  memmove(lang,p,2); lang[2]=0;
       lend2: determine_font(lang);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void put_special_page ( char *  pname)

Definition at line 474 of file wims.c.

{
    determine_font(lang);
    phtml_put_base(mkfname(NULL,"%s.phtml.%s",pname,lang),0);
    write_logs();free(var_str);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void readstdin ( int  len)

Definition at line 983 of file wims.c.

{
    int ll, l1, lt, lr;
    int cpulim;
    
    cpulim=rlimit_cpu; rlimit_cpu=3;
    lr=len; l1=0;
    while(lr>0) {
       nowtime=time(0); initalarm();
       ll=lr; if(ll>READSTDIN_WINDOW) ll=READSTDIN_WINDOW;
       lt=fread(stdinbuf+l1,1,ll,stdin);
       if(lt!=ll) user_error("parm_too_long");
       lr-=ll; l1+=ll;
    }
    if(l1!=len) user_error("parm_too_long");
    stdinbuf[len]=0; rlimit_cpu=cpulim;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void robot_check ( void  )

Definition at line 550 of file wims.c.

{
    char *ua, *p, *ses, *c, *mod;
    int i;

    if(human_access) return;
    mod=getvar(ro_name[ro_module]);
    if(mod!=NULL && strcmp(mod,"adm/raw")==0) return;
    ses=getvar(ro_name[ro_session]);
       /* user has valid session; OK */
    if(ses!=NULL && strncmp(ses,robot_session,strlen(robot_session))!=0
       && strchr(ses,'/')==NULL
       && ftest(mkfname(NULL,"%s/%s",s2_dir,ses))==is_dir)
      return;
    ua=getenv("HTTP_USER_AGENT"); if(ua==NULL) ua="";
    ua=find_word_start(ua);
    if(strncasecmp(ua,"Mozilla",strlen("Mozilla"))==0 && 
       (p=strstr(ua,"compatible"))!=NULL) 
      ua=find_word_start(find_word_end(p));
    if(*ua) {
       for(i=0;i<good_agent_no 
           && strncasecmp(ua,good_agent[i],strlen(good_agent[i]));i++);
       if(i<good_agent_no) return;
       for(i=0;i<bad_agent_no 
           && strstr(ua,bad_agent[i])==NULL;i++);
       if(i<bad_agent_no) user_error("trapped");
    }
    force_setvar(ro_name[ro_session],robot_session);
    setsesdir(robot_session);
    c=getvar(ro_name[ro_cmd]);
    robot_access=1;
    if(c!=NULL && strcmp(c,"new") && strcmp(c,"intro")) {
       force_setvar(ro_name[ro_cmd],"robot_error");
       nph_header(450); put_special_page("robot");
       flushoutput(); flushlog(); exit(0);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void special_cmds ( void  )

Definition at line 761 of file wims.c.

{
    char *c, *p;
    int i;
    long int l=-1;
    
    c=getvar(ro_name[ro_cmd]);
    if(c==NULL || *c==0) {  /* no module name nor command */
       setvar(ro_name[ro_module],home_module);
       setvar(ro_name[ro_cmd],commands[cmd_new]);
       return;
    }
    for(i=0;i<CMD_NO && strcmp(commands[i],c)!=0; i++);
    switch(i) {
       case cmd_intro: {
           set_module_prefix();
           default_form_method="get";
           if(ftest(mkfname(NULL,"%s/%s",module_prefix,intro_file))<0) {
              force_setvar(ro_name[ro_cmd],commands[cmd_new]);
              return;
           }
           p=getvar("wims_session");
           if(p!=NULL && *p!=0) {
              if(set_session_prefix()==0) check_session();
              else {
                  trap_check(p);
                  if(strchr(p,'_')!=NULL && strchr(p,'/')==NULL) {
                     get_static_session_var();
                  }
              }
           }
           /* determine http protocol name. How to detect? */
           p=getenv("HTTPS"); if(p!=NULL && strcmp(p,"on")==0) {
              protocol="https"; set_protocol();
           }
           force_setvar("wims_protocol",protocol);
           determine_font(lang);
           main_phtml_put(intro_file); debug_output();
           introend: write_logs();free(var_str);
           delete_pid(); exit(0);
       }
       case cmd_ref: {
           set_module_prefix();
           default_form_method="get";
           p=getvar("wims_session");
           if(p!=NULL && *p!=0) {
              if(set_session_prefix()==0) check_session();
              else trap_check(p);
           }
           determine_font(lang);
           main_phtml_put(ref_file); goto introend;
       }
       case cmd_getins: {
           c=getvar(ro_name[ro_special_parm]);
           if(c==NULL || *c==0) {
              user_error_nolog=1; user_error("no_insnum");
           }
           if(*c=='/' || strstr(c,"..")!=NULL) goto badins;
           set_session_prefix();
           if(strstr(session_prefix,"robot")!=NULL) exit(0);
           l=filelength("%s/%s",s2_prefix,c);
           if(l<0) {
              badins: user_error_nolog=1; user_error("bad_insnum");
           }
           {
              char *fmt;
              fmt=strchr(c,'.');
              if(fmt==NULL) {
                  user_error_nolog=1; user_error("bad_insnum");
              }
              else fmt++;
              
              nph_header(200);
/* insert format problem; bricolage */
              printf("Content-type: image/%s\r\n\
Content-length: %ld\r\n\r\n",fmt,l);
              catfile(stdout,"%s/%s",s2_prefix,c); exit(0);
           }
       }
       case cmd_getfile: {
           char fname[MAX_FNAME+1];
           c=getvar(ro_name[ro_special_parm]);
           if(c==NULL || *c==0) {
              user_error_nolog=1; user_error("no_insnum");
           }
           if(*c=='/' || strstr(c,"..")!=NULL) goto badfile;
           
           set_session_prefix();
           if(strstr(session_prefix,"robot")!=NULL) exit(0);
           mkfname(fname,"%s/getfile/%s",session_prefix,c);
           l=filelength("%s",fname);
           if(l<0 && strchr(session_prefix,'_')!=NULL) {
              char *pt;
              mystrncpy(fname,session_prefix,sizeof(fname));
              pt=strrchr(fname,'_'); if(pt) *pt=0;
              snprintf(fname+(pt-fname),sizeof(fname)-(pt-fname),
                     "/getfile/%s",c);
              l=filelength("%s",fname);
           }
           if(l<0) {
              badfile: user_error_nolog=1; user_error("bad_insnum");
           }
           if(l>512*1024) {
              struct rlimit rlim;
              rlimit_cpu*=l/(10*1024);
              rlim.rlim_cur=rlim.rlim_max=rlimit_cpu;
              initalarm();
           }
           {
              char *p1;
              char mime[MAX_LINELEN+1];
              for(p1=c+strlen(c);p1>c && isalpha(*(p1-1)); p1--);
              strcpy(mime,"application/octet-stream");
              if(p1>c && *(p1-1)=='.') {
                  setvar("translator_unknown",mime);
                  setvar("dictionary","bases/sys/mime");
                  snprintf(mime,sizeof(mime),"translator %s",p1);
                  calc_exec(mime);
              }
              nph_header(200);
              printf("Content-type: %s\r\n\
Content-length: %ld\r\n\r\n",mime,l);
              catfile(stdout,"%s",fname); exit(0);
           }
       }
       case cmd_close: {
           char *p, b2[32]; int w;
           char nbuf[MAX_FNAME+1], vbuf[MAX_LINELEN+1];
           p=getvar(ro_name[ro_session]);
           if(p==NULL || strlen(p)<10 ||
              strchr(p,'/')!=NULL) return;
           mystrncpy(b2,p,sizeof(b2));
           p=strchr(b2,'.'); if(p!=NULL) *p=0;
           mkfname(nbuf,"%s/%s/var.stat",session_dir,b2);
           getdef(nbuf,"wims_caller",vbuf);
           if(vbuf[0]!=0) force_setvar(ro_name[ro_session],vbuf);
           w=wrapexec; wrapexec=1;
           call_sh("rm -Rf %s/%s* %s/%s* >/dev/null 2>&1",session_dir,b2,s2_dir,b2);
           wrapexec=w; cookiegot[0]=0;
           force_setvar(ro_name[ro_cmd],"new");
       }
       default: return;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void take_httpd_vars ( void  )

Definition at line 371 of file wims.c.

{
    int i;
    char *p, buf[MAX_NAMELEN+1];
    var_noexport=1;
    for(i=0;i<HTTPD_VAR_NO;i++) {
       snprintf(buf,sizeof(buf),"httpd_%s",httpd_vars[i]);
       if((p=getenv(httpd_vars[i]))!=NULL) setvar(buf,p);
    }
    var_noexport=0;
    
    for(i=0;i<unsetvarcnt;i++) unsetenv(unsetvars[i]);
    p=getenv("REMOTE_ADDR");if(p!=NULL && strcmp(p,"127.0.0.1")==0) human_access=1;
    p=getenv("HTTP_REFERER"); if(p!=NULL && *p!=0) setvar("wims_referer",p);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void useropts ( void  )

Definition at line 943 of file wims.c.

{
    char *p;
    setvar("lang",lang);
    p=getvar("useropts");
    if(p==NULL || *p==0) p=getvar("wims_useropts");
    if(p!=NULL && *p!=0) {
       if(myisdigit(p[0])) {
           usertexsize=p[0]-'0';
           if(p[1]!=0) {
              mathalign_base=p[1]-'0';
           }
       }
    }
    if(mathalign_base==1) {
       mathalign_sup1="<sup>"; mathalign_sup2="</sup>";
    }
    else mathalign_sup1=mathalign_sup2="";
}

Here is the call graph for this function:

Here is the caller graph for this function:

int verify_tables ( void  )

Definition at line 908 of file wims.c.

{
    if(verify_order(calc_routine,CALC_FN_NO,sizeof(calc_routine[0]))) return -1;
    if(verify_order(exec_routine,EXEC_FN_NO,sizeof(exec_routine[0]))) return -1;
    if(verify_order(main_config,MAIN_CONFIG_NO,sizeof(main_config[0]))) return -1;
    if(verify_order(mathname,mathname_no,sizeof(mathname[0]))) return -1;
    if(verify_order(hmname,hmname_no,sizeof(hmname[0]))) return -1;
    if(verify_order(ro_name,RO_NAME_NO,sizeof(ro_name[0]))) return -1;
    if(verify_order(distr_cmd,distr_cmd_no,sizeof(distr_cmd[0]))) return -1;
    if(verify_order(internal_name,INTERNAL_NAME_NO,
                  sizeof(internal_name[0]))) return -1;
    if(verify_order(tmathfn,tmathfn_no,sizeof(tmathfn[0]))) return -1;
    if(verify_order(tmathvar,tmathvar_no,sizeof(tmathvar[0]))) return -1;
    if(verify_order(modindex,MODINDEX_NO,sizeof(modindex[0]))) return -1;
    if(verify_order(exportvars,exportvarcnt,sizeof(exportvars[0]))) return -1;
    if(evaltab_verify()) return -1;
    if(textab_verify()) return -1;
    return 0;
}

Here is the call graph for this function:


Variable Documentation

char available_lang[MAX_LANGUAGES][4] = {"en","fr"}

Definition at line 200 of file wims.c.

Definition at line 201 of file wims.c.

Definition at line 151 of file wims.c.

char* bad_agent[]
Initial value:
{ 
       "HTTrack","MemoWeb","Teleport","Offline","Wget","eCatch",
      "Powermarks","EmailSiphon", "WebCopier"
}

Definition at line 36 of file wims.c.

char* bin_dir = "bin"

Definition at line 136 of file wims.c.

Definition at line 45 of file wims.c.

int cmd_type

Definition at line 231 of file wims.c.

char* commands[]
Initial value:
{
    "intro" , "new" , "renew" , "reply" , "config" , "hint" , "help" ,
      "resume", "next", "getins", "getframe", "getfile", "close", "ref"
}

Definition at line 232 of file wims.c.

enum { ... } COMMANDS
int confset = 0

Definition at line 82 of file wims.c.

char cookiegot[256]

Definition at line 76 of file wims.c.

char cookieheader[64] = "WIMSUSER="

Definition at line 76 of file wims.c.

char cookieset[256]

Definition at line 76 of file wims.c.

int coord_input = 0

Definition at line 207 of file wims.c.

char cwdbuf[MAX_FNAME+1]

Definition at line 137 of file wims.c.

int debug = 0

Definition at line 43 of file wims.c.

char* default_form_method = "post"

Definition at line 195 of file wims.c.

Definition at line 58 of file wims.c.

int deplen = 0

Definition at line 80 of file wims.c.

char* devel_modules = "close"

Definition at line 141 of file wims.c.

int direct_datafile = 0

Definition at line 108 of file wims.c.

int direct_exec = 0

Definition at line 115 of file wims.c.

char** environ
char exam_sheetexo[32]

Definition at line 154 of file wims.c.

Definition at line 153 of file wims.c.

Definition at line 152 of file wims.c.

int exec_is_module = 0

Definition at line 109 of file wims.c.

int exec_wait = 1

Definition at line 125 of file wims.c.

int execnt = 0

Definition at line 126 of file wims.c.

Definition at line 101 of file wims.c.

int exodepOK = 1

Definition at line 148 of file wims.c.

int forceresume = 0

Definition at line 129 of file wims.c.

int form_access = 0

Definition at line 118 of file wims.c.

Definition at line 133 of file wims.c.

int getwimstexsize = 1

Definition at line 71 of file wims.c.

char* good_agent[]
Initial value:
{
      "Mozilla","Netscape","Opera","WIMS",
      "MSIE","Konqueror","Java"
}

Definition at line 30 of file wims.c.

int good_httpd = 0

Definition at line 113 of file wims.c.

char* home_module = "home"

Definition at line 91 of file wims.c.

Definition at line 158 of file wims.c.

Definition at line 338 of file wims.c.

char* httpd_vars[]
Initial value:
{
      "HTTP_ACCEPT",
      "HTTP_ACCEPT_CHARSET",
      "HTTP_ACCEPT_LANGUAGE",
      "HTTP_COOKIE",
      "HTTP_HOST",
      "HTTP_USER_AGENT",
      "HTTPS",
      "QUERY_STRING",
      "REMOTE_HOST",
      "REMOTE_ADDR",
      "REMOTE_PORT",
      "REQUEST_METHOD",
      "SCRIPT_NAME",
      "SERVER_NAME",
      "SERVER_SOFTWARE",
      "SERVER_PROTOCOL"
}

Definition at line 309 of file wims.c.

int human_access = 0

Definition at line 28 of file wims.c.

Definition at line 140 of file wims.c.

int insert_no

Definition at line 102 of file wims.c.

int instex_cnt = 0

Definition at line 71 of file wims.c.

Definition at line 72 of file wims.c.

char* instex_processor = "tex..gif"

Definition at line 73 of file wims.c.

Definition at line 72 of file wims.c.

char* instex_style = ""

Definition at line 120 of file wims.c.

Definition at line 121 of file wims.c.

struct { ... } internal_name[]
int is_multiexec = 0

Definition at line 106 of file wims.c.

int isclassmodule = 0

Definition at line 142 of file wims.c.

int isdevelmodule = 0

Definition at line 143 of file wims.c.

int isexam = 0

Definition at line 104 of file wims.c.

int ismhelp = 0

Definition at line 132 of file wims.c.

char job_identifier[32]

Definition at line 185 of file wims.c.

int killpid = 0

Definition at line 145 of file wims.c.

char lang[16] = "en"

Definition at line 199 of file wims.c.

int lastout_file = -1

Definition at line 119 of file wims.c.

time_t limtime

Definition at line 164 of file wims.c.

time_t limtimex

Definition at line 164 of file wims.c.

char loadavg[64]

Definition at line 155 of file wims.c.

Definition at line 61 of file wims.c.

int manageable = 0

Definition at line 130 of file wims.c.

int manager_https = 0

Definition at line 189 of file wims.c.

char* manager_site = "127.0.0.1"

Definition at line 188 of file wims.c.

Definition at line 146 of file wims.c.

Definition at line 146 of file wims.c.

Definition at line 61 of file wims.c.

int mcachecnt

Definition at line 62 of file wims.c.

int mfilecnt = 0

Definition at line 128 of file wims.c.

Definition at line 86 of file wims.c.

int module_defined = 0

Definition at line 93 of file wims.c.

char* module_dir = "modules"

Definition at line 111 of file wims.c.

Definition at line 96 of file wims.c.

char mpboundary[1024]

Definition at line 79 of file wims.c.

Definition at line 107 of file wims.c.

char multiexec_random[64]

Definition at line 100 of file wims.c.

enum { ... } NAME_MODES
int new_session = 0

Definition at line 112 of file wims.c.

int noout = 0

Definition at line 134 of file wims.c.

struct tm* now

Definition at line 163 of file wims.c.

struct tm Now

Definition at line 163 of file wims.c.

char nowstr[32]

Definition at line 165 of file wims.c.

time_t nowtime

Definition at line 164 of file wims.c.

Definition at line 103 of file wims.c.

int outputing

Definition at line 89 of file wims.c.

int parm_restore = 0

Definition at line 124 of file wims.c.

char pre_language[4] = ""

Definition at line 202 of file wims.c.

int print_precision = 8

Definition at line 116 of file wims.c.

char* protocol = "http"

Definition at line 203 of file wims.c.

int readnest

Definition at line 127 of file wims.c.

char ref_base[2048]

Definition at line 343 of file wims.c.

char ref_name[2048]

Definition at line 343 of file wims.c.

char* remote_addr = ""

Definition at line 340 of file wims.c.

char* remote_host = ""

Definition at line 341 of file wims.c.

int rlimit_as = 209715200

Definition at line 170 of file wims.c.

int rlimit_core = 0

Definition at line 173 of file wims.c.

int rlimit_cpu = 20

Definition at line 168 of file wims.c.

int rlimit_data = 204857600

Definition at line 171 of file wims.c.

int rlimit_fsize = 8388608

Definition at line 169 of file wims.c.

int rlimit_memlock = 2097152

Definition at line 177 of file wims.c.

int rlimit_nofile = 512

Definition at line 176 of file wims.c.

int rlimit_nproc = 1024

Definition at line 175 of file wims.c.

int rlimit_rss = 16777216

Definition at line 174 of file wims.c.

int rlimit_stack = 2097152

Definition at line 172 of file wims.c.

char* ro_name[]
Initial value:
{
      "cmd" ,
      "empty",
      "lang" ,
      "module" ,
      "session" ,
      "special_parm",
      "special_parm2",
      "useropts" ,
      "wims_session",
      "wims_subsession",
      "wims_window",
      "worksheet"
}

Definition at line 211 of file wims.c.

enum { ... } RO_NAMES
int robot_access = 0

Definition at line 28 of file wims.c.

char* robot_session = "../tmp/robot"

Definition at line 27 of file wims.c.

Definition at line 96 of file wims.c.

Definition at line 99 of file wims.c.

Definition at line 96 of file wims.c.

Definition at line 117 of file wims.c.

int setcookie = 0

Definition at line 144 of file wims.c.

int simuxam = 0

Definition at line 105 of file wims.c.

long int startmtime

Definition at line 149 of file wims.c.

long int startmtime2

Definition at line 150 of file wims.c.

char* stdinbuf

Definition at line 98 of file wims.c.

int substnest = 0

Definition at line 147 of file wims.c.

Definition at line 61 of file wims.c.

char* tmp_debug = "no"

Definition at line 139 of file wims.c.

char tmp_dir[MAX_FNAME+1]

Definition at line 135 of file wims.c.

Definition at line 161 of file wims.c.

char* unsetvars[]
Initial value:
{
       "DOCUMENT_ROOT","SERVER_SIGNATURE","SERVER_SOFTWARE",
      "UNIQUE_ID","HTTP_KEEP_ALIVE","SSL_SESSION_ID"
}

Definition at line 331 of file wims.c.

Definition at line 29 of file wims.c.

int user_lang = 0

Definition at line 68 of file wims.c.

Definition at line 51 of file wims.c.

struct { ... } user_variable[MAX_VAR_NUM]
char* var_def_buf

Definition at line 182 of file wims.c.

char var_hacking = 0

Definition at line 138 of file wims.c.

Definition at line 159 of file wims.c.

char * var_nr

Definition at line 157 of file wims.c.

char * var_nw

Definition at line 157 of file wims.c.

char * var_pfx

Definition at line 157 of file wims.c.

char* var_readable

Definition at line 157 of file wims.c.

char* var_str

Definition at line 179 of file wims.c.

char * var_writable

Definition at line 157 of file wims.c.

int wims_exo = 0

Definition at line 192 of file wims.c.

int wims_sheet = 0

Definition at line 192 of file wims.c.

int WORKFILE_LIMIT = 2048*1024

Definition at line 65 of file wims.c.

int wrapexec = 0

Definition at line 122 of file wims.c.