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

Treat output from slurm_auth_uid as uid_t rather than int (as originally defined).

parent 4c109b57
No related branches found
No related tags found
No related merge requests found
...@@ -768,7 +768,7 @@ slurm_rpc_job_step_cancel ( slurm_msg_t * msg ) ...@@ -768,7 +768,7 @@ slurm_rpc_job_step_cancel ( slurm_msg_t * msg )
job_step_id_msg_t * job_step_id_msg = ( job_step_id_msg_t * ) msg-> data ; job_step_id_msg_t * job_step_id_msg = ( job_step_id_msg_t * ) msg-> data ;
/* Locks: Write job, write node */ /* Locks: Write job, write node */
slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, WRITE_LOCK, NO_LOCK }; slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, WRITE_LOCK, NO_LOCK };
int uid = 0; uid_t uid = 0;
start_time = clock (); start_time = clock ();
debug ("Processing RPC: REQUEST_CANCEL_JOB_STEP"); debug ("Processing RPC: REQUEST_CANCEL_JOB_STEP");
...@@ -838,7 +838,7 @@ slurm_rpc_job_step_complete ( slurm_msg_t * msg ) ...@@ -838,7 +838,7 @@ slurm_rpc_job_step_complete ( slurm_msg_t * msg )
job_step_id_msg_t * job_step_id_msg = ( job_step_id_msg_t * ) msg-> data ; job_step_id_msg_t * job_step_id_msg = ( job_step_id_msg_t * ) msg-> data ;
/* Locks: Write job, write node */ /* Locks: Write job, write node */
slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, WRITE_LOCK, NO_LOCK }; slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, WRITE_LOCK, NO_LOCK };
int uid = 0; uid_t uid = 0;
/* init */ /* init */
start_time = clock (); start_time = clock ();
...@@ -954,7 +954,7 @@ slurm_rpc_update_job ( slurm_msg_t * msg ) ...@@ -954,7 +954,7 @@ slurm_rpc_update_job ( slurm_msg_t * msg )
job_desc_msg_t * job_desc_msg = ( job_desc_msg_t * ) msg-> data ; job_desc_msg_t * job_desc_msg = ( job_desc_msg_t * ) msg-> data ;
/* Locks: Write job, read node, read partition */ /* Locks: Write job, read node, read partition */
slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, READ_LOCK, READ_LOCK }; slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, READ_LOCK, READ_LOCK };
int uid = 0; uid_t uid = 0;
start_time = clock (); start_time = clock ();
debug ("Processing RPC: REQUEST_UPDATE_JOB"); debug ("Processing RPC: REQUEST_UPDATE_JOB");
...@@ -998,7 +998,7 @@ slurm_rpc_update_node ( slurm_msg_t * msg ) ...@@ -998,7 +998,7 @@ slurm_rpc_update_node ( slurm_msg_t * msg )
/* Locks: Write node */ /* Locks: Write node */
slurmctld_lock_t node_write_lock = { NO_LOCK, NO_LOCK, WRITE_LOCK, NO_LOCK }; slurmctld_lock_t node_write_lock = { NO_LOCK, NO_LOCK, WRITE_LOCK, NO_LOCK };
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
#endif #endif
start_time = clock (); start_time = clock ();
...@@ -1007,7 +1007,7 @@ slurm_rpc_update_node ( slurm_msg_t * msg ) ...@@ -1007,7 +1007,7 @@ slurm_rpc_update_node ( slurm_msg_t * msg )
uid = slurm_auth_uid (msg->cred); uid = slurm_auth_uid (msg->cred);
if (uid != 0) { if (uid != 0) {
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
error ("Security violation, UPDATE_NODE RPC from uid %d", uid); error ("Security violation, UPDATE_NODE RPC from uid %u", (unsigned int) uid);
} }
#endif #endif
...@@ -1052,7 +1052,7 @@ slurm_rpc_update_partition ( slurm_msg_t * msg ) ...@@ -1052,7 +1052,7 @@ slurm_rpc_update_partition ( slurm_msg_t * msg )
/* Locks: Read node, write partition */ /* Locks: Read node, write partition */
slurmctld_lock_t part_write_lock = { NO_LOCK, NO_LOCK, READ_LOCK, WRITE_LOCK }; slurmctld_lock_t part_write_lock = { NO_LOCK, NO_LOCK, READ_LOCK, WRITE_LOCK };
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
#endif #endif
start_time = clock (); start_time = clock ();
...@@ -1061,7 +1061,7 @@ slurm_rpc_update_partition ( slurm_msg_t * msg ) ...@@ -1061,7 +1061,7 @@ slurm_rpc_update_partition ( slurm_msg_t * msg )
uid = slurm_auth_uid (msg->cred); uid = slurm_auth_uid (msg->cred);
if (uid != 0) { if (uid != 0) {
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
error ("Security violation, UPDATE_PARTITION RPC from uid %d", uid); error ("Security violation, UPDATE_PARTITION RPC from uid %u", (unsigned int) uid);
} }
#endif #endif
...@@ -1106,7 +1106,7 @@ slurm_rpc_submit_batch_job ( slurm_msg_t * msg ) ...@@ -1106,7 +1106,7 @@ slurm_rpc_submit_batch_job ( slurm_msg_t * msg )
/* Locks: Write job, read node, read partition */ /* Locks: Write job, read node, read partition */
slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, READ_LOCK, READ_LOCK }; slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, READ_LOCK, READ_LOCK };
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
#endif #endif
start_time = clock (); start_time = clock ();
...@@ -1119,7 +1119,7 @@ slurm_rpc_submit_batch_job ( slurm_msg_t * msg ) ...@@ -1119,7 +1119,7 @@ slurm_rpc_submit_batch_job ( slurm_msg_t * msg )
if ((uid != job_desc_msg->user_id) && if ((uid != job_desc_msg->user_id) &&
(uid != 0)) { (uid != 0)) {
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
error ("Security violation, SUBMIT_JOB from uid %d", uid); error ("Security violation, SUBMIT_JOB from uid %u", (unsigned int) uid);
} }
#endif #endif
if (error_code == 0) { if (error_code == 0) {
...@@ -1168,7 +1168,7 @@ slurm_rpc_allocate_resources ( slurm_msg_t * msg , uint8_t immediate ) ...@@ -1168,7 +1168,7 @@ slurm_rpc_allocate_resources ( slurm_msg_t * msg , uint8_t immediate )
/* Locks: Write job, write node, read partition */ /* Locks: Write job, write node, read partition */
slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, WRITE_LOCK, READ_LOCK }; slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, WRITE_LOCK, READ_LOCK };
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
#endif #endif
start_time = clock (); start_time = clock ();
...@@ -1184,7 +1184,7 @@ slurm_rpc_allocate_resources ( slurm_msg_t * msg , uint8_t immediate ) ...@@ -1184,7 +1184,7 @@ slurm_rpc_allocate_resources ( slurm_msg_t * msg , uint8_t immediate )
if ((uid != job_desc_msg->user_id) && if ((uid != job_desc_msg->user_id) &&
(uid != 0)) { (uid != 0)) {
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
error ("Security violation, RESOURCE_ALLOCATE from uid %d", uid); error ("Security violation, RESOURCE_ALLOCATE from uid %u", (unsigned int) uid);
} }
#endif #endif
if (error_code == 0) { if (error_code == 0) {
...@@ -1244,7 +1244,7 @@ slurm_rpc_allocate_and_run ( slurm_msg_t * msg ) ...@@ -1244,7 +1244,7 @@ slurm_rpc_allocate_and_run ( slurm_msg_t * msg )
/* Locks: Write job, write node, read partition */ /* Locks: Write job, write node, read partition */
slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, WRITE_LOCK, READ_LOCK }; slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, WRITE_LOCK, READ_LOCK };
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
#endif #endif
start_time = clock (); start_time = clock ();
debug ("Processing RPC: REQUEST_ALLOCATE_AND_RUN_JOB_STEP"); debug ("Processing RPC: REQUEST_ALLOCATE_AND_RUN_JOB_STEP");
...@@ -1256,7 +1256,7 @@ slurm_rpc_allocate_and_run ( slurm_msg_t * msg ) ...@@ -1256,7 +1256,7 @@ slurm_rpc_allocate_and_run ( slurm_msg_t * msg )
if ((uid != job_desc_msg->user_id) && if ((uid != job_desc_msg->user_id) &&
(uid != 0)) { (uid != 0)) {
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
error ("Security violation, ALLOCATE_AND_RUN RPC from uid %d", uid); error ("Security violation, ALLOCATE_AND_RUN RPC from uid %u", (unsigned int) uid);
} }
#endif #endif
if (error_code == 0) { if (error_code == 0) {
...@@ -1326,7 +1326,7 @@ void slurm_rpc_job_will_run ( slurm_msg_t * msg ) ...@@ -1326,7 +1326,7 @@ void slurm_rpc_job_will_run ( slurm_msg_t * msg )
/* Locks: Write job, read node, read partition */ /* Locks: Write job, read node, read partition */
slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, READ_LOCK, READ_LOCK }; slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, READ_LOCK, READ_LOCK };
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
#endif #endif
start_time = clock (); start_time = clock ();
...@@ -1339,7 +1339,7 @@ void slurm_rpc_job_will_run ( slurm_msg_t * msg ) ...@@ -1339,7 +1339,7 @@ void slurm_rpc_job_will_run ( slurm_msg_t * msg )
if ((uid != job_desc_msg->user_id) && if ((uid != job_desc_msg->user_id) &&
(uid != 0)) { (uid != 0)) {
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
error ("Security violation, JOB_WILL_RUN RPC from uid %d", uid); error ("Security violation, JOB_WILL_RUN RPC from uid %u", (unsigned int) uid);
} }
#endif #endif
...@@ -1375,7 +1375,7 @@ slurm_rpc_reconfigure_controller ( slurm_msg_t * msg ) ...@@ -1375,7 +1375,7 @@ slurm_rpc_reconfigure_controller ( slurm_msg_t * msg )
/* Locks: Write configuration, write job, write node, write partition */ /* Locks: Write configuration, write job, write node, write partition */
slurmctld_lock_t config_write_lock = { WRITE_LOCK, WRITE_LOCK, WRITE_LOCK, WRITE_LOCK }; slurmctld_lock_t config_write_lock = { WRITE_LOCK, WRITE_LOCK, WRITE_LOCK, WRITE_LOCK };
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
#endif #endif
start_time = clock (); start_time = clock ();
...@@ -1383,7 +1383,7 @@ slurm_rpc_reconfigure_controller ( slurm_msg_t * msg ) ...@@ -1383,7 +1383,7 @@ slurm_rpc_reconfigure_controller ( slurm_msg_t * msg )
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
uid = slurm_auth_uid (msg->cred); uid = slurm_auth_uid (msg->cred);
if (uid != 0) { if (uid != 0) {
error ("Security violation, RECONFIGURE RPC from uid %d", uid); error ("Security violation, RECONFIGURE RPC from uid %u", (unsigned int) uid);
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
} }
#endif #endif
...@@ -1427,7 +1427,7 @@ slurm_rpc_shutdown_controller ( slurm_msg_t * msg ) ...@@ -1427,7 +1427,7 @@ slurm_rpc_shutdown_controller ( slurm_msg_t * msg )
int error_code = 0; int error_code = 0;
shutdown_msg_t * shutdown_msg = (shutdown_msg_t *) msg->data; shutdown_msg_t * shutdown_msg = (shutdown_msg_t *) msg->data;
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
#endif #endif
/* do RPC call */ /* do RPC call */
...@@ -1435,7 +1435,7 @@ slurm_rpc_shutdown_controller ( slurm_msg_t * msg ) ...@@ -1435,7 +1435,7 @@ slurm_rpc_shutdown_controller ( slurm_msg_t * msg )
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
uid = slurm_auth_uid (msg->cred); uid = slurm_auth_uid (msg->cred);
if (uid != 0) { if (uid != 0) {
error ("Security violation, SHUTDOWN RPC from uid %d", uid); error ("Security violation, SHUTDOWN RPC from uid %u", (unsigned int) uid);
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
} }
#endif #endif
...@@ -1468,11 +1468,11 @@ slurm_rpc_shutdown_controller_immediate ( slurm_msg_t * msg ) ...@@ -1468,11 +1468,11 @@ slurm_rpc_shutdown_controller_immediate ( slurm_msg_t * msg )
{ {
int error_code = 0; int error_code = 0;
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
uid = slurm_auth_uid (msg->cred); uid = slurm_auth_uid (msg->cred);
if (uid != 0) { if (uid != 0) {
error ("Security violation, SHUTDOWN_IMMEDIATE RPC from uid %d", uid); error ("Security violation, SHUTDOWN_IMMEDIATE RPC from uid %u", (unsigned int) uid);
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
} }
#endif #endif
...@@ -1498,7 +1498,7 @@ slurm_rpc_job_step_create( slurm_msg_t* msg ) ...@@ -1498,7 +1498,7 @@ slurm_rpc_job_step_create( slurm_msg_t* msg )
/* Locks: Write jobs, read nodes */ /* Locks: Write jobs, read nodes */
slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, READ_LOCK, NO_LOCK }; slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, READ_LOCK, NO_LOCK };
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
#endif #endif
start_time = clock (); start_time = clock ();
...@@ -1509,7 +1509,7 @@ slurm_rpc_job_step_create( slurm_msg_t* msg ) ...@@ -1509,7 +1509,7 @@ slurm_rpc_job_step_create( slurm_msg_t* msg )
if ((uid != req_step_msg->user_id) && if ((uid != req_step_msg->user_id) &&
(uid != 0)) { (uid != 0)) {
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
error ("Security violation, JOB_STEP_CREATE RPC from uid %d", uid); error ("Security violation, JOB_STEP_CREATE RPC from uid %u", (unsigned int) uid);
} }
#endif #endif
...@@ -1564,7 +1564,7 @@ slurm_rpc_node_registration ( slurm_msg_t * msg ) ...@@ -1564,7 +1564,7 @@ slurm_rpc_node_registration ( slurm_msg_t * msg )
/* Locks: Write node */ /* Locks: Write node */
slurmctld_lock_t node_write_lock = { NO_LOCK, NO_LOCK, WRITE_LOCK, NO_LOCK }; slurmctld_lock_t node_write_lock = { NO_LOCK, NO_LOCK, WRITE_LOCK, NO_LOCK };
#ifdef HAVE_AUTHD #ifdef HAVE_AUTHD
int uid; uid_t uid;
#endif #endif
start_time = clock (); start_time = clock ();
...@@ -1573,7 +1573,7 @@ slurm_rpc_node_registration ( slurm_msg_t * msg ) ...@@ -1573,7 +1573,7 @@ slurm_rpc_node_registration ( slurm_msg_t * msg )
uid = slurm_auth_uid (msg->cred); uid = slurm_auth_uid (msg->cred);
if (uid != 0) { if (uid != 0) {
error_code = ESLURM_USER_ID_MISSING; error_code = ESLURM_USER_ID_MISSING;
error ("Security violation, NODE_REGISTER RPC from uid %d", uid); error ("Security violation, NODE_REGISTER RPC from uid %u", (unsigned int) uid);
} }
#endif #endif
if (error_code == 0) { if (error_code == 0) {
......
...@@ -1025,7 +1025,7 @@ job_allocate (job_desc_msg_t *job_specs, uint32_t *new_job_id, char **node_list ...@@ -1025,7 +1025,7 @@ job_allocate (job_desc_msg_t *job_specs, uint32_t *new_job_id, char **node_list
* last_job_update - time of last job table update * last_job_update - time of last job table update
*/ */
int int
job_cancel (uint32_t job_id, int uid) job_cancel (uint32_t job_id, uid_t uid)
{ {
struct job_record *job_ptr; struct job_record *job_ptr;
...@@ -1080,7 +1080,7 @@ job_cancel (uint32_t job_id, int uid) ...@@ -1080,7 +1080,7 @@ job_cancel (uint32_t job_id, int uid)
* last_job_update - time of last job table update * last_job_update - time of last job table update
*/ */
int int
job_complete (uint32_t job_id, int uid) job_complete (uint32_t job_id, uid_t uid)
{ {
struct job_record *job_ptr; struct job_record *job_ptr;
...@@ -1523,7 +1523,7 @@ copy_job_desc_to_job_record ( job_desc_msg_t * job_desc , ...@@ -1523,7 +1523,7 @@ copy_job_desc_to_job_record ( job_desc_msg_t * job_desc ,
* last_job_update - time of last job table update * last_job_update - time of last job table update
*/ */
int int
job_step_cancel (uint32_t job_id, uint32_t step_id, int uid) job_step_cancel (uint32_t job_id, uint32_t step_id, uid_t uid)
{ {
struct job_record *job_ptr; struct job_record *job_ptr;
int error_code; int error_code;
...@@ -1573,7 +1573,7 @@ job_step_cancel (uint32_t job_id, uint32_t step_id, int uid) ...@@ -1573,7 +1573,7 @@ job_step_cancel (uint32_t job_id, uint32_t step_id, int uid)
* last_job_update - time of last job table update * last_job_update - time of last job table update
*/ */
int int
job_step_complete (uint32_t job_id, uint32_t step_id, int uid) job_step_complete (uint32_t job_id, uint32_t step_id, uid_t uid)
{ {
struct job_record *job_ptr; struct job_record *job_ptr;
int error_code; int error_code;
...@@ -2093,7 +2093,7 @@ top_priority (struct job_record *job_ptr) { ...@@ -2093,7 +2093,7 @@ top_priority (struct job_record *job_ptr) {
* last_job_update - time of last job table update * last_job_update - time of last job table update
*/ */
int int
update_job (job_desc_msg_t * job_specs, int uid) update_job (job_desc_msg_t * job_specs, uid_t uid)
{ {
int error_code = SLURM_SUCCESS; int error_code = SLURM_SUCCESS;
struct job_record *job_ptr; struct job_record *job_ptr;
......
...@@ -338,16 +338,16 @@ extern int job_allocate (job_desc_msg_t *job_specs, uint32_t *new_job_id, char ...@@ -338,16 +338,16 @@ extern int job_allocate (job_desc_msg_t *job_specs, uint32_t *new_job_id, char
int immediate, int will_run, int allocate); int immediate, int will_run, int allocate);
/* job_cancel - cancel the specified job */ /* job_cancel - cancel the specified job */
extern int job_cancel (uint32_t job_id, int uid); extern int job_cancel (uint32_t job_id, uid_t uid);
/* job_step_cancel - cancel the specified job step */ /* job_step_cancel - cancel the specified job step */
extern int job_step_cancel (uint32_t job_id, uint32_t job_step_id, int uid ); extern int job_step_cancel (uint32_t job_id, uint32_t job_step_id, uid_t uid );
/* job_complete - note the completion the specified job */ /* job_complete - note the completion the specified job */
extern int job_complete (uint32_t job_id, int uid); extern int job_complete (uint32_t job_id, uid_t uid);
/* job_step_complete - note the completion the specified job step*/ /* job_step_complete - note the completion the specified job step*/
extern int job_step_complete (uint32_t job_id, uint32_t job_step_id, int uid); extern int job_step_complete (uint32_t job_id, uint32_t job_step_id, uid_t uid);
/* job_create - create a job table record for the supplied specifications */ /* job_create - create a job table record for the supplied specifications */
extern int job_create (job_desc_msg_t * job_specs, uint32_t *new_job_id, int allocate, extern int job_create (job_desc_msg_t * job_specs, uint32_t *new_job_id, int allocate,
...@@ -490,7 +490,7 @@ extern void step_unlock (void); ...@@ -490,7 +490,7 @@ extern void step_unlock (void);
extern int sync_nodes_to_jobs (void); extern int sync_nodes_to_jobs (void);
/* update_job - update a job's parameters per the supplied specification */ /* update_job - update a job's parameters per the supplied specification */
extern int update_job (job_desc_msg_t * job_specs, int uid); extern int update_job (job_desc_msg_t * job_specs, uid_t uid);
/* update_node - update the configuration data for one or more nodes per the supplied specification */ /* update_node - update the configuration data for one or more nodes per the supplied specification */
extern int update_node ( update_node_msg_t * update_node_msg ) ; extern int update_node ( update_node_msg_t * update_node_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