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
4c214c29
Commit
4c214c29
authored
12 years ago
by
Morris Jette
Browse files
Options
Downloads
Patches
Plain Diff
Add mechanism for testing invalid Munge credential
parent
2c1adc99
No related branches found
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
+10
-3
10 additions, 3 deletions
src/plugins/auth/munge/auth_munge.c
with
10 additions
and
3 deletions
src/plugins/auth/munge/auth_munge.c
+
10
−
3
View file @
4c214c29
...
@@ -107,8 +107,8 @@ const uint32_t plugin_version = 10;
...
@@ -107,8 +107,8 @@ const uint32_t plugin_version = 10;
const
uint32_t
min_plug_version
=
10
;
/* minimum version accepted */
const
uint32_t
min_plug_version
=
10
;
/* minimum version accepted */
static
int
plugin_errno
=
SLURM_SUCCESS
;
static
int
plugin_errno
=
SLURM_SUCCESS
;
static
int
host_list_idx
=
-
1
;
static
int
host_list_idx
=
-
1
;
static
int
bad_cred_test
=
-
1
;
enum
{
enum
{
...
@@ -154,12 +154,17 @@ static void _print_cred_info(munge_info_t *mi);
...
@@ -154,12 +154,17 @@ static void _print_cred_info(munge_info_t *mi);
static
void
_print_cred
(
munge_ctx_t
ctx
);
static
void
_print_cred
(
munge_ctx_t
ctx
);
static
int
_decode_cred
(
slurm_auth_credential_t
*
c
,
char
*
socket
);
static
int
_decode_cred
(
slurm_auth_credential_t
*
c
,
char
*
socket
);
/*
/*
* Munge plugin initialization
* Munge plugin initialization
*/
*/
int
init
(
void
)
int
init
(
void
)
{
{
char
*
fail_test_env
=
getenv
(
"SLURM_MUNGE_AUTH_FAIL_TEST"
);
if
(
fail_test_env
)
bad_cred_test
=
atoi
(
fail_test_env
);
else
bad_cred_test
=
0
;
host_list_idx
=
arg_idx_by_name
(
slurm_auth_get_arg_desc
(),
host_list_idx
=
arg_idx_by_name
(
slurm_auth_get_arg_desc
(),
ARG_HOST_LIST
);
ARG_HOST_LIST
);
if
(
host_list_idx
==
-
1
)
if
(
host_list_idx
==
-
1
)
...
@@ -240,6 +245,9 @@ slurm_auth_create( void *argv[], char *socket )
...
@@ -240,6 +245,9 @@ slurm_auth_create( void *argv[], char *socket )
xfree
(
cred
);
xfree
(
cred
);
cred
=
NULL
;
cred
=
NULL
;
plugin_errno
=
e
+
MUNGE_ERRNO_OFFSET
;
plugin_errno
=
e
+
MUNGE_ERRNO_OFFSET
;
}
else
if
((
bad_cred_test
>
0
)
&&
cred
->
m_str
)
{
int
i
=
((
int
)
time
(
NULL
))
%
strlen
(
cred
->
m_str
);
cred
->
m_str
[
i
]
++
;
/* random position in credential */
}
}
xsignal
(
SIGALRM
,
ohandler
);
xsignal
(
SIGALRM
,
ohandler
);
...
@@ -542,7 +550,6 @@ _decode_cred(slurm_auth_credential_t *c, char *socket)
...
@@ -542,7 +550,6 @@ _decode_cred(slurm_auth_credential_t *c, char *socket)
_print_cred
(
ctx
);
_print_cred
(
ctx
);
if
(
e
==
EMUNGE_CRED_REWOUND
)
if
(
e
==
EMUNGE_CRED_REWOUND
)
error
(
"Check for out of sync clocks"
);
error
(
"Check for out of sync clocks"
);
c
->
cr_errno
=
e
+
MUNGE_ERRNO_OFFSET
;
c
->
cr_errno
=
e
+
MUNGE_ERRNO_OFFSET
;
#ifdef MULTIPLE_SLURMD
#ifdef MULTIPLE_SLURMD
}
else
{
}
else
{
...
...
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