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
c48cb778
Commit
c48cb778
authored
19 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Modify munge credential unpack to not validate immediately (so it could be forwarded intact).
parent
44c9c177
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/plugins/auth/munge/auth_munge.c
+11
-15
11 additions, 15 deletions
src/plugins/auth/munge/auth_munge.c
with
11 additions
and
15 deletions
src/plugins/auth/munge/auth_munge.c
+
11
−
15
View file @
c48cb778
...
...
@@ -111,7 +111,7 @@ static munge_info_t * cred_info_create(munge_ctx_t ctx);
static
void
cred_info_destroy
(
munge_info_t
*
);
static
void
_print_cred_info
(
munge_info_t
*
mi
);
static
void
_print_cred
(
munge_ctx_t
ctx
);
static
int
_decode_cred
(
char
*
m
,
slurm_auth_credential_t
*
c
);
static
int
_decode_cred
(
slurm_auth_credential_t
*
c
);
/*
...
...
@@ -201,7 +201,8 @@ slurm_auth_destroy( slurm_auth_credential_t *cred )
/*
* Note: Munge cred not encoded with xmalloc()
*/
if
(
cred
->
m_str
)
free
(
cred
->
m_str
);
if
(
cred
->
m_str
)
free
(
cred
->
m_str
);
xfree
(
cred
);
return
SLURM_SUCCESS
;
}
...
...
@@ -224,7 +225,7 @@ slurm_auth_verify( slurm_auth_credential_t *c, void *argv )
if
(
c
->
verified
)
return
SLURM_SUCCESS
;
if
(
_decode_cred
(
c
->
m_str
,
c
)
<
0
)
if
(
_decode_cred
(
c
)
<
0
)
return
SLURM_ERROR
;
return
SLURM_SUCCESS
;
...
...
@@ -241,7 +242,7 @@ slurm_auth_get_uid( slurm_auth_credential_t *cred )
plugin_errno
=
SLURM_AUTH_BADARG
;
return
SLURM_AUTH_NOBODY
;
}
if
(
!
cred
->
verified
)
{
if
(
(
!
cred
->
verified
)
&&
(
_decode_cred
(
cred
)
<
0
))
{
cred
->
cr_errno
=
SLURM_AUTH_INVALID
;
return
SLURM_AUTH_NOBODY
;
}
...
...
@@ -262,7 +263,7 @@ slurm_auth_get_gid( slurm_auth_credential_t *cred )
plugin_errno
=
SLURM_AUTH_BADARG
;
return
SLURM_AUTH_NOBODY
;
}
if
(
!
cred
->
verified
)
{
if
(
(
!
cred
->
verified
)
&&
(
_decode_cred
(
cred
)
<
0
))
{
cred
->
cr_errno
=
SLURM_AUTH_INVALID
;
return
SLURM_AUTH_NOBODY
;
}
...
...
@@ -313,7 +314,6 @@ slurm_auth_unpack( Buf buf )
{
slurm_auth_credential_t
*
cred
;
char
*
type
;
char
*
m
;
uint16_t
size
;
uint32_t
version
;
...
...
@@ -352,14 +352,10 @@ slurm_auth_unpack( Buf buf )
xassert
(
cred
->
magic
=
MUNGE_MAGIC
);
if
(
unpack
me
m_
p
tr
(
&
m
,
&
size
,
buf
)
<
0
)
{
if
(
unpack
str_malloc
(
&
cred
->
m_
s
tr
,
&
size
,
buf
)
<
0
)
{
plugin_errno
=
SLURM_AUTH_UNPACK
;
goto
unpack_error
;
}
if
(
_decode_cred
(
m
,
cred
)
<
0
)
goto
unpack_error
;
return
cred
;
unpack_error:
...
...
@@ -424,17 +420,17 @@ slurm_auth_errstr( int slurm_errno )
/*
* Decode the munge encoded credential `m' placing results, if validated,
* Decode the munge encoded credential `m
_str
' placing results, if validated,
* into slurm credential `c'
*/
static
int
_decode_cred
(
char
*
m
,
slurm_auth_credential_t
*
c
)
_decode_cred
(
slurm_auth_credential_t
*
c
)
{
int
retry
=
2
;
munge_err_t
e
;
munge_ctx_t
ctx
;
if
(
(
c
==
NULL
)
||
(
m
==
NULL
))
if
(
c
==
NULL
)
return
SLURM_ERROR
;
xassert
(
c
->
magic
==
MUNGE_MAGIC
);
...
...
@@ -448,7 +444,7 @@ _decode_cred(char *m, slurm_auth_credential_t *c)
}
again:
if
((
e
=
munge_decode
(
m
,
ctx
,
&
c
->
buf
,
&
c
->
len
,
&
c
->
uid
,
&
c
->
gid
)))
{
if
((
e
=
munge_decode
(
c
->
m_str
,
ctx
,
&
c
->
buf
,
&
c
->
len
,
&
c
->
uid
,
&
c
->
gid
)))
{
error
(
"Munge decode failed: %s %s"
,
munge_ctx_strerror
(
ctx
),
retry
?
"(retrying ...)"
:
""
);
...
...
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