Don't set LADISH env vars for L0 & L1
Having these variables set enables apps to discrimination against ladish, by error or otherwise. In particular neither LADISH L0 nor L1 imply that user should face mayhem of standard file menu items for either new, open, save and/or saveas being disabled.
This commit is contained in:
parent
25ab42cabe
commit
c93f0d8458
|
@ -975,11 +975,14 @@ bool ladish_app_supervisor_start_app(ladish_app_supervisor_handle supervisor_han
|
||||||
char uuid_str[37];
|
char uuid_str[37];
|
||||||
char * js_dir;
|
char * js_dir;
|
||||||
bool ret;
|
bool ret;
|
||||||
|
bool set_env_vars;
|
||||||
|
|
||||||
app_ptr->zombie = false;
|
app_ptr->zombie = false;
|
||||||
|
|
||||||
ASSERT(app_ptr->pid == 0);
|
ASSERT(app_ptr->pid == 0);
|
||||||
|
|
||||||
|
set_env_vars = ladish_level_string_to_integer(app_ptr->level) >= 2;
|
||||||
|
|
||||||
if (strcmp(app_ptr->level, LADISH_APP_LEVEL_JACKSESSION) == 0)
|
if (strcmp(app_ptr->level, LADISH_APP_LEVEL_JACKSESSION) == 0)
|
||||||
{
|
{
|
||||||
uuid_unparse(app_ptr->uuid, uuid_str);
|
uuid_unparse(app_ptr->uuid, uuid_str);
|
||||||
|
@ -1003,6 +1006,7 @@ bool ladish_app_supervisor_start_app(ladish_app_supervisor_handle supervisor_han
|
||||||
js_dir,
|
js_dir,
|
||||||
app_ptr->terminal,
|
app_ptr->terminal,
|
||||||
app_ptr->commandline,
|
app_ptr->commandline,
|
||||||
|
set_env_vars,
|
||||||
&app_ptr->pid);
|
&app_ptr->pid);
|
||||||
|
|
||||||
free(js_dir);
|
free(js_dir);
|
||||||
|
|
|
@ -271,7 +271,8 @@ loader_exec_program(
|
||||||
bool run_in_terminal,
|
bool run_in_terminal,
|
||||||
const char * vgraph_name,
|
const char * vgraph_name,
|
||||||
const char * project_name,
|
const char * project_name,
|
||||||
const char * app_name)
|
const char * app_name,
|
||||||
|
bool set_env_vars)
|
||||||
{
|
{
|
||||||
const char * argv[8];
|
const char * argv[8];
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
@ -293,12 +294,15 @@ loader_exec_program(
|
||||||
fprintf(stderr, "Could not change directory to working dir '%s' for app '%s': %s\n", working_dir, app_name, strerror(errno));
|
fprintf(stderr, "Could not change directory to working dir '%s' for app '%s': %s\n", working_dir, app_name, strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
setenv("LADISH_APP_NAME", app_name, true);
|
if (set_env_vars)
|
||||||
setenv("LADISH_VGRAPH_NAME", vgraph_name, true);
|
|
||||||
|
|
||||||
if (project_name != NULL)
|
|
||||||
{
|
{
|
||||||
setenv("LADISH_PROJECT_NAME", project_name, true);
|
setenv("LADISH_APP_NAME", app_name, true);
|
||||||
|
setenv("LADISH_VGRAPH_NAME", vgraph_name, true);
|
||||||
|
|
||||||
|
if (project_name != NULL)
|
||||||
|
{
|
||||||
|
setenv("LADISH_PROJECT_NAME", project_name, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session_dir != NULL)
|
if (session_dir != NULL)
|
||||||
|
@ -531,6 +535,7 @@ loader_execute(
|
||||||
const char * session_dir,
|
const char * session_dir,
|
||||||
bool run_in_terminal,
|
bool run_in_terminal,
|
||||||
const char * commandline,
|
const char * commandline,
|
||||||
|
bool set_env_vars,
|
||||||
pid_t * pid_ptr)
|
pid_t * pid_ptr)
|
||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
@ -642,7 +647,7 @@ loader_execute(
|
||||||
|
|
||||||
set_ldpreload();
|
set_ldpreload();
|
||||||
|
|
||||||
loader_exec_program(commandline, working_dir, session_dir, run_in_terminal, vgraph_name, project_name, app_name);
|
loader_exec_program(commandline, working_dir, session_dir, run_in_terminal, vgraph_name, project_name, app_name, set_env_vars);
|
||||||
|
|
||||||
return false; /* We should never get here */
|
return false; /* We should never get here */
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ loader_execute(
|
||||||
const char * session_dir,
|
const char * session_dir,
|
||||||
bool run_in_terminal,
|
bool run_in_terminal,
|
||||||
const char * commandline,
|
const char * commandline,
|
||||||
|
bool set_env_vars,
|
||||||
pid_t * pid_ptr);
|
pid_t * pid_ptr);
|
||||||
|
|
||||||
void loader_run(void);
|
void loader_run(void);
|
||||||
|
|
Loading…
Reference in New Issue