Skip to content
Snippets Groups Projects
Commit e516fb95 authored by Moe Jette's avatar Moe Jette
Browse files

Updates to make security tests usable with version 0.3.

parent f59301c3
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ documents those changes that are of interest to users and admins. ...@@ -10,6 +10,7 @@ documents those changes that are of interest to users and admins.
RH EL3 under extremely heavy workload apparently due to memory RH EL3 under extremely heavy workload apparently due to memory
fragmentation fragmentation
-- Fix scheduling logic for heterogeneous processor count. -- Fix scheduling logic for heterogeneous processor count.
-- Modify security_2_2 test to function with release 0.3
* Changes in SLURM 0.3.0 * Changes in SLURM 0.3.0
======================== ========================
......
...@@ -285,6 +285,13 @@ slurm_auth_init( void ) ...@@ -285,6 +285,13 @@ slurm_auth_init( void )
goto done; goto done;
auth_type = slurm_get_auth_type(); auth_type = slurm_get_auth_type();
if (strcmp(auth_type, "auth/dummy") == 0) {
info( "warning: %s plugin selected", auth_type);
retval = SLURM_ERROR;
xfree(auth_type);
goto done;
}
g_context = slurm_auth_context_create( auth_type ); g_context = slurm_auth_context_create( auth_type );
if ( g_context == NULL ) { if ( g_context == NULL ) {
error( "cannot create a context for %s", auth_type ); error( "cannot create a context for %s", auth_type );
......
...@@ -212,6 +212,20 @@ char *slurm_get_auth_type(void) ...@@ -212,6 +212,20 @@ char *slurm_get_auth_type(void)
return auth_type; return auth_type;
} }
/* slurm_set_auth_type
* set the authentication type in slurmctld_conf object
* used for security testing purposes
* RET 0 or error code
*/
extern int slurm_set_auth_type(char *auth_type)
{
_lock_update_config();
xfree(slurmctld_conf.authtype);
slurmctld_conf.authtype = xstrdup(auth_type);
slurm_mutex_unlock(&config_lock);
return 0;
}
/* slurm_get_jobcomp_type /* slurm_get_jobcomp_type
* returns the job completion logger type from slurmctld_conf object * returns the job completion logger type from slurmctld_conf object
* RET char * - job completion type, MUST be xfreed by caller * RET char * - job completion type, MUST be xfreed by caller
......
...@@ -110,7 +110,14 @@ char *slurm_get_plugin_dir(void); ...@@ -110,7 +110,14 @@ char *slurm_get_plugin_dir(void);
* returns the authentication type from slurmctld_conf object * returns the authentication type from slurmctld_conf object
* RET char * - auth type, MUST be xfreed by caller * RET char * - auth type, MUST be xfreed by caller
*/ */
char *slurm_get_auth_type(void); extern char *slurm_get_auth_type(void);
/* slurm_set_auth_type
* set the authentication type in slurmctld_conf object
* used for security testing purposes
* RET 0 or error code
*/
extern int slurm_set_auth_type(char *auth_type);
/* slurm_get_jobcomp_type /* slurm_get_jobcomp_type
* returns the job completion logger type from slurmctld_conf object * returns the job completion logger type from slurmctld_conf object
......
...@@ -7,6 +7,11 @@ ...@@ -7,6 +7,11 @@
#include <slurm/slurm.h> #include <slurm/slurm.h>
#include <slurm/slurm_errno.h> #include <slurm/slurm_errno.h>
/* This functions are not defined in slurm/slurm.h for external use.
* They are used internal security testing only. */
extern char *slurm_get_auth_type(void);
extern int slurm_set_auth_type(char *auth_type);
typedef void * Buf; typedef void * Buf;
/* Attempt to run a job without a credential */ /* Attempt to run a job without a credential */
...@@ -21,6 +26,11 @@ main (int argc, char *argv[]) ...@@ -21,6 +26,11 @@ main (int argc, char *argv[])
job_mesg. user_id = getuid(); job_mesg. user_id = getuid();
job_mesg. min_nodes = 1; job_mesg. min_nodes = 1;
printf("Changing command's authtype from %s to ",
slurm_get_auth_type());
slurm_set_auth_type("auth/dummy");
printf("%s\n",slurm_get_auth_type());
error_code = slurm_allocate_resources_and_run ( &job_mesg , error_code = slurm_allocate_resources_and_run ( &job_mesg ,
&run_resp_msg ); &run_resp_msg );
if (error_code == SLURM_SUCCESS) { if (error_code == SLURM_SUCCESS) {
...@@ -30,12 +40,8 @@ main (int argc, char *argv[]) ...@@ -30,12 +40,8 @@ main (int argc, char *argv[])
printf ("SUCCESS!\n"); printf ("SUCCESS!\n");
printf ("The allocate request was rejected as expected.\n"); printf ("The allocate request was rejected as expected.\n");
printf ("Check SlurmctldLog for an error message.\n"); printf ("Check SlurmctldLog for an error message.\n");
printf ("Error returned from API: %s\n",
slurm_strerror(slurm_get_errno()));
exit(0); exit(0);
} }
} }
/* This version supersedes that in libslurm, so a credential is not packed */
int g_slurm_auth_pack(void * auth_cred, Buf buffer)
{
return 0;
}
...@@ -18,6 +18,7 @@ main (int argc, char *argv[]) ...@@ -18,6 +18,7 @@ main (int argc, char *argv[])
slurm_init_job_desc_msg( &job_mesg ); slurm_init_job_desc_msg( &job_mesg );
job_mesg. user_id = getuid() + 1; job_mesg. user_id = getuid() + 1;
job_mesg. min_nodes = 1; job_mesg. min_nodes = 1;
job_mesg. task_dist = SLURM_DIST_CYCLIC;
error_code = slurm_allocate_resources_and_run ( &job_mesg , error_code = slurm_allocate_resources_and_run ( &job_mesg ,
&run_resp_msg ); &run_resp_msg );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment