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-stable
Commits
5eb71585
Commit
5eb71585
authored
Aug 06, 2007
by
Leigh B. Stoller
Browse files
Fix up call to accesscheck.
parent
b483113b
Changes
1
Show whitespace changes
Inline
Side-by-side
tbsetup/libosload.pm.in
View file @
5eb71585
...
...
@@ -24,6 +24,7 @@ use libtblog;
use
Node
;
use
NodeType
;
use
Image
;
use
User
;
use
OSinfo
;
use
English
;
use
File
::
stat
;
...
...
@@ -68,6 +69,7 @@ sub osload ($$) {
my
$
mereuser
=
0
;
my
$
rowref
;
my
$
image
;
my
$
this_user
;
if
(
!defined($args->{'nodelist'})) {
tberror
"Must supply a node list!"
;
#
INTERNAL
...
...
@@ -112,16 +114,21 @@ sub osload ($$) {
#
want
.
Normal
users
can
only
change
nodes
in
experiments
in
their
#
own
projects
.
#
if
($
UID
&&
!TBAdmin($UID)) {
if
($
UID
)
{
$
this_user
=
User
->
ThisUser
();
return
-
1
if
(
!defined($this_user));
if
(
!$this_user->IsAdmin()) {
$
mereuser
=
1
;
if
(
! TBNodeAccessCheck($UID, TB_NODEACCESS_LOADIMAGE, @nodes)) {
tberror
"Not enough permission to load images on one or "
.
"more nodes!"
;
tberror
(
"Not enough permission to load images on one or "
.
"more nodes!"
);
return
-
1
;
}
}
}
if
(
defined
($
imageid
))
{
$
image
=
Image
->
Lookup
($
imageid
);
...
...
@@ -135,7 +142,7 @@ sub osload ($$) {
#
Check
permission
to
use
the
imageid
.
#
if
(
defined
($
image
)
&&
$
mereuser
&&
! $image->AccessCheck($
UID
, TB_IMAGEID_READINFO)) {
! $image->AccessCheck($
this_user
, TB_IMAGEID_READINFO)) {
tberror
"You do not have permission to load $image"
;
return
-
1
;
}
...
...
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