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
d82ccd11
Commit
d82ccd11
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Minor code cleanup.
parent
fadc2e97
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/credential_utils.c
+15
-9
15 additions, 9 deletions
src/common/credential_utils.c
src/common/signature_utils.c
+2
-2
2 additions, 2 deletions
src/common/signature_utils.c
with
17 additions
and
11 deletions
src/common/credential_utils.c
+
15
−
9
View file @
d82ccd11
...
...
@@ -92,7 +92,6 @@ verify_credential(slurm_ssl_key_ctx_t * ctx, slurm_job_credential_t * cred,
{
int
rc
;
time_t
now
=
time
(
NULL
);
char
this_node_name
[
MAX_NAME_LEN
];
int
length
;
Buf
buffer
;
...
...
@@ -104,21 +103,28 @@ verify_credential(slurm_ssl_key_ctx_t * ctx, slurm_job_credential_t * cred,
cred
->
signature
,
SLURM_SSL_SIGNATURE_LENGTH
);
free_buf
(
buffer
);
if
(
rc
)
if
(
rc
)
{
error
(
"Invalid credential submitted"
);
slurm_seterrno_ret
(
ESLURMD_INVALID_JOB_CREDENTIAL
);
}
if
(
cred
->
expiration_time
<
now
)
if
(
cred
->
expiration_time
<
now
)
{
error
(
"credential has expired expiration=%lx now=%lx"
,
(
long
)
cred
->
expiration_time
,
(
long
)
now
);
slurm_seterrno_ret
(
ESLURMD_CREDENTIAL_EXPIRED
);
}
#if WE_WANT_TO_CONFIRM_NODELIST_IN_CREDENTIAL
/* FIXME:XXX: if so desired */
char
this_node_name
[
MAX_NAME_LEN
];
if
((
rc
=
getnodename
(
this_node_name
,
MAX_NAME_LEN
)))
fatal
(
"slurmd: getnodename: %m"
);
/* XXX: Fix this I suppose?
if
(
verify_node_name_list
(
this_node_name
,
credential
->
node_list
)
)
slurm_seterrno_ret
(
ESLURMD_NODE_NAME_NOT_PRESENT_IN_CREDENTIAL
);
*/
#endif
/* XXX:
* need code to check to make sure that only the specified
...
...
@@ -140,12 +146,12 @@ void print_credential(slurm_job_credential_t * cred)
for
(
i
=
0
;
i
<
SLURM_SSL_SIGNATURE_LENGTH
;
i
+=
sizeof
(
long
))
{
memcpy
(
&
long_tmp
,
&
cred
->
signature
[
i
],
sizeof
(
long
));
sprintf
(
&
sig_str
[(
j
++
)
*
9
],
"%8lx
"
,
long_tmp
);
sprintf
(
&
sig_str
[(
j
++
)
*
9
],
"%8lx "
,
long_tmp
);
}
info
(
"cred uid:%u job_id:%u time:%lx"
,
cred
->
user_id
,
cred
->
job_id
,
(
long
)
cred
->
expiration_time
);
info
(
"cred signature:%s"
,
sig_str
);
info
(
"cred uid:%u job_id:%u time:%lx"
,
cred
->
user_id
,
cred
->
job_id
,
(
long
)
cred
->
expiration_time
);
info
(
"cred signature:%s"
,
sig_str
);
}
int
revoke_credential
(
revoke_credential_msg_t
*
msg
,
List
list
)
...
...
This diff is collapsed.
Click to expand it.
src/common/signature_utils.c
+
2
−
2
View file @
d82ccd11
...
...
@@ -35,7 +35,7 @@ int slurm_init_signer(slurm_ssl_key_ctx_t * ctx, char *path)
FILE
*
key_file
;
if
((
key_file
=
fopen
(
path
,
"r"
))
==
NULL
)
{
local_errno
=
errno
;
error
(
"can't open key file '%s' : %m"
,
fatal
(
"can't open key file '%s' : %m"
,
path
);
return
SLURM_ERROR
;
};
...
...
@@ -57,7 +57,7 @@ int slurm_init_verifier(slurm_ssl_key_ctx_t * ctx, char *path)
FILE
*
cert_file
;
if
((
cert_file
=
fopen
(
path
,
"r"
))
==
NULL
)
{
local_errno
=
errno
;
error
(
"can't open certificate file '%s' : %m "
,
path
);
fatal
(
"can't open certificate file '%s' : %m "
,
path
);
return
SLURM_ERROR
;
};
...
...
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