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
e118d7cd
Commit
e118d7cd
authored
22 years ago
by
Mark Grondona
Browse files
Options
Downloads
Patches
Plain Diff
o print expired credential list on one line, instead of one-per-line.
parent
445938fb
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/common/credential_utils.c
+33
-1
33 additions, 1 deletion
src/common/credential_utils.c
with
33 additions
and
1 deletion
src/common/credential_utils.c
+
33
−
1
View file @
e118d7cd
...
@@ -209,23 +209,55 @@ clear_expired_credentials(List l)
...
@@ -209,23 +209,55 @@ clear_expired_credentials(List l)
_clear_expired_revoked_credentials
(
l
);
_clear_expired_revoked_credentials
(
l
);
}
}
/*
* This function is not thread-safe. However, it should only
* be used from _clear_expired_revoked_credentials(), below,
* which is only called from a single thread.
*/
static
char
*
_cred_string
(
uint32_t
jobid
)
{
static
char
buf
[
256
];
snprintf
(
buf
,
sizeof
(
buf
),
"job%d"
,
jobid
);
return
buf
;
}
static
void
_print_expired_list
(
hostlist_t
hl
)
{
char
buf
[
1024
];
xassert
(
hl
!=
NULL
);
if
(
!
hostlist_count
(
hl
))
return
;
hostlist_ranged_string
(
hl
,
sizeof
(
buf
),
buf
);
debug2
(
"expired credentials for: %s"
,
buf
);
}
static
int
static
int
_clear_expired_revoked_credentials
(
List
list
)
_clear_expired_revoked_credentials
(
List
list
)
{
{
time_t
now
=
time
(
NULL
);
time_t
now
=
time
(
NULL
);
ListIterator
iterator
;
ListIterator
iterator
;
credential_state_t
*
s
;
credential_state_t
*
s
;
hostlist_t
hl
=
hostlist_create
(
NULL
);
debug2
(
"clearing expired credentials"
);
debug2
(
"clearing expired credentials"
);
iterator
=
list_iterator_create
(
list
);
iterator
=
list_iterator_create
(
list
);
while
((
s
=
list_next
(
iterator
)))
{
while
((
s
=
list_next
(
iterator
)))
{
if
(
now
>
(
s
->
expiration
+
EXPIRATION_WINDOW
)
)
{
if
(
now
>
(
s
->
expiration
+
EXPIRATION_WINDOW
)
)
{
debug2
(
"expiring credential for job %d"
,
s
->
job_id
);
hostlist_push
(
hl
,
_cred_string
(
s
->
job_id
)
)
;
list_delete
(
iterator
);
list_delete
(
iterator
);
}
}
}
}
list_iterator_destroy
(
iterator
);
list_iterator_destroy
(
iterator
);
_print_expired_list
(
hl
);
hostlist_destroy
(
hl
);
return
SLURM_SUCCESS
;
return
SLURM_SUCCESS
;
}
}
...
...
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