Skip to content

Commit 68c4f8e

Browse files
committed
httpd: security backport in ej_dump() from 380_8228
1 parent eb56d07 commit 68c4f8e

File tree

1 file changed

+18
-10
lines changed
  • release/src/router/httpd

1 file changed

+18
-10
lines changed

release/src/router/httpd/web.c

+18-10
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ ej_dump(int eid, webs_t wp, int argc, char_t **argv)
12031203
//csprintf("Script : %s, File: %s\n", script, file);
12041204

12051205
// run scrip first to update some status
1206-
if (strcmp(script,"")!=0) sys_script(script);
1206+
if (strcmp(script,"syscmd.sh")==0) sys_script(script);
12071207

12081208
if (strcmp(file, "wlan11b.log")==0)
12091209
return (ej_wl_status(eid, wp, 0, NULL, 0)); /* FIXME */
@@ -1232,14 +1232,6 @@ ej_dump(int eid, webs_t wp, int argc, char_t **argv)
12321232
return wl_wps_info(eid, wp, argc, argv, nvram_get_int("wps_band_x"));
12331233
#endif
12341234
}
1235-
#if 0
1236-
else if (strcmp(file, "apselect.log")==0)
1237-
return (ej_getSiteSurvey(eid, wp, 0, NULL));
1238-
else if (strcmp(file, "apscan")==0)
1239-
return (ej_SiteSurvey(eid, wp, 0, NULL));
1240-
else if (strcmp(file, "urelease")==0)
1241-
return (ej_urelease(eid, wp, 0, NULL));
1242-
#endif
12431235

12441236
ret = 0;
12451237

@@ -1350,7 +1342,23 @@ ej_dump(int eid, webs_t wp, int argc, char_t **argv)
13501342
}
13511343
#endif /* RTCONFIG_DSL */
13521344
#endif /* RTCONFIG_PUSH_EMAIL */
1353-
else {
1345+
else if (strcmp(file, "connect.log")==0) {
1346+
sprintf(filename, "/tmp/%s", file);
1347+
system("/usr/sbin/netstat-nat -r state -xn > /tmp/connect.log 2>&1");
1348+
ret += dump_file(wp, filename);
1349+
}
1350+
else if ( strcmp(file, "syscmd.log")==0
1351+
|| strcmp(file, "pptp_connected")==0
1352+
|| strcmp(file, "release_note0.txt")==0
1353+
|| strcmp(file, "release_note1.txt")==0
1354+
|| strcmp(file, "release_note.txt")==0
1355+
#ifdef RTCONFIG_DSL
1356+
|| strcmp(file, "adsl/tc_fw_ver_short.txt")==0
1357+
|| strcmp(file, "adsl/tc_ras_ver.txt")==0
1358+
|| strcmp(file, "adsl/tc_fw_ver.txt")==0
1359+
|| strcmp(file, "adsl/adsllog.log")==0
1360+
#endif
1361+
){
13541362
sprintf(filename, "/tmp/%s", file);
13551363
ret += dump_file(wp, filename);
13561364
}

0 commit comments

Comments
 (0)