diff --git a/0022-print-error-message-if-process-workdir-failed.patch b/0022-print-error-message-if-process-workdir-failed.patch new file mode 100644 index 0000000000000000000000000000000000000000..8b759671da96f1b56b15d9bf782290533e4b29e9 --- /dev/null +++ b/0022-print-error-message-if-process-workdir-failed.patch @@ -0,0 +1,32 @@ +From 540981ef79b921fea26e24456fbecc648eaf6e9e Mon Sep 17 00:00:00 2001 +From: WangFengTu +Date: Sat, 8 May 2021 11:02:08 +0800 +Subject: [PATCH] print error message if process workdir failed + +Signed-off-by: WangFengTu +--- + src/lxc/attach.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/lxc/attach.c b/src/lxc/attach.c +index 2ed2329..68f4148 100644 +--- a/src/lxc/attach.c ++++ b/src/lxc/attach.c +@@ -798,10 +798,14 @@ static int attach_child_main(struct attach_clone_payload *payload) + struct stat st; + if (stat(init_cwd, &st) < 0 && mkdir_p(init_cwd, 0750) < 0) { + SYSERROR("Try to create directory \"%s\" as workdir failed when attach", init_cwd); ++ lxc_write_error_message(msg_fd, "Try to create directory \"%s\" as workdir failed when attach: %s", ++ init_cwd, strerror(errno)); + goto on_error; + } + if (chdir(init_cwd)) { + SYSERROR("Could not change directory to \"%s\" when attach", init_cwd); ++ lxc_write_error_message(msg_fd, "Could not change directory to \"%s\" when attach: %s", ++ init_cwd, strerror(errno)); + goto on_error; + } + } +-- +2.25.1 + diff --git a/lxc.spec b/lxc.spec index 08ca4d68cf989680632c72e4541e9da5cb3a5acf..25279c2854817b45f86866f91c59eca6ad05b087 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2021040701 +%global _release 2021050801 Name: lxc Version: 4.0.3 @@ -29,6 +29,7 @@ Patch0018: 0018-IO-fix-io-data-miss-when-exec-with-pipes.patch Patch0019: 0019-metrics-add-total_inactive_file-metric-for-memory.patch Patch0020: 0020-support-cgroup-v2.patch Patch0021: 0021-support-isula-exec-workdir.patch +Patch0022: 0022-print-error-message-if-process-workdir-failed.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -200,6 +201,12 @@ make check %{_mandir}/*/man7/%{name}* %changelog +* Sat Mar 08 2021 wangfengtu - 4.0.3-2021050801 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:print error message if process workdir failed + * Wed Apr 07 2021 wangfengtu - 4.0.3-2021040701 - Type:bugfix - ID:NA diff --git a/series.conf b/series.conf index 67507bea5c9196b452d4669bfa0cf47a11125d2a..efe3aae36f50c68bfceb60c0f7373814a5a0cd8b 100644 --- a/series.conf +++ b/series.conf @@ -19,3 +19,4 @@ 0019-metrics-add-total_inactive_file-metric-for-memory.patch 0020-support-cgroup-v2.patch 0021-support-isula-exec-workdir.patch +0022-print-error-message-if-process-workdir-failed.patch