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
c4471239
Commit
c4471239
authored
22 years ago
by
jwindley
Browse files
Options
Downloads
Patches
Plain Diff
Add plugin version to pack/unpack
parent
9273da53
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/auth/auth_authd.c
+4
-1
4 additions, 1 deletion
src/plugins/auth/auth_authd.c
src/plugins/auth/auth_munge.c
+6
-1
6 additions, 1 deletion
src/plugins/auth/auth_munge.c
src/plugins/auth/auth_none.c
+3
-0
3 additions, 0 deletions
src/plugins/auth/auth_none.c
with
13 additions
and
2 deletions
src/plugins/auth/auth_authd.c
+
4
−
1
View file @
c4471239
...
@@ -288,11 +288,12 @@ slurm_auth_pack( slurm_auth_credential_t *cred, Buf buf )
...
@@ -288,11 +288,12 @@ slurm_auth_pack( slurm_auth_credential_t *cred, Buf buf )
if
(
(
cred
==
NULL
)
||
(
buf
==
NULL
)
)
return
;
if
(
(
cred
==
NULL
)
||
(
buf
==
NULL
)
)
return
;
/*
/*
* Marshall the plugin type for runtime sanity check.
* Marshall the plugin type
and version
for runtime sanity check.
* Add the terminating zero so we get it for free at the
* Add the terminating zero so we get it for free at the
* other end.
* other end.
*/
*/
packmem
(
(
char
*
)
plugin_type
,
strlen
(
plugin_type
)
+
1
,
buf
);
packmem
(
(
char
*
)
plugin_type
,
strlen
(
plugin_type
)
+
1
,
buf
);
pack32
(
plugin_version
,
buf
);
pack32
(
cred
->
cred
.
uid
,
buf
);
pack32
(
cred
->
cred
.
uid
,
buf
);
pack32
(
cred
->
cred
.
gid
,
buf
);
pack32
(
cred
->
cred
.
gid
,
buf
);
...
@@ -306,6 +307,7 @@ int
...
@@ -306,6 +307,7 @@ int
slurm_auth_unpack
(
slurm_auth_credential_t
*
cred
,
Buf
buf
)
slurm_auth_unpack
(
slurm_auth_credential_t
*
cred
,
Buf
buf
)
{
{
uint16_t
sig_size
;
/* ignored */
uint16_t
sig_size
;
/* ignored */
uint32_t
version
;
char
*
data
;
char
*
data
;
if
(
(
cred
==
NULL
)
||
(
buf
==
NULL
)
)
if
(
(
cred
==
NULL
)
||
(
buf
==
NULL
)
)
...
@@ -317,6 +319,7 @@ slurm_auth_unpack( slurm_auth_credential_t *cred, Buf buf )
...
@@ -317,6 +319,7 @@ slurm_auth_unpack( slurm_auth_credential_t *cred, Buf buf )
error
(
"authd plugin: authentication mismatch, got %s"
,
data
);
error
(
"authd plugin: authentication mismatch, got %s"
,
data
);
return
SLURM_ERROR
;
return
SLURM_ERROR
;
}
}
unpack32
(
&
version
,
buf
);
unpack32
(
&
cred
->
cred
.
uid
,
buf
);
unpack32
(
&
cred
->
cred
.
uid
,
buf
);
unpack32
(
&
cred
->
cred
.
gid
,
buf
);
unpack32
(
&
cred
->
cred
.
gid
,
buf
);
...
...
This diff is collapsed.
Click to expand it.
src/plugins/auth/auth_munge.c
+
6
−
1
View file @
c4471239
...
@@ -264,6 +264,7 @@ slurm_auth_pack( slurm_auth_credential_t *cred, Buf buf )
...
@@ -264,6 +264,7 @@ slurm_auth_pack( slurm_auth_credential_t *cred, Buf buf )
* type so that it can be sanity-checked at the receiving end.
* type so that it can be sanity-checked at the receiving end.
*/
*/
packstr
(
(
char
*
)
plugin_type
,
buf
);
packstr
(
(
char
*
)
plugin_type
,
buf
);
pack32
(
plugin_version
,
buf
);
/*
/*
* Pack the data.
* Pack the data.
*/
*/
...
@@ -278,8 +279,9 @@ int
...
@@ -278,8 +279,9 @@ int
slurm_auth_unpack
(
slurm_auth_credential_t
*
cred
,
Buf
buf
)
slurm_auth_unpack
(
slurm_auth_credential_t
*
cred
,
Buf
buf
)
{
{
char
*
type
;
char
*
type
;
char
*
m
;
char
*
m
;
uint16_t
size
;
uint16_t
size
;
uint32_t
version
;
if
((
cred
==
NULL
)
||
(
buf
==
NULL
))
{
if
((
cred
==
NULL
)
||
(
buf
==
NULL
))
{
error
(
"malformed slurm_auth_unpack call in auth/munge plugin"
);
error
(
"malformed slurm_auth_unpack call in auth/munge plugin"
);
...
@@ -298,6 +300,9 @@ slurm_auth_unpack( slurm_auth_credential_t *cred, Buf buf )
...
@@ -298,6 +300,9 @@ slurm_auth_unpack( slurm_auth_credential_t *cred, Buf buf )
error
(
"plugin expected 'auth/munge' and got '%s'"
,
type
);
error
(
"plugin expected 'auth/munge' and got '%s'"
,
type
);
return
SLURM_ERROR
;
return
SLURM_ERROR
;
}
}
if
(
unpack32
(
&
version
,
buf
)
!=
SLURM_SUCCESS
)
{
return
SLURM_ERROR
;
}
if
(
unpackmem_ptr
(
&
m
,
&
size
,
buf
)
<
0
)
{
if
(
unpackmem_ptr
(
&
m
,
&
size
,
buf
)
<
0
)
{
error
(
"error retrieving munge cred in auth/munge plugin"
);
error
(
"error retrieving munge cred in auth/munge plugin"
);
...
...
This diff is collapsed.
Click to expand it.
src/plugins/auth/auth_none.c
+
3
−
0
View file @
c4471239
...
@@ -237,6 +237,7 @@ slurm_auth_pack( slurm_auth_credential_t *cred, Buf buf )
...
@@ -237,6 +237,7 @@ slurm_auth_pack( slurm_auth_credential_t *cred, Buf buf )
* type so that it can be sanity-checked at the receiving end.
* type so that it can be sanity-checked at the receiving end.
*/
*/
packmem
(
(
char
*
)
plugin_type
,
strlen
(
plugin_type
)
+
1
,
buf
);
packmem
(
(
char
*
)
plugin_type
,
strlen
(
plugin_type
)
+
1
,
buf
);
pack32
(
plugin_version
,
buf
);
/*
/*
* Pack the data values.
* Pack the data values.
*/
*/
...
@@ -253,6 +254,7 @@ slurm_auth_unpack( slurm_auth_credential_t *cred, Buf buf )
...
@@ -253,6 +254,7 @@ slurm_auth_unpack( slurm_auth_credential_t *cred, Buf buf )
{
{
char
*
tmpstr
;
char
*
tmpstr
;
int32_t
tmpint
;
int32_t
tmpint
;
uint32_t
version
;
uint16_t
size
;
uint16_t
size
;
if
(
(
cred
==
NULL
)
||
(
buf
==
NULL
)
)
{
if
(
(
cred
==
NULL
)
||
(
buf
==
NULL
)
)
{
...
@@ -272,6 +274,7 @@ slurm_auth_unpack( slurm_auth_credential_t *cred, Buf buf )
...
@@ -272,6 +274,7 @@ slurm_auth_unpack( slurm_auth_credential_t *cred, Buf buf )
error
(
"plugin expected 'auth/none' and got '%s'"
,
tmpstr
);
error
(
"plugin expected 'auth/none' and got '%s'"
,
tmpstr
);
return
SLURM_ERROR
;
return
SLURM_ERROR
;
}
}
if
(
unpack32
(
&
version
,
buf
)
!=
SLURM_SUCCESS
)
return
SLURM_ERROR
;
/*
/*
* We do it the hard way because we don't know anything about the
* We do it the hard way because we don't know anything about the
...
...
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