Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
cba87b22
Commit
cba87b22
authored
Jun 23, 2010
by
Leigh B Stoller
Browse files
Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel
parents
8f03e35e
e9cb4a3f
Changes
14
Hide whitespace changes
Inline
Side-by-side
tbsetup/assign_wrapper2.in
View file @
cba87b22
...
...
@@ -68,7 +68,11 @@ if ($exitcode) {
# Pull out relevent info
print
SERR
"
ASSIGN FAILED:
\n
";
while
((
shift
@out
)
!~
/^[\w\s]*precheck:$/
)
{}
while
((
$_
=
shift
@out
)
&&
!
/^[\w\s]*precheck:$/
)
{}
if
(
not
defined
$_
)
{
tberror
({
cause
=>
'
internal
'},
"
Invalid Assign Output (expected
\"
precheck:
\"
line).
");
}
while
((
$_
=
shift
@out
))
{
/^[\w\s]*precheck:$/
&&
do
{
next
;
...
...
@@ -81,7 +85,11 @@ if ($exitcode) {
push
@err
,
$_
;
}
if
(
$violations
)
{
while
((
shift
@out
)
!~
/^Violations:/
)
{}
while
((
$_
=
shift
@out
)
&&
!
/^Violations:/
)
{}
if
(
not
defined
$_
)
{
tberror
({
cause
=>
'
internal
'},
"
Invalid Assign Output (expected
\"
Violations:
\"
line).
");
}
while
((
$_
=
shift
@out
))
{
if
(
/^Nodes:/
)
{
last
;
...
...
www/beginexp_form.php3
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2007
, 2010
University of Utah and the Flux Group.
# All rights reserved.
#
...
...
@@ -35,12 +35,12 @@ function INITFORM($formfields, $projlist)
# this is to have another page for netbuild that does some magic and
# redirects the browser to this page.
#
if
(
isset
(
$nsref
)
&&
$nsref
!=
""
&&
e
reg
(
"
^[0-9]+$
"
,
$nsref
))
if
(
isset
(
$nsref
)
&&
$nsref
!=
""
&&
p
reg
_match
(
'/
^[0-9]+$
/'
,
$nsref
))
$defaults
[
"nsref"
]
=
$nsref
;
else
unset
(
$nsref
);
if
(
isset
(
$guid
)
&&
$guid
!=
""
&&
e
reg
(
"
^[0-9]+$
"
,
$guid
))
if
(
isset
(
$guid
)
&&
$guid
!=
""
&&
p
reg
_match
(
'/
^[0-9]+$
/'
,
$guid
))
$defaults
[
"guid"
]
=
$guid
;
else
unset
(
$guid
);
...
...
www/buildui/nssave.php3
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
7
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
...
...
@@ -21,7 +21,7 @@ $optargs = OptionalPageArguments("guid", PAGEARG_INTEGER,
#
# Only known and logged in users.
#
if
(
isset
(
$guid
)
&&
e
reg
(
"
^[0-9]+$
"
,
$guid
))
{
if
(
isset
(
$guid
)
&&
p
reg
_match
(
'/
^[0-9]+$
/'
,
$guid
))
{
$uid
=
$guid
;
}
else
{
...
...
@@ -38,7 +38,7 @@ if (!isset($nsdata)) {
USERERROR
(
"Need to send NSFILE!"
,
1
);
}
if
(
!
isset
(
$nsref
)
||
!
e
reg
(
"
^[0-9]+$
"
,
$nsref
))
{
if
(
!
isset
(
$nsref
)
||
!
p
reg
_match
(
'/
^[0-9]+$
/'
,
$nsref
))
{
USERERROR
(
"Need to send valid NSREF!"
,
1
);
}
...
...
www/cdromcheckin.php3
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
3, 2007
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
require
(
"defs.php3"
);
...
...
@@ -98,7 +98,7 @@ if ((!isset($cdkey) || !strcmp($cdkey, ""))) {
return
;
}
if
(
!
e
reg
(
"
[0-9a-zA-Z]+
"
,
$cdkey
))
{
if
(
!
p
reg
_match
(
'/
[0-9a-zA-Z]+
/'
,
$cdkey
))
{
SPITSTATUS
(
CDROMSTATUS_INVALIDARGS
);
return
;
}
...
...
@@ -157,14 +157,14 @@ if ((!isset($privkey) || !strcmp($privkey, "")) ||
return
;
}
if
(
!
e
reg
(
"
[0-9a-zA-Z ]+
"
,
$privkey
)
||
!
e
reg
(
"
[0-9\.]+
"
,
$IP
))
{
if
(
!
p
reg
_match
(
'/
[0-9a-zA-Z ]+
/'
,
$privkey
)
||
!
p
reg
_match
(
'/
[0-9\.]+
/'
,
$IP
))
{
SPITSTATUS
(
CDROMSTATUS_INVALIDARGS
);
return
;
}
if
(
isset
(
$wahostname
)
&&
!
e
reg
(
"
[-_0-9a-zA-Z\.]+
"
,
$wahostname
))
{
!
p
reg
_match
(
'/
[-_0-9a-zA-Z\.]+
/'
,
$wahostname
))
{
SPITSTATUS
(
CDROMSTATUS_INVALIDARGS
);
return
;
}
...
...
@@ -183,7 +183,7 @@ if (isset($wahostname)) {
}
if
(
isset
(
$roottag
)
&&
!
e
reg
(
"
[0-9a-zA-Z]+
"
,
$roottag
))
{
!
p
reg
_match
(
'/
[0-9a-zA-Z]+
/'
,
$roottag
))
{
SPITSTATUS
(
CDROMSTATUS_INVALIDARGS
);
return
;
}
...
...
www/currentusage.php3
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
8
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
require
(
"defs.php3"
);
...
...
@@ -291,3 +291,4 @@ else {
echo
"</div>
\n
"
;
echo
"</body></html>"
;
}
?>
www/dbdefs.php3.in
View file @
cba87b22
...
...
@@ -578,7 +578,7 @@ function TBGetVersionInfo(&$major, &$minor, &$build)
DBQuery
(
"select value from version_info where name='dbrev'"
);
if
(
$query_result
&&
mysql_num_rows
(
$query_result
))
{
$row
=
mysql_fetch_row
(
$query_result
);
list
(
$a
,
$b
)
=
split
(
'\.'
,
$row
[
0
]);
list
(
$a
,
$b
)
=
preg_
split
(
'
/
\.
/
'
,
$row
[
0
]);
$a
=
(
isset
(
$a
)
&&
$a
!=
""
?
$a
:
"x"
);
$b
=
(
isset
(
$b
)
&&
$b
!=
""
?
$b
:
"y"
);
$major
=
$a
;
...
...
www/defs.php3.in
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
9
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
# Lets emulate register_globals=off for a while.
...
...
@@ -532,12 +532,12 @@ function VALIDUSERPATH($path, $uid="", $pid="", $gid="", $eid="")
# No ids specified, just make sure it starts with an appropriate prefix.
#
if
(
!
$uid
&&
!
$pid
&&
!
$gid
&&
!
$eid
)
{
if
(
e
reg
(
"^
$TBPROJ_DIR
/.*"
,
$path
)
||
e
reg
(
"^
$TBUSER_DIR
/.*"
,
$path
)
||
e
reg
(
"^
$TBGROUP_DIR
/.*"
,
$path
))
{
if
(
p
reg
_match
(
"
#
^
$TBPROJ_DIR
/.*
#
"
,
$path
)
||
p
reg
_match
(
"
#
^
$TBUSER_DIR
/.*
#
"
,
$path
)
||
p
reg
_match
(
"
#
^
$TBGROUP_DIR
/.*
#
"
,
$path
))
{
return
1
;
}
if
(
$TBSCRATCH_DIR
&&
e
reg
(
"^
$TBSCRATCH_DIR
/.*"
,
$path
))
{
if
(
$TBSCRATCH_DIR
&&
p
reg
_match
(
"
/
^
$TBSCRATCH_DIR
\
/.*
/
"
,
$path
))
{
return
1
;
}
return
0
;
...
...
www/delaycontrol.php3
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
7
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -535,7 +535,7 @@ while (list ($header, $value) = each ($formfields)) {
continue
;
}
if
(
!
isset
(
$value
)
||
!
strcmp
(
$value
,
""
)
||
!
e
reg
(
"
^[0-9\.bs]*$
"
,
"
$value
"
))
{
!
p
reg
_match
(
'/
^[0-9\.bs]*$
/'
,
"
$value
"
))
{
continue
;
}
...
...
www/newnodelog.php3
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
7
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -31,7 +31,7 @@ if (! ($isadmin || OPSGUY())) {
#
# Check log type. Strictly letters, not too long.
#
if
(
!
e
reg
(
"
^[a-zA-Z]+$
"
,
$log_type
)
||
strlen
(
$log_type
)
>
32
)
{
if
(
!
p
reg
_match
(
'/
^[a-zA-Z]+$
/'
,
$log_type
)
||
strlen
(
$log_type
)
>
32
)
{
USERERROR
(
"The log type you gave looks funky!"
,
1
);
}
...
...
www/news-rss.php3
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005-200
9
University of Utah and the Flux Group.
# Copyright (c) 2005-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -64,9 +64,9 @@ while ($row = mysql_fetch_array($query_result)) {
}
# Have to convert the date/time to RFC822 format
list
(
$date
,
$hours
)
=
split
(
' '
,
$timestamp
);
list
(
$year
,
$month
,
$day
)
=
split
(
'-'
,
$date
);
list
(
$hour
,
$min
,
$sec
)
=
split
(
':'
,
$hours
);
list
(
$date
,
$hours
)
=
preg_
split
(
' '
,
$timestamp
);
list
(
$year
,
$month
,
$day
)
=
preg_
split
(
'-'
,
$date
);
list
(
$hour
,
$min
,
$sec
)
=
preg_
split
(
':'
,
$hours
);
$rfc822date
=
date
(
"r"
,
mktime
(
$hour
,
$min
,
$sec
,
$month
,
$day
,
$year
));
if
(
$first
)
{
...
...
www/plab_ez.php3
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2003
, 2004, 2006, 2007
University of Utah and the Flux Group.
# Copyright (c) 2003
-2010
University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -54,7 +54,7 @@ $nodeversions = array();
$res
=
DBQueryFatal
(
"select feature from node_features"
.
" where feature like 'plabstatus-%' group by feature"
);
while
(
$row
=
mysql_fetch_row
(
$res
))
{
list
(
$foo
,
$feature
)
=
split
(
"\-"
,
$row
[
0
]);
list
(
$foo
,
$feature
)
=
preg_
split
(
'/\-/'
,
$row
[
0
]);
$nodeversions
[]
=
$feature
;
}
if
(
count
(
$nodeversions
)
==
0
)
{
...
...
www/powertime.php3
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005
, 2006, 2007
University of Utah and the Flux Group.
# Copyright (c) 2005
-2010
University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -61,7 +61,7 @@ else {
$body_str
.
=
"Update last power time for:<br>"
;
$body_str
.
=
"<form action='powertime.php3' method=get><br><table>"
;
$body_str
.
=
"<tr><th>Update?</th><th>Node ID</th><th>Last Power</th></tr>"
;
foreach
(
split
(
","
,
$node_id
)
as
$ni
)
{
foreach
(
preg_
split
(
","
,
$node_id
)
as
$ni
)
{
if
(
!
TBvalid_node_id
(
$ni
))
{
USERERROR
(
"Invalid node ID:
$ni
"
,
1
);
}
...
...
www/spitnsdata.php3
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
3, 2005-2007
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -134,8 +134,8 @@ if (isset($nsdata) && strcmp($nsdata, "") != 0) {
header
(
"Content-Type: text/plain"
);
echo
"
$nsdata
"
;
}
elseif
(
isset
(
$nsref
)
&&
strcmp
(
$nsref
,
""
)
!=
0
&&
e
reg
(
"
^[0-9]+$
"
,
$nsref
))
{
if
(
isset
(
$guid
)
&&
e
reg
(
"
^[0-9]+$
"
,
$guid
))
{
p
reg
_match
(
'/
^[0-9]+$
/'
,
$nsref
))
{
if
(
isset
(
$guid
)
&&
p
reg
_match
(
'/
^[0-9]+$
/'
,
$guid
))
{
$nsfile
=
"/tmp/
$guid
-
$nsref
.nsfile"
;
$id
=
$guid
;
}
else
{
...
...
www/xmlrpc.php3.in
View file @
cba87b22
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 200
4
University of Utah and the Flux Group.
# Copyright (c) 20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
# This is an included file. No headers or footers.
...
...
@@ -131,7 +131,7 @@ function XMLRPC($uid, $gid, $method, $arghash)
$return_value
=
proc_close
(
$process
);
if
(
$return_value
||
$output
==
""
||
((
$decoded
=
ParseResponse
(
$output
))
==
NULL
)
||
$decoded
->
{
"code"
})
{
((
$decoded
=
ParseResponse
(
$output
))
==
NULL
)
||
$decoded
{
"code"
})
{
TBERROR
(
"XMLRPC backend failure!
\n
"
.
"
$uid
$gid
$method
returned
$return_value
\n
"
.
"Arg Hash:
\n
"
.
...
...
@@ -144,4 +144,4 @@ function XMLRPC($uid, $gid, $method, $arghash)
# TBERROR(print_r($decoded, true), 0);
return
$decoded
{
'value'
};
}
?>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment