Commit e9472de4 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 06b7d83f 9e8ab7fd
......@@ -4063,7 +4063,7 @@ sub CheckCredential($)
sub CheckTicket($)
{
my $ticket = GeniCredential->CreateFromSignedTicket($_[0]);
my $ticket = GeniTicket->CreateFromSignedTicket($_[0]);
if (!defined($ticket)) {
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Could not create ticket object");
......
......@@ -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;
......
......@@ -466,8 +466,7 @@ sub LightUpNodes($@)
$reconfigs{$node_id} = $node;
$action = "reconfiged";
}
print STDERR "$node_id will be $action\n"
if ($self->debug());
print STDERR "$node_id will be $action\n";
}
# XXX Caller wants a list.
......
......@@ -658,7 +658,7 @@ sub createVlan($$$) {
my $RetVal = $self->hammer($closure, "$id: creation");
if (!defined($RetVal)) { return 0; }
print " Creating VLAN $vlan_id as VLAN #$vlan_number on " .
"$self->{NAME} ... ";
"$self->{NAME} ...\n";
# You'ld think you'ld be able to add IgmpSnoopEnable to the above as one
......
<?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 != "" && ereg("^[0-9]+$", $nsref))
if (isset($nsref) && $nsref != "" && preg_match('/^[0-9]+$/', $nsref))
$defaults["nsref"] = $nsref;
else
unset($nsref);
if (isset($guid) && $guid != "" && ereg("^[0-9]+$", $guid))
if (isset($guid) && $guid != "" && preg_match('/^[0-9]+$/', $guid))
$defaults["guid"] = $guid;
else
unset($guid);
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 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) && ereg("^[0-9]+$", $guid)) {
if (isset($guid) && preg_match('/^[0-9]+$/', $guid)) {
$uid = $guid;
}
else {
......@@ -38,7 +38,7 @@ if (!isset($nsdata)) {
USERERROR("Need to send NSFILE!", 1);
}
if (!isset($nsref) || !ereg("^[0-9]+$", $nsref)) {
if (!isset($nsref) || !preg_match('/^[0-9]+$/', $nsref)) {
USERERROR("Need to send valid NSREF!", 1);
}
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003, 2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
require("defs.php3");
......@@ -98,7 +98,7 @@ if ((!isset($cdkey) || !strcmp($cdkey, ""))) {
return;
}
if (!ereg("[0-9a-zA-Z]+", $cdkey)) {
if (!preg_match('/[0-9a-zA-Z]+/', $cdkey)) {
SPITSTATUS(CDROMSTATUS_INVALIDARGS);
return;
}
......@@ -157,14 +157,14 @@ if ((!isset($privkey) || !strcmp($privkey, "")) ||
return;
}
if (!ereg("[0-9a-zA-Z ]+", $privkey) ||
!ereg("[0-9\.]+", $IP)) {
if (!preg_match('/[0-9a-zA-Z ]+/', $privkey) ||
!preg_match('/[0-9\.]+/', $IP)) {
SPITSTATUS(CDROMSTATUS_INVALIDARGS);
return;
}
if (isset($wahostname) &&
!ereg("[-_0-9a-zA-Z\.]+", $wahostname)) {
!preg_match('/[-_0-9a-zA-Z\.]+/', $wahostname)) {
SPITSTATUS(CDROMSTATUS_INVALIDARGS);
return;
}
......@@ -183,7 +183,7 @@ if (isset($wahostname)) {
}
if (isset($roottag) &&
!ereg("[0-9a-zA-Z]+", $roottag)) {
!preg_match('/[0-9a-zA-Z]+/', $roottag)) {
SPITSTATUS(CDROMSTATUS_INVALIDARGS);
return;
}
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
require("defs.php3");
......@@ -291,3 +291,4 @@ else {
echo "</div>\n";
echo "</body></html>";
}
?>
......@@ -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;
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 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 (ereg("^$TBPROJ_DIR/.*", $path) ||
ereg("^$TBUSER_DIR/.*", $path) ||
ereg("^$TBGROUP_DIR/.*", $path)) {
if (preg_match("#^$TBPROJ_DIR/.*#", $path) ||
preg_match("#^$TBUSER_DIR/.*#", $path) ||
preg_match("#^$TBGROUP_DIR/.*#", $path)) {
return 1;
}
if ($TBSCRATCH_DIR && ereg("^$TBSCRATCH_DIR/.*", $path)) {
if ($TBSCRATCH_DIR && preg_match("/^$TBSCRATCH_DIR\/.*/", $path)) {
return 1;
}
return 0;
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 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, "") ||
!ereg("^[0-9\.bs]*$", "$value")) {
!preg_match('/^[0-9\.bs]*$/', "$value")) {
continue;
}
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 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 (! ereg("^[a-zA-Z]+$", $log_type) || strlen($log_type) > 32) {
if (!preg_match('/^[a-zA-Z]+$/', $log_type) || strlen($log_type) > 32) {
USERERROR("The log type you gave looks funky!", 1);
}
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005-2009 University of Utah and the Flux Group.
# Copyright (c) 2005-2010 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) {
......
<?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) {
......
<?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);
}
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003, 2005-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 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 &&
ereg("^[0-9]+$", $nsref)) {
if (isset($guid) && ereg("^[0-9]+$", $guid)) {
preg_match('/^[0-9]+$/', $nsref)) {
if (isset($guid) && preg_match('/^[0-9]+$/', $guid)) {
$nsfile = "/tmp/$guid-$nsref.nsfile";
$id = $guid;
} else {
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# Copyright (c) 2010 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'};
}
?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment