Sort encoded reference URI on signing widget 70/84970/2
authorsangwan.kwon <sangwan.kwon@samsung.com>
Tue, 23 Aug 2016 05:04:07 +0000 (14:04 +0900)
committersangwan.kwon <sangwan.kwon@samsung.com>
Tue, 23 Aug 2016 05:20:40 +0000 (14:20 +0900)
[Problem]
 'find' will be traversing the directory tree in the order
items are stored within the directory entries.
 However, some file systems will re-order directory entries
as part of compaction operations or when the size of the entry
needs to be expanded

[Solution]
 Feed the output through an extra sorting stage.

Change-Id: Ic121bf3f9680415506e5f7f6739382b7d83a5411
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
packaging/hash-signer.spec
tools/sign-widget.sh

index 4fc9a61..0bd70c0 100644 (file)
@@ -5,6 +5,8 @@ Release:    0
 Group:      Security/Development
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
+BuildRequires: coreutils
+BuildRequires: findutils
 BuildRequires: xmlsec1
 BuildRequires: libtzplatform-config-devel
 Requires:   xmlstarlet
index 4da17ea..f02251a 100755 (executable)
@@ -27,7 +27,7 @@ function findfiles() {
                exception="-not -name author-signature.xml"
        fi
 
-       echo  $(find . \( -type f -o -type l \) $exception -not -name 'signature*.xml' |  sed -e 's,^\.\/,,' | sed -f /usr/bin/url-encode.sed)
+       echo  $(find . \( -type f -o -type l \) $exception -not -name 'signature*.xml' | sed -e 's,^\.\/,,' | sed -f /usr/bin/url-encode.sed | sort)
 }
 
 . $(dirname $0)/realpath.sh