• Leigh Stoller's avatar
    * Replace the argument processing code in all pages. Currently we rely on · 48acc8e3
    Leigh Stoller authored
      register_globals=1 to turn POST/GET/COOKIES arguments in local variables.
      This is known to be a terrible security risk, and we keep saying we are
      going to fix it, and now I am. In order to accomplish this on a
      transitional basis (since I don't want the entire web interface to stop
      working while I debug it), and because the code just needs the cleanup, I
      am doing it like this: Each page will sport new declarations at the top:
    
    	RequiredPageArguments("experiment", PAGEARG_EXPERIMENT,
                                  "template",   PAGEARG_TEMPLATE,
                                  "instance",   PAGEARG_INSTANCE,
                                  "metadata",   PAGEARG_METADATA,
                                  "osinfo",     PAGEARG_OSINFO,
                                  "image",      PAGEARG_IMAGE,
                                  "project",    PAGEARG_PROJECT,
                                  "group",      PAGEARG_GROUP,
                                  "user",       PAGEARG_USER,
    			      "node",       PAGEARG_NODE,
    			      "yesno",      PAGEARG_BOOLEAN,
    			      "message",    PAGEARG_STRING,
    			      "age",        PAGEARG_INTEGER,
                                  "cost",       PAGEARG_NUMERIC,
                                  "formfields", PAGEARG_ARRAY,
                                  "unknown",    PAGEARG_ANYTHING);
    
    	OptionalPageArguments("canceled", PAGEARG_BOOLEAN);
    
      The first token in each pair is the name of the global variable to
      set, and the second token is the type. So, for "experiment" we look at
      the URL for a pid/eid or exptidx, etc, sanity check them (safe for a
      DB query), and then try to find that experiment in the DB. If it maps
      to an experiment, set global variable $experiment to the object. Since
      its a required argument, produce an error if not supplied. Similar
      treatment for optional arguments, with the obvious difference.
    
      The goal is to have ALL argument processing in one place, consistent,
      and correct. I've found numerous places where we leak unchecked
      arguments into queries. It also cuts out a lot of duplicated code.
    
    * To make the above easier to deal with, I've been replacing lots of
      hardcoded URLS in the code of the form:
    
    	foo.php3?pid=$pid&eid=$eid ...
    
      with
    
            CreateURL("foo", $experiment)
    
      which creates and returns the neccessary url string, by looking at
      the type of its arguments (experiment, template, instance, etc.)
    
      Eventually plan to replace them all so that URL handling throughout
      the code is all defined in one place (all the new URL code is in
      url_defs.php).
    
    * I have cranked up error reporting to tell me anytime a variable is
      used before it is initialized, plus a bunch of other stuff that PHP
      deems improper. Think of it like -Wall ... and boy we get a lot of
      warnings.  A very large percentage of the diffs are to fix all these
      warnings.
    
      The warnings are currently going to /usr/testbed/log/php-errors.log,
      and I'll be adding a script to capture them each night and mail them
      to tbops. This file also gets errors (this will be a change for
      developers; rather then seeing errors and warnings dumped in the
      middle of web pages, they will go to this file instead).
    
    * Major refactoring of the code. More objects (nodes, images, osids).
      Moving tons of queries into the objects in the hopes of someday
      getting to a point where we can split the web interface onto a
      different server.  Lots of general cleanup.
    48acc8e3
Name
Last commit
Last update
..
autostatus-icons Loading commit data...
buildui Loading commit data...
cvsweb Loading commit data...
doc Loading commit data...
downloads Loading commit data...
floormap Loading commit data...
garcia-telemetry Loading commit data...
hyperviewer Loading commit data...
jabber Loading commit data...
js Loading commit data...
netlab Loading commit data...
pix Loading commit data...
robotrack Loading commit data...
sdr Loading commit data...
sec-check Loading commit data...
timetree Loading commit data...
tutorial Loading commit data...
webdb Loading commit data...
wireless-stats Loading commit data...
.htaccess Loading commit data...
1px.gif Loading commit data...
BlinkenLichten$1.class Loading commit data...
BlinkenLichten.class Loading commit data...
BlinkenLichten.java Loading commit data...
GNUmakefile.in Loading commit data...
JSON.php Loading commit data...
Sajax.php Loading commit data...
TOCHECK Loading commit data...
TODO Loading commit data...
WebCamApplet.jar Loading commit data...
apc.php Loading commit data...
approveproject.php3 Loading commit data...
approveproject_form.php3 Loading commit data...
approveproject_list.php3 Loading commit data...
approveuser.php3 Loading commit data...
approveuser_form.php3 Loading commit data...
approvewauser.php3 Loading commit data...
approvewauser_form.php3 Loading commit data...
archive_control.php3 Loading commit data...
archive_missing.php3 Loading commit data...
archive_tag.php3 Loading commit data...
archive_tags.php3 Loading commit data...
archive_view.php3 Loading commit data...
arrow4.ico Loading commit data...
auth.html Loading commit data...
banner.svg Loading commit data...
beginexp_form.php3 Loading commit data...
beginexp_html.php3 Loading commit data...
beginexp_xml.php3 Loading commit data...
blueball.gif Loading commit data...
blueball.png Loading commit data...
boot.php3 Loading commit data...
bootlog.php3 Loading commit data...
builtwith.eps Loading commit data...
builtwith.png Loading commit data...
builtwith.sxd Loading commit data...
busy.gif Loading commit data...
cdromcheckin.php3 Loading commit data...
changeall.csh Loading commit data...
changeuid.php Loading commit data...
chpasswd.php3 Loading commit data...
clearapc.php Loading commit data...
clientui.php3 Loading commit data...
coming-soon-thumb.gif Loading commit data...
common-style.css Loading commit data...
console.gif Loading commit data...
cool.gif Loading commit data...
copyright-contrib.html Loading commit data...
copyright.html Loading commit data...
csshover.htc Loading commit data...
currentusage.php3 Loading commit data...
dbcheck.php3 Loading commit data...
dbdefs.php3.in Loading commit data...
defs.php3.in Loading commit data...
delaycontrol.php3 Loading commit data...
deletegroup.php3 Loading commit data...
deleteimageid.php3 Loading commit data...
deletenodelog.php3 Loading commit data...
deleteosid.php3 Loading commit data...
deleteproject.php3 Loading commit data...
deletepubkey.php3 Loading commit data...
deletesfskey.php3 Loading commit data...
deleteuser.php3 Loading commit data...
delmmlist.php3 Loading commit data...
doc.php3 Loading commit data...
docwrapper.php3 Loading commit data...
editexp.php3 Loading commit data...
editgroup.php3 Loading commit data...
editgroup_form.php3 Loading commit data...
editimageid.php3 Loading commit data...
editnodetype.php3 Loading commit data...
editsitevars.php3 Loading commit data...
elabinelab.pdf Loading commit data...
elabinelab.sxd Loading commit data...
emailus.php3 Loading commit data...
emulab-mime-winxp.reg Loading commit data...
emulab-mime-winxp.zip Loading commit data...
emulab_sup.js Loading commit data...
endexp.php3 Loading commit data...
error.php3 Loading commit data...
error.shtml Loading commit data...
experiment_defs.php Loading commit data...
experimentrun_show.php Loading commit data...
explist.php3 Loading commit data...
faq.html Loading commit data...
faq.php3 Loading commit data...
favicon.ico Loading commit data...
feedback.php3 Loading commit data...
floormap.php3 Loading commit data...
floormap_aux.php3 Loading commit data...
freenode.php3 Loading commit data...
freezeuser.php3 Loading commit data...
gensslcert.php3 Loading commit data...
getsslcert.php3 Loading commit data...
gotobugdb.php3 Loading commit data...
gotochat.php3 Loading commit data...
gotommlist.php3 Loading commit data...
gotowiki.php3 Loading commit data...
greenball.gif Loading commit data...
greenball.png Loading commit data...
group_defs.php Loading commit data...
groups.html Loading commit data...
hardware.html Loading commit data...
headerbgbb.jpg Loading commit data...
htmlinstall.in Loading commit data...
imageid_defs.php Loading commit data...
index.html Loading commit data...
index.php3 Loading commit data...
instance_show.php Loading commit data...
java.html Loading commit data...
joinproject.php3 Loading commit data...
json.js Loading commit data...
kb-browse.php3 Loading commit data...
kb-faq.php3 Loading commit data...
kb-manage.php3 Loading commit data...
kb-search.php3 Loading commit data...
kb-show.php3 Loading commit data...
lanicon.png Loading commit data...
ledpipe.php3 Loading commit data...
linkgraph_image.php Loading commit data...
linkmon_ctl.php3 Loading commit data...
linkmon_list.php3 Loading commit data...
linkmon_mon.php3 Loading commit data...
linktest.php3 Loading commit data...
listrepos.php3 Loading commit data...
loadimage.php3 Loading commit data...
logger.css Loading commit data...
logger.js Loading commit data...
login.php3 Loading commit data...
login_plab.php3 Loading commit data...
login_redirect.php Loading commit data...
logo-background.gif Loading commit data...
logo-emulab.gif Loading commit data...
logo.sxd Loading commit data...
logoff.gif Loading commit data...
logon.gif Loading commit data...
logout.php3 Loading commit data...
menu.php3 Loading commit data...
modifyexp.php3 Loading commit data...
modnodeattributes.php3 Loading commit data...
modnodeattributes_form.php3 Loading commit data...
moduserinfo.php3 Loading commit data...
moteleds.php3 Loading commit data...
mtp.jar Loading commit data...
mungelog.js Loading commit data...
mychat.php3 Loading commit data...
netbed-icon-howto.txt Loading commit data...
netbed-large.png Loading commit data...
netbed.ico Loading commit data...
netbed.png Loading commit data...
netemu.php3 Loading commit data...
netlab-client.jar Loading commit data...
new.gif Loading commit data...
newgroup.php3 Loading commit data...
newgroup_form.php3 Loading commit data...
newimageid.php3 Loading commit data...
newimageid_ez.php3 Loading commit data...
newmmlist.php3 Loading commit data...
newnode-defs.php3 Loading commit data...
newnode_edit.php3 Loading commit data...
newnodecheckin.php Loading commit data...
newnodelog.php3 Loading commit data...
newnodelog_form.php3 Loading commit data...
newnodes_list.php3 Loading commit data...
newosid.php3 Loading commit data...
newosid_form.php3 Loading commit data...
newproject.php3 Loading commit data...
news-rss.php3 Loading commit data...
news.php3 Loading commit data...
node_defs.php Loading commit data...
nodecontrol.php3 Loading commit data...
nodecontrol_form.php3 Loading commit data...
nodecontrol_list.php3 Loading commit data...
nodeicon.png Loading commit data...
noderdp.php3 Loading commit data...
nodessh.php3 Loading commit data...
nodetipacl.php3 Loading commit data...
nologins.php3 Loading commit data...
nscheck.php3 Loading commit data...
nscheck_form.php3 Loading commit data...
nsgen.php3 Loading commit data...
obstacle_list.php3 Loading commit data...
oncrpc.jar Loading commit data...
osiddefs.php3 Loading commit data...
osinfo_defs.php Loading commit data...
otheremulabs.html Loading commit data...
overlay.elabinelab.gif Loading commit data...
overlay.emulab.net.gif Loading commit data...
overlay.gif Loading commit data...
overlay.mac.emulab.net.gif Loading commit data...
overlay.mini.emulab.net.gif Loading commit data...
overlay.netlab.cc.gatech.edu.gif Loading commit data...
overlay.stoller.emulab.net.gif Loading commit data...
overlay.uky.emulab.net.gif Loading commit data...
pagenotworking.php Loading commit data...
panicbutton.gif Loading commit data...
panicbutton.php3 Loading commit data...
password.php3 Loading commit data...
people.php3 Loading commit data...
plab_ez.php3 Loading commit data...
plab_ez_footnote1.html Loading commit data...
plab_ez_footnote2.html Loading commit data...
plab_ez_footnote3.html Loading commit data...
plab_ez_footnote4.html Loading commit data...
plab_ez_footnote5.html Loading commit data...
plab_ez_footnote6.html Loading commit data...
plab_ez_footnote7.html Loading commit data...
plab_ez_footnote8.html Loading commit data...
plabmetrics.php3 Loading commit data...
plabstats.php3 Loading commit data...
policies.html Loading commit data...
powertime.php3 Loading commit data...
prereserve_node.php3 Loading commit data...
project_defs.php Loading commit data...
projectlist.php3 Loading commit data...
pubs.html Loading commit data...
pubs.php3 Loading commit data...
rdp-mime-winxp.c Loading commit data...
rdp-mime-winxp.exe Loading commit data...
rdp-mime-winxp.pl Loading commit data...
rdp-mime.html Loading commit data...
rdp-mime.pl Loading commit data...
rdp.gif Loading commit data...
redball.gif Loading commit data...
redball.png Loading commit data...
remapexp.php3 Loading commit data...
replayexp.php3 Loading commit data...
reqaccount.php3 Loading commit data...
request_idleinfo.php3 Loading commit data...
request_swapexp.php3 Loading commit data...
requestaccount.gif Loading commit data...
resendapproval.php Loading commit data...
resendkey.php3 Loading commit data...
robotmap.php3 Loading commit data...
rss.png Loading commit data...
sc2002tut.php3 Loading commit data...
search.php3 Loading commit data...
security.html Loading commit data...
sendemail.php3 Loading commit data...
sendtestmsg.php3 Loading commit data...
servicepipe.php3 Loading commit data...
setnodeloc.php3 Loading commit data...
showconlog.php3 Loading commit data...
showevents.php Loading commit data...
showexp.js Loading commit data...
showexp.php3 Loading commit data...
showexp_list.php3 Loading commit data...
showexpstats.php3 Loading commit data...
showgroup.php3 Loading commit data...
showimageid.php3 Loading commit data...
showimageid_list.php3 Loading commit data...
showlasterror.php3 Loading commit data...
showlogfile.php3 Loading commit data...
showlogfile_sup.php3 Loading commit data...
showmmlists.php3 Loading commit data...
shownode.php3 Loading commit data...
shownodehistory.php3 Loading commit data...
shownodelog.php3 Loading commit data...
shownodetype.php3 Loading commit data...
shownsfile.php3 Loading commit data...
showobstacle.php3 Loading commit data...
showosid_list.php3 Loading commit data...
showosinfo.php3 Loading commit data...
showpolicies.php3 Loading commit data...
showproject.php3 Loading commit data...
showproject_list.php3 Loading commit data...
showpubkeys.php3 Loading commit data...
showsfskeys.php3 Loading commit data...
showstats.php3 Loading commit data...
showstuff.php3 Loading commit data...
showsumstats.php3 Loading commit data...
showthumb.php3 Loading commit data...
showuser.php3 Loading commit data...
showuser_list.php3 Loading commit data...
software.html Loading commit data...
software.php3 Loading commit data...
sorttable.js Loading commit data...
spewconlog.php3 Loading commit data...
spewevents.php Loading commit data...
spewlogfile.php3 Loading commit data...
spewrpmtar.php3 Loading commit data...
spitnsdata.php3 Loading commit data...
spitreport.php Loading commit data...
sponsors.html Loading commit data...
ssh-mime-windows.pl Loading commit data...
ssh-mime-winxp.c Loading commit data...
ssh-mime-winxp.exe Loading commit data...
ssh-mime-winxp.pl Loading commit data...
ssh-mime.c Loading commit data...
ssh-mime.html Loading commit data...
ssh-mime.pl Loading commit data...
ssh-mime.scpt Loading commit data...
ssh.gif Loading commit data...
start.php3 Loading commit data...
statechange.php Loading commit data...
style-doc.css Loading commit data...
style-nonmain.css Loading commit data...
style.css Loading commit data...
suuser.php Loading commit data...
swapexp.php3 Loading commit data...
swapping.html Loading commit data...
swish.conf.in Loading commit data...
tbauth.php3 Loading commit data...
tbstyle-plain.css Loading commit data...
telemetry.php3 Loading commit data...
template_analyze.php Loading commit data...
template_commit.php Loading commit data...
template_create.php Loading commit data...
template_defs.php Loading commit data...
template_editevents.php Loading commit data...
template_export.php Loading commit data...
template_exprun.php Loading commit data...
template_graph.php Loading commit data...
template_history.php Loading commit data...
template_metadata.php Loading commit data...
template_modify.php Loading commit data...
template_show.php Loading commit data...
template_sup.js Loading commit data...
template_swapin.php Loading commit data...
textbox.js Loading commit data...
thinlet.jar Loading commit data...
toggle.php Loading commit data...
top2image.php3 Loading commit data...
unregister_globals.php Loading commit data...
updateaccounts.php3 Loading commit data...
updown.php3 Loading commit data...
url_defs.php Loading commit data...
user_defs.php Loading commit data...
verifyusr.php3 Loading commit data...
verifyusr_form.php3 Loading commit data...
wallpaper0.jpg Loading commit data...
wallpaper1.png Loading commit data...
webcam.php3 Loading commit data...
webcamimg.php3 Loading commit data...
websearch.in Loading commit data...
widearea.html Loading commit data...
widearea_info.php3 Loading commit data...
widearea_nodeinfo.php3 Loading commit data...
widearea_redirect.php Loading commit data...
wideareakeys.php3 Loading commit data...
wikiregister.php3 Loading commit data...
xmlrpc.php3.in Loading commit data...
xmlrpcpipe.php3.in Loading commit data...