diff --git a/0064-fix-mixed-use-of-signed-and-unsigned-type.patch b/0064-fix-mixed-use-of-signed-and-unsigned-type.patch new file mode 100644 index 0000000000000000000000000000000000000000..8d0f971c5c054e9fca814a304e4ff7430b33a7e7 --- /dev/null +++ b/0064-fix-mixed-use-of-signed-and-unsigned-type.patch @@ -0,0 +1,51 @@ +From 361e3fef68c24b99ed17f8cddc67d184920293ed Mon Sep 17 00:00:00 2001 +From: "Neil.wrz" +Date: Sun, 23 Apr 2023 19:45:14 -0700 +Subject: [PATCH] fix mixed use of signed and unsigned type + +Signed-off-by: Neil.wrz +--- + src/lxc/path.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/lxc/path.c b/src/lxc/path.c +index 46256cb..c0529b7 100644 +--- a/src/lxc/path.c ++++ b/src/lxc/path.c +@@ -101,7 +101,7 @@ bool filepath_split(const char *path, char **dir, char **base) + ERROR("Invalid path"); + return false; + } +- i = len - 1; ++ i = (ssize_t)(len - 1); + while (i >= 0 && path[i] != '/') + i--; + +@@ -326,7 +326,7 @@ static int do_get_symlinks(const char **fullpath, const char *prefix, size_t pre + } + + len = strlen(*end); +- if (len >= PATH_MAX - n) { ++ if (len >= (size_t)(PATH_MAX - n)) { + ERROR("Path is too long"); + goto out; + } +@@ -619,7 +619,7 @@ char *path_relative(const char *basepath, const char *targpath) + + if (b0 != bl) { + // Base elements left. Must go up before going down. +- int seps = 0, i; ++ size_t seps = 0, i; + size_t ncopyed = 0, seps_size; + char *buf = NULL; + +@@ -652,4 +652,4 @@ char *path_relative(const char *basepath, const char *targpath) + } + + return safe_strdup(targ + t0); +-} +\ No newline at end of file ++} +-- +2.25.1 + diff --git a/lxc.spec b/lxc.spec index 3b22a64800518f9024ca839433bb1645efcb26c5..15a452ceacaea1ff689798e15f6afc2681582eb4 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2022102415 +%global _release 2022102416 Name: lxc Version: 4.0.3 @@ -71,6 +71,7 @@ Patch0060: 0060-check-yajl-only-when-have-isulad.patch Patch0061: 0061-fix-ops-hierarchies-cause-coredump.patch Patch0062: 0062-use-ocihooks-env-after-getenv.patch Patch0063: 0063-fix-lxc-attach-stuck-when-disable-isulad.patch +Patch0064: 0064-fix-mixed-use-of-signed-and-unsigned-type.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -251,6 +252,12 @@ make check %endif %changelog +* Mon Apr 24 2023 wangrunze - 4.0.3-2022102416 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix mixed use of signed and unsigned type + * Tue Apr 18 2023 wangrunze - 4.0.3-2022102415 - Type:bugfix - ID:NA