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
6ce55e34
Commit
6ce55e34
authored
May 26, 2014
by
Mike Hibler
Browse files
Take care of some unchecked arguments.
parent
45e15aae
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/newnodecheckin.php
View file @
6ce55e34
<?php
#
# Copyright (c) 2003-201
3
University of Utah and the Flux Group.
# Copyright (c) 2003-201
4
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -66,16 +66,35 @@ foreach ($_GET as $key => $value) {
}
$interfaces
[
$ifacenum
][
"card"
]
=
$ifacenum
;
}
else
{
echo
"Bad interface name
$value
!"
;
echo
"Bad interface name "
.
CleanString
(
$value
)
.
", ignored!"
;
$interfaces
[
$ifacenum
][
"bad"
]
=
1
;
continue
;
}
}
else
if
(
$vartype
==
"driver"
)
{
$interfaces
[
$ifacenum
][
"type"
]
=
$value
;
if
(
preg_match
(
"/^([a-z]+)$/i"
,
$value
,
$matches
))
{
$interfaces
[
$ifacenum
][
"type"
]
=
$matches
[
1
];
}
else
{
echo
"Bad interface type "
.
CleanString
(
$value
)
.
", ignored!"
;
$interfaces
[
$ifacenum
][
"bad"
]
=
1
;
continue
;
}
}
else
{
$interfaces
[
$ifacenum
][
"mac"
]
=
$value
;
if
(
preg_match
(
"/^([0-9a-f]+)$/i"
,
$value
,
$matches
))
{
$interfaces
[
$ifacenum
][
"mac"
]
=
$matches
[
1
];
}
else
{
echo
"Bad interface MAC "
.
CleanString
(
$value
)
.
", ignored!"
;
$interfaces
[
$ifacenum
][
"bad"
]
=
1
;
continue
;
}
}
}
}
# weed out bad ones
foreach
(
$interfaces
as
$i
=>
$interface
)
{
if
(
isset
(
$interface
[
"bad"
]))
{
unset
(
$interfaces
[
$i
]);
}
}
#
# Use one of the interfaces to see if this node seems to have already checked
...
...
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