We want uid/gid support at the individual application level. Ensure the values get initialized and packed/unpacked for transfer.
This commit was SVN r24489.
This commit is contained in:
parent
18307a8b43
commit
d764e7a398
@ -165,6 +165,9 @@ int orte_dt_copy_app_context(orte_app_context_t **dest, orte_app_context_t *src,
|
||||
}
|
||||
(*dest)->user_specified_cwd = src->user_specified_cwd;
|
||||
|
||||
(*dest)->uid = src->uid;
|
||||
(*dest)->gid = src->gid;
|
||||
|
||||
if (NULL != src->hostfile) {
|
||||
(*dest)->hostfile = strdup(src->hostfile);
|
||||
}
|
||||
|
@ -756,6 +756,17 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* pack the uid and gid */
|
||||
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
|
||||
(void*)(&(app_context[i]->uid)), 1, OPAL_INT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
|
||||
(void*)(&(app_context[i]->gid)), 1, OPAL_INT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if OPAL_ENABLE_FT_CR == 1
|
||||
/* Pack the preload_files_src_dir if we have one */
|
||||
|
@ -528,8 +528,10 @@ int orte_dt_print_app_context(char **output, char *prefix, orte_app_context_t *s
|
||||
asprintf(&pfx2, "%s", prefix);
|
||||
}
|
||||
|
||||
asprintf(&tmp, "\n%sData for app_context: name: %s\t index %lu\tapp: %s\n%s\tNum procs: %lu\tMax Restarts: %d",
|
||||
pfx2, (NULL == src->name) ? "NULL" : src->name, (unsigned long)src->idx, (NULL == src->app) ? "NULL" : src->app,
|
||||
asprintf(&tmp, "\n%sData for app_context: name: %s\t index %lu\tuid: %d\tgid: %d\tapp: %s\n%s\tNum procs: %lu\tMax Restarts: %d",
|
||||
pfx2, (NULL == src->name) ? "NULL" : src->name,
|
||||
(unsigned long)src->idx, src->uid, src->gid,
|
||||
(NULL == src->app) ? "NULL" : src->app,
|
||||
pfx2, (unsigned long)src->num_procs, src->max_restarts);
|
||||
|
||||
count = opal_argv_count(src->argv);
|
||||
|
@ -833,6 +833,20 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* unpack the uid and gid */
|
||||
max_n=1;
|
||||
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->uid,
|
||||
&max_n, OPAL_INT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
max_n=1;
|
||||
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->gid,
|
||||
&max_n, OPAL_INT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
#if OPAL_ENABLE_FT_CR == 1
|
||||
/* Unpack the sstore_load */
|
||||
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &have_preload_files_dest_dir,
|
||||
|
@ -560,6 +560,10 @@ static void orte_app_context_construct(orte_app_context_t* app_context)
|
||||
app_context->preload_files_dest_dir = NULL;
|
||||
app_context->preload_files_src_dir = NULL;
|
||||
app_context->used_on_node = false;
|
||||
/* set to invalid value */
|
||||
app_context->gid = -1;
|
||||
app_context->uid = -1;
|
||||
|
||||
#if OPAL_ENABLE_FT_CR == 1
|
||||
app_context->sstore_load = NULL;
|
||||
#endif
|
||||
|
@ -223,6 +223,10 @@ typedef struct {
|
||||
char *preload_files_src_dir;
|
||||
/* is being used on the local node */
|
||||
bool used_on_node;
|
||||
/* uid under which to run the app */
|
||||
int32_t uid;
|
||||
/* gid under which to run the app */
|
||||
int32_t gid;
|
||||
#if OPAL_ENABLE_FT_CR == 1
|
||||
/** What files SStore should load before local launch, if any */
|
||||
char *sstore_load;
|
||||
@ -426,10 +430,6 @@ typedef struct {
|
||||
struct timeval launch_msg_sent;
|
||||
/* max time for launch msg to be received */
|
||||
struct timeval max_launch_msg_recvd;
|
||||
/* uid under which to run the job */
|
||||
int32_t uid;
|
||||
/* gid under which to run the job */
|
||||
int32_t gid;
|
||||
#if OPAL_ENABLE_FT_CR == 1
|
||||
/* ckpt state */
|
||||
size_t ckpt_state;
|
||||
|
Loading…
x
Reference in New Issue
Block a user