Subversion Repositories wimsdev

Rev

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

Rev 10 Rev 3836
Line 39... Line 39...
39
                if(strlen(p1)>=MAX_CLASSLEN || !myisdigit(*p1) ||
39
                if(strlen(p1)>=MAX_CLASSLEN || !myisdigit(*p1) ||
40
                   strstr(p1,"..")!=NULL) {
40
                   strstr(p1,"..")!=NULL) {
41
                    sockerror(2,"illegal_fname %s",p1);
41
                    sockerror(2,"illegal_fname %s",p1);
42
                    return -1;
42
                    return -1;
43
                }
43
                }
44
                chdir(classd); if(chdir(p1)<0) {
44
                (void)chdir(classd); if(chdir(p1)<0) {
45
                    sockerror(2,"bad_class %s",p1);
45
                    sockerror(2,"bad_class %s",p1);
46
                    return -1;
46
                    return -1;
47
                }
47
                }
48
                mystrncpy(opt_class,p1,sizeof(opt_class));
48
                mystrncpy(opt_class,p1,sizeof(opt_class));
49
                cwdtype=dir_class; break;
49
                cwdtype=dir_class; break;
Line 54... Line 54...
54
                }
54
                }
55
                if(strlen(p1)>MAX_FNAME || *p1=='/' || strstr(p1,"..")!=NULL) {
55
                if(strlen(p1)>MAX_FNAME || *p1=='/' || strstr(p1,"..")!=NULL) {
56
                    sockerror(2,"illegal_fname %s",p1);
56
                    sockerror(2,"illegal_fname %s",p1);
57
                    return -1;
57
                    return -1;
58
                }
58
                }
59
                chdir(modd); if(chdir(p1)<0) {
59
                (void)chdir(modd); if(chdir(p1)<0) {
60
                    sockerror(2,"bad_module:%s",p1);
60
                    sockerror(2,"bad_module:%s",p1);
61
                    return -1;
61
                    return -1;
62
                }
62
                }
63
                mystrncpy(opt_module,p1,sizeof(opt_module));
63
                mystrncpy(opt_module,p1,sizeof(opt_module));
64
                cwdtype=dir_module; break;
64
                cwdtype=dir_module; break;
Line 69... Line 69...
69
                }
69
                }
70
                if(strlen(p1)>=MAX_CLASSLEN || *p1=='/' || strstr(p1,"..")!=NULL) {
70
                if(strlen(p1)>=MAX_CLASSLEN || *p1=='/' || strstr(p1,"..")!=NULL) {
71
                    sockerror(2,"illegal_fname:%s",p1);
71
                    sockerror(2,"illegal_fname:%s",p1);
72
                    return -1;
72
                    return -1;
73
                }
73
                }
74
                chdir(sesd); if(chdir(p1)<0) {
74
                (void)chdir(sesd); if(chdir(p1)<0) {
75
                    sockerror(2,"bad_session:%s",p1);
75
                    sockerror(2,"bad_session:%s",p1);
76
                    return -1;
76
                    return -1;
77
                }
77
                }
78
                mystrncpy(opt_session,p1,sizeof(opt_session));
78
                mystrncpy(opt_session,p1,sizeof(opt_session));
79
                cwdtype=dir_session; break;
79
                cwdtype=dir_session; break;