Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
fadc2e97
Commit
fadc2e97
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Abort request from non-super user and not slurm_user on bad credential.
parent
766a7dbe
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/slurmd/req.c
+18
-8
18 additions, 8 deletions
src/slurmd/req.c
with
18 additions
and
8 deletions
src/slurmd/req.c
+
18
−
8
View file @
fadc2e97
...
...
@@ -176,24 +176,34 @@ _rpc_launch_tasks(slurm_msg_t *msg, slurm_addr *cli)
slurm_msg_t
resp_msg
;
launch_tasks_response_msg_t
resp
;
launch_tasks_request_msg_t
*
req
=
msg
->
data
;
bool
super_user
=
false
;
slurm_get_addr
(
cli
,
&
port
,
host
,
sizeof
(
host
));
req_uid
=
slurm_auth_uid
(
msg
->
cred
);
if
((
req_uid
==
conf
->
slurm_user_id
)
||
(
req_uid
==
0
))
super_user
=
true
;
if
((
super_user
==
false
)
&&
(
req_uid
!=
req
->
uid
))
{
error
(
"Security violation, launch task RCP from uid %u"
,
(
unsigned
int
)
req_uid
);
rc
=
ESLURM_USER_ID_MISSING
;
/* or invalid user */
slurm_send_rc_msg
(
msg
,
rc
);
return
;
}
info
(
"launch tasks request from %ld@%s"
,
req_uid
,
host
);
slurm_get_addr
(
cli
,
&
port
,
host
,
sizeof
(
host
));
info
(
"launch task %u.%u request from %ld@%s"
,
req
->
job_id
,
req
->
job_step_id
,
req_uid
,
host
);
rc
=
verify_credential
(
&
conf
->
vctx
,
req
->
credential
,
conf
->
cred_state_list
);
if
((
rc
==
SLURM_SUCCESS
)
&&
(
req_uid
==
req
->
uid
))
rc
=
_launch_tasks
(
req
,
cli
);
else
{
info
(
"XXX: Invalid credential from %ld@%s, launching job anyway"
,
req_uid
,
host
);
rc
=
_launch_tasks
(
req
,
cli
);
if
((
rc
!=
SLURM_SUCCESS
)
&&
(
super_user
==
false
))
{
error
(
"Invalid credential from %ld@%s"
,
req_uid
,
host
);
slurm_send_rc_msg
(
msg
,
rc
);
return
;
}
rc
=
_launch_tasks
(
req
,
cli
);
memcpy
(
&
resp_msg
.
address
,
cli
,
sizeof
(
slurm_addr
));
slurm_set_addr
(
&
resp_msg
.
address
,
req
->
resp_port
,
NULL
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment