Rev 8177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8177 | Rev 8342 | ||
---|---|---|---|
Line 92... | Line 92... | ||
92 | for(i=0; isspace(*p) && i<MAX_LINELEN; p++,i++); |
92 | for(i=0; isspace(*p) && i<MAX_LINELEN; p++,i++); |
93 | return p; |
93 | return p; |
94 | } |
94 | } |
95 | 95 | ||
96 | /* Read/write to a file with variable parms to print filename */ |
96 | /* Read/write to a file with variable parms to print filename */ |
97 | void |
97 | void wimsdaccessfile(char *content, char *type, char *s,...) |
98 | { |
98 | { |
99 | va_list vp; |
99 | va_list vp; |
100 | char buf[MAX_LINELEN+1]; |
100 | char buf[MAX_LINELEN+1]; |
101 | FILE *f; |
101 | FILE *f; |
102 | int l; |
102 | int l; |
Line 174... | Line 174... | ||
174 | strncmp(namebuf,"modules/home/",strlen("modules/home/"))==0) |
174 | strncmp(namebuf,"modules/home/",strlen("modules/home/"))==0) |
175 | badreq(); |
175 | badreq(); |
176 | for(p=strchr(namebuf,'/'); p!=NULL; p=strchr(p+1,'/')) { |
176 | for(p=strchr(namebuf,'/'); p!=NULL; p=strchr(p+1,'/')) { |
177 | *p=0; snprintf(buf,sizeof(buf),"%s/.htaccess",namebuf); *p='/'; |
177 | *p=0; snprintf(buf,sizeof(buf),"%s/.htaccess",namebuf); *p='/'; |
178 | if(stat(cbuf,&st)==0) { |
178 | if(stat(cbuf,&st)==0) { |
179 |
|
179 | wimsdaccessfile(cbuf,"r","%s",buf); |
180 | if(strstr(cbuf,"deny from all")!=NULL) badreq(); |
180 | if(strstr(cbuf,"deny from all")!=NULL) badreq(); |
181 | } |
181 | } |
182 | } |
182 | } |
183 | siz=st.st_size; |
183 | siz=st.st_size; |
184 | printf("HTTP/1.0 200 OK\r\n\ |
184 | printf("HTTP/1.0 200 OK\r\n\ |