From a267379b76950cdfdfd3d60c419d3622de204c2a Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 28 Apr 2020 14:48:02 +0900 Subject: [PATCH] [PATCH] Fix "-d \" option wasn't recognized issue. Change-Id: Iab0885919a27c599361fc065ca46db510e1d58c2 Signed-off-by: DongHun Kwak --- ...d-option-is-able-to-accept-root-directory.patch | 62 ++++++++++++++++++++++ packaging/unzip.spec | 2 + 2 files changed, 64 insertions(+) create mode 100644 packaging/0001-d-option-is-able-to-accept-root-directory.patch diff --git a/packaging/0001-d-option-is-able-to-accept-root-directory.patch b/packaging/0001-d-option-is-able-to-accept-root-directory.patch new file mode 100644 index 0000000..379b344 --- /dev/null +++ b/packaging/0001-d-option-is-able-to-accept-root-directory.patch @@ -0,0 +1,62 @@ +From 9110dd84f88cc0d56137ec4a04ba627f7d1d3ba4 Mon Sep 17 00:00:00 2001 +From: Jinwoo Nam +Date: Tue, 28 Apr 2020 12:09:57 +0900 +Subject: [PATCH] -d option is able to accept root directory, / + +[Model] wearable +[BinType] AP +[Customer] N/A + +[Issue#] N/A +[Request] N/A +[Occurrence Version] N/A + +[Problem] +[Cause & Measure] +[Checking Method] N/A + +[Team] Security Team +[Developer] Jinwoo Nam +[Solution company] Samsung +[Change Type] N/A +--- + unix/unix.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/unix/unix.c b/unix/unix.c +index bc6dad4..5872544 100644 +--- a/unix/unix.c ++++ b/unix/unix.c +@@ -1113,18 +1113,18 @@ int checkdir(__G__ pathcomp, flag) + *(slash++) = '/'; /* Restore the NUL'd slash. */ + } + } /* while (Path segments.) */ +- tmproot[ G.rootlen++] = '/'; /* Append slash. */ +- tmproot[ G.rootlen] = '\0'; /* NUL terminate. */ +- /* Right-size the rootpath storage. */ +- if ((G.rootpath = +- (char *)izu_realloc( tmproot, (G.rootlen+ 1))) == NULL) +- { +- izu_free( tmproot); +- G.rootlen = 0; +- return MPN_NOMEM; +- } +- Trace((stderr, "rootpath now = [%s]\n", FnFilter1( G.rootpath))); + } ++ tmproot[ G.rootlen++] = '/'; /* Append slash. */ ++ tmproot[ G.rootlen] = '\0'; /* NUL terminate. */ ++ /* Right-size the rootpath storage. */ ++ if ((G.rootpath = ++ (char *)izu_realloc( tmproot, (G.rootlen+ 1))) == NULL) ++ { ++ izu_free( tmproot); ++ G.rootlen = 0; ++ return MPN_NOMEM; ++ } ++ Trace((stderr, "rootpath now = [%s]\n", FnFilter1( G.rootpath))); + return MPN_OK; + } + #endif /* !SFX || SFX_EXDIR */ +-- +2.17.1 + diff --git a/packaging/unzip.spec b/packaging/unzip.spec index aa2efef..7c3aca9 100644 --- a/packaging/unzip.spec +++ b/packaging/unzip.spec @@ -6,6 +6,7 @@ Summary: A utility for unpacking zip files Url: http://www.info-zip.org/pub/infozip/UnZip.html Group: Applications/Archiving Source: unzip%{version}.tar.gz +Source1: 0001-d-option-is-able-to-accept-root-directory.patch Source1001: unzip.manifest %description @@ -22,6 +23,7 @@ a zip archive. %prep %setup -q -n %{name}%{version} cp %{SOURCE1001} . +%{__patch} -p1 < %{SOURCE1} ln -s unix/Makefile Makefile %build -- 2.7.4