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
b6f22d88
Commit
b6f22d88
authored
22 years ago
by
jwindley
Browse files
Options
Downloads
Patches
Plain Diff
Move authentication arg marshaling to inside plugin wrappers
parent
3b02727d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/slurm_auth.c
+23
-11
23 additions, 11 deletions
src/common/slurm_auth.c
src/common/slurm_auth.h
+2
-13
2 additions, 13 deletions
src/common/slurm_auth.h
src/common/slurm_protocol_api.c
+2
-17
2 additions, 17 deletions
src/common/slurm_protocol_api.c
with
27 additions
and
41 deletions
src/common/slurm_auth.c
+
23
−
11
View file @
b6f22d88
...
...
@@ -198,7 +198,7 @@ slurm_auth_get_arg_desc( void )
return
auth_args
;
}
void
**
static
void
**
slurm_auth_marshal_args
(
void
*
hosts
,
int
timeout
)
{
static
int
hostlist_idx
=
-
1
;
...
...
@@ -225,12 +225,6 @@ slurm_auth_marshal_args( void *hosts, int timeout )
}
void
slurm_auth_free_args
(
void
**
argv
)
{
xfree
(
argv
);
}
slurm_auth_context_t
slurm_auth_context_create
(
const
char
*
auth_type
)
{
...
...
@@ -346,12 +340,21 @@ slurm_auth_init( void )
*/
void
*
g_slurm_auth_create
(
void
*
argv
[]
)
g_slurm_auth_create
(
void
*
hosts
,
int
timeout
)
{
void
**
argv
;
void
*
ret
;
if
(
slurm_auth_init
()
<
0
)
return
NULL
;
return
(
*
(
g_context
->
ops
.
create
))(
argv
);
if
(
(
argv
=
slurm_auth_marshal_args
(
hosts
,
timeout
)
)
==
NULL
)
{
return
NULL
;
}
ret
=
(
*
(
g_context
->
ops
.
create
))(
argv
);
xfree
(
argv
);
return
ret
;
}
int
...
...
@@ -364,12 +367,21 @@ g_slurm_auth_destroy( void *cred )
}
int
g_slurm_auth_verify
(
void
*
cred
,
void
*
argv
[]
)
g_slurm_auth_verify
(
void
*
cred
,
void
*
hosts
,
int
timeout
)
{
int
ret
;
void
**
argv
;
if
(
slurm_auth_init
()
<
0
)
return
SLURM_ERROR
;
if
(
(
argv
=
slurm_auth_marshal_args
(
hosts
,
timeout
)
)
==
NULL
)
{
return
SLURM_ERROR
;
}
return
(
*
(
g_context
->
ops
.
verify
))(
cred
,
argv
);
ret
=
(
*
(
g_context
->
ops
.
verify
))(
cred
,
argv
);
xfree
(
argv
);
return
ret
;
}
uid_t
...
...
This diff is collapsed.
Click to expand it.
src/common/slurm_auth.h
+
2
−
13
View file @
b6f22d88
...
...
@@ -95,17 +95,6 @@ enum {
*/
const
arg_desc_t
*
slurm_auth_get_arg_desc
(
void
);
/*
* Marshal the arguments into a generic argument vector according to
* the authentication argument layout.
*/
void
**
slurm_auth_marshal_args
(
void
*
hosts
,
int
timeout
);
/*
* Free an argument list created by slurm_auth_marshal_args().
*/
void
slurm_auth_free_args
(
void
**
args
);
/*
* SLURM authentication context opaque type.
*/
...
...
@@ -142,9 +131,9 @@ int slurm_auth_init( void );
/*
* Static bindings for the global authentication context.
*/
void
*
g_slurm_auth_create
(
void
*
argv
[]
);
void
*
g_slurm_auth_create
(
void
*
hosts
,
int
timeout
);
int
g_slurm_auth_destroy
(
void
*
cred
);
int
g_slurm_auth_verify
(
void
*
cred
,
void
*
argv
[]
);
int
g_slurm_auth_verify
(
void
*
cred
,
void
*
hosts
,
int
timeout
);
uid_t
g_slurm_auth_get_uid
(
void
*
cred
);
gid_t
g_slurm_auth_get_gid
(
void
*
cred
);
int
g_slurm_auth_pack
(
void
*
cred
,
Buf
buf
);
...
...
This diff is collapsed.
Click to expand it.
src/common/slurm_protocol_api.c
+
2
−
17
View file @
b6f22d88
...
...
@@ -334,7 +334,6 @@ int slurm_receive_msg(slurm_fd open_fd, slurm_msg_t * msg)
int
rc
;
void
*
auth_cred
;
Buf
buffer
;
void
**
argv
;
buftemp
=
xmalloc
(
SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE
);
if
((
rc
=
_slurm_msg_recvfrom
(
open_fd
,
buftemp
,
...
...
@@ -366,14 +365,7 @@ int slurm_receive_msg(slurm_fd open_fd, slurm_msg_t * msg)
}
/* verify credentials */
argv
=
slurm_auth_marshal_args
(
NULL
,
2
);
if
(
argv
==
NULL
)
{
(
void
)
g_slurm_auth_destroy
(
auth_cred
);
free_buf
(
buffer
);
slurm_seterrno_ret
(
SLURM_PROTOCOL_AUTHENTICATION_ERROR
);
}
rc
=
g_slurm_auth_verify
(
auth_cred
,
argv
);
slurm_auth_free_args
(
argv
);
rc
=
g_slurm_auth_verify
(
auth_cred
,
NULL
,
2
);
if
(
rc
!=
SLURM_SUCCESS
)
{
error
(
"authentication: %s "
,
g_slurm_auth_errstr
(
g_slurm_auth_errno
(
auth_cred
)
)
);
...
...
@@ -439,16 +431,9 @@ int slurm_send_node_msg(slurm_fd open_fd, slurm_msg_t * msg)
unsigned
int
msg_len
,
tmp_len
;
Buf
buffer
;
void
*
auth_cred
;
void
**
argv
;
/* initialize header */
argv
=
slurm_auth_marshal_args
(
NULL
,
1
);
if
(
argv
==
NULL
)
{
error
(
"cannot marshal arguments to create credential"
);
return
SLURM_PROTOCOL_AUTHENTICATION_ERROR
;
}
auth_cred
=
g_slurm_auth_create
(
argv
);
slurm_auth_free_args
(
argv
);
auth_cred
=
g_slurm_auth_create
(
NULL
,
2
);
if
(
auth_cred
==
NULL
)
{
error
(
"authentication: %s"
,
g_slurm_auth_errstr
(
g_slurm_auth_errno
(
NULL
)
)
);
...
...
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