!13 4.24: sync with upstream stable-2.0.0

Merge pull request !13 from lifeng_isula/424
This commit is contained in:
openeuler-ci-bot 2020-04-24 15:47:27 +08:00 committed by Gitee
commit 0819308ca0
4 changed files with 13 additions and 20 deletions

View File

@ -1,5 +1,5 @@
%global _version 2.0.0
%global _release 20200318.003237.gitcdd4f8ab
%global _release 20200418.180709.gitaabdb4e4
Name: lcr
Version: %{_version}
Release: %{_release}

View File

@ -2550,22 +2550,6 @@ static int add_needed_pty_conf(struct lcr_list *conf)
return 0;
}
static int add_needed_tty_conf(struct lcr_list *conf)
{
struct lcr_list *node = create_lcr_list_node("lxc.tty.max", "4");
if (node == NULL) {
return -1;
}
lcr_list_add_tail(conf, node);
node = create_lcr_list_node("lxc.tty.dir", "lxc");
if (node == NULL) {
return -1;
}
lcr_list_add_tail(conf, node);
return 0;
}
static int add_needed_net_conf(struct lcr_list *conf)
{
struct lcr_list *node = create_lcr_list_node("lxc.net.0.type", "empty");
@ -2591,9 +2575,6 @@ struct lcr_list *get_needed_lxc_conf()
}
lcr_list_init(conf);
if (add_needed_tty_conf(conf) < 0) {
goto out_free;
}
if (add_needed_pty_conf(conf) < 0) {
goto out_free;
}

View File

@ -271,6 +271,9 @@ struct lcr_exec_request {
int64_t timeout;
const char *suffix;
bool tty;
bool open_stdin;
};
/*
* Execute process inside a container

View File

@ -571,10 +571,12 @@ static void execute_lxc_attach(const char *name, const char *path, const struct
add_array_elem(params, args_len, &i, "-P");
add_array_elem(params, args_len, &i, path);
add_array_elem(params, args_len, &i, "--clear-env");
add_array_elem(params, args_len, &i, "--quiet");
add_array_kv(params, args_len, &i, "--logfile", request->logpath);
add_array_kv(params, args_len, &i, "-l", request->loglevel);
add_array_kv(params, args_len, &i, "--in-fifo", request->console_fifos[0]);
add_array_kv(params, args_len, &i, "--out-fifo", request->console_fifos[1]);
add_array_kv(params, args_len, &i, "--err-fifo", request->console_fifos[2]);
for (j = 0; j < request->env_len; j++) {
add_array_elem(params, args_len, &i, "-v");
add_array_elem(params, args_len, &i, request->env[j]);
@ -599,6 +601,13 @@ static void execute_lxc_attach(const char *name, const char *path, const struct
add_array_kv(params, args_len, &i, "--suffix", request->suffix);
if (!request->tty) {
add_array_elem(params, args_len, &i, "--disable-pty");
}
if (request->open_stdin) {
add_array_elem(params, args_len, &i, "--open-stdin");
}
add_array_elem(params, args_len, &i, "--");
for (j = 0; j < request->args_len; j++) {
add_array_elem(params, args_len, &i, request->args[j]);