Hello community,

here is the log from the commit of package shim for openSUSE:Factory checked in 
at 2013-07-24 17:29:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/shim (Old)
 and      /work/SRC/openSUSE:Factory/.shim.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "shim"

Changes:
--------
--- /work/SRC/openSUSE:Factory/shim/shim.changes        2013-05-13 
15:33:45.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.shim.new/shim.changes   2013-07-24 
17:29:48.000000000 +0200
@@ -1,0 +2,30 @@
+Tue Jul 23 03:55:05 UTC 2013 - [email protected]
+
+- Update to 0.4
+- Rebase patches
+  + shim-suse-build.patch
+  + shim-mokmanager-support-crypt-hash-method.patch
+  + shim-bnc804631-fix-broken-bootpath.patch
+  + shim-bnc798043-no-doulbe-separators.patch
+  + shim-bnc807760-change-pxe-2nd-loader-name.patch
+  + shim-bnc808106-correct-certcount.patch 
+  + shim-mokmanager-ui-revamp.patch
+- Add patches
+  + shim-merge-lf-loader-code.patch: merge the Linux Foundation
+    loader UI code
+  + shim-fix-pointer-casting.patch: fix a casting issue and the
+    size of an empty vendor cert
+  + shim-fix-simple-file-selector.patch: fix the buffer allocation
+    in the simple file selector
+- Remove upstreamed patches
+  + shim-support-mok-delete.patch
+  + shim-reboot-after-changes.patch
+  + shim-clear-queued-key.patch
+  + shim-local-key-sign-mokmanager.patch
+  + shim-get-2nd-stage-loader.patch
+  + shim-fix-loadoptions.patch
+- Remove unused patch: shim-mokmanager-new-pw-hash.patch and
+  shim-keep-unsigned-mokmanager.patch
+- Install the vendor certificate to /etc/uefi/certs
+
+-------------------------------------------------------------------

Old:
----
  shim-0.2.tar.bz2
  shim-clear-queued-key.patch
  shim-fix-loadoptions.patch
  shim-get-2nd-stage-loader.patch
  shim-keep-unsigned-mokmanager.patch
  shim-local-key-sign-mokmanager.patch
  shim-mokmanager-new-pw-hash.patch
  shim-reboot-after-changes.patch
  shim-support-mok-delete.patch

New:
----
  shim-0.4.tar.bz2
  shim-fix-pointer-casting.patch
  shim-fix-simple-file-selector.patch
  shim-merge-lf-loader-code.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ shim.spec ++++++
--- /var/tmp/diff_new_pack.Jr1LqW/_old  2013-07-24 17:29:49.000000000 +0200
+++ /var/tmp/diff_new_pack.Jr1LqW/_new  2013-07-24 17:29:49.000000000 +0200
@@ -19,7 +19,7 @@
 # needssslcertforbuild
 
 Name:           shim
-Version:        0.2
+Version:        0.4
 Release:        0
 Summary:        UEFI shim loader
 License:        BSD-2-Clause
@@ -35,35 +35,25 @@
 Source4:        SLES-UEFI-CA-Certificate.crt
 # PATCH-FIX-SUSE shim-suse-build.patch [email protected] -- Adjust Makefile for 
the build service
 Patch0:         shim-suse-build.patch
-# PATCH-FIX-UPSTREAM shim-local-key-sign-mokmanager.patch [email protected] -- 
Sign MokManager.efi with the local generated certificate
-Patch1:         shim-local-key-sign-mokmanager.patch
-# PATCH-FEATURE-UPSTREAM shim-get-2nd-stage-loader.patch [email protected] -- Get 
the second stage loader path from the load options
-Patch2:         shim-get-2nd-stage-loader.patch
-# PATCH-FIX-UPSTREAM shim-reboot-after-changes.patch [email protected] -- Reboot 
the system after enrolling or erasing keys
-Patch3:         shim-reboot-after-changes.patch
-# PATCH-FIX-UPSTREAM shim-clear-queued-key.patch [email protected] -- Clear the 
queued key to show the menu properly
-Patch5:         shim-clear-queued-key.patch
-# PATCH-FIX-UPSTREAM shim-fix-loadoptions.patch bnc#798043 [email protected] -- 
Adopt the UEFI shell style LoadOptions
-Patch6:         shim-fix-loadoptions.patch
-# PATCH-FIX-UPSTREAM shim-support-mok-delete.patch [email protected] -- Support 
for deleting specific keys
-Patch7:         shim-support-mok-delete.patch
-# PATCH-FIX-UPSTREAM shim-mokmanager-new-pw-hash.patch [email protected] -- 
Support the new password hash
-Patch8:         shim-mokmanager-new-pw-hash.patch
+# PATCH-FIX-UPSTREAM shim-fix-pointer-casting.patch [email protected] -- Fix a 
casting issue and the size of an empty vendor_cert or dbx_cert. 
+Patch1:         shim-fix-pointer-casting.patch
+# PATCH-FIX-UPSTREAM shim-merge-lf-loader-code.patch [email protected] -- Merge 
the Linux Foundation loader UI code
+Patch2:         shim-merge-lf-loader-code.patch
+# PATCH-FIX-UPSTREAM shim-fix-simple-file-selector.patch [email protected] -- Fix 
the buffer allocation in the simple file selector
+Patch3:         shim-fix-simple-file-selector.patch
 # PATCH-FIX-UPSTREAM shim-mokmanager-support-crypt-hash-method.patch 
[email protected] -- Support the password hashes from /etc/shadow
-Patch9:         shim-mokmanager-support-crypt-hash-method.patch
-# PATCH-FIX-OPENSUSE shim-keep-unsigned-mokmanager.patch [email protected] -- Keep 
MokManager.efi and sign it with the openSUSE key later
-Patch10:        shim-keep-unsigned-mokmanager.patch
+Patch4:         shim-mokmanager-support-crypt-hash-method.patch
 # PATCH-FIX-UPSTREAM shim-bnc804631-fix-broken-bootpath.patch bnc#804631 
[email protected] -- Fix the broken bootpath generated in generate_path()
-Patch11:        shim-bnc804631-fix-broken-bootpath.patch
+Patch5:         shim-bnc804631-fix-broken-bootpath.patch
 # PATCH-FIX-UPSTREAM shim-bnc798043-no-doulbe-separators.patch bnc#798043 
[email protected] -- Remove all double-separators from the bootpath
-Patch12:        shim-bnc798043-no-doulbe-separators.patch
+Patch6:         shim-bnc798043-no-doulbe-separators.patch
 # PATCH-FIX-UPSTREAM shim-bnc807760-change-pxe-2nd-loader-name.patch 
bnc#807760 [email protected] -- Change the PXE 2nd stage loader to match the 
filename we are using
-Patch13:        shim-bnc807760-change-pxe-2nd-loader-name.patch
+Patch7:         shim-bnc807760-change-pxe-2nd-loader-name.patch
 # PATCH-FIX-UPSTREAM shim-bnc808106-correct-certcount.patch bnc#808106 
[email protected] -- Correct the certifcate count of the signature list
-Patch14:        shim-bnc808106-correct-certcount.patch
+Patch8:         shim-bnc808106-correct-certcount.patch
 # PATCH-FIX-UPSTREAM shim-mokmanager-ui-revamp.patch [email protected] -- Revamp 
the MokManager UI
-Patch15:        shim-mokmanager-ui-revamp.patch
-BuildRequires:  gnu-efi >= 3.0q
+Patch9:         shim-mokmanager-ui-revamp.patch
+BuildRequires:  gnu-efi >= 3.0t
 BuildRequires:  mozilla-nss-tools
 BuildRequires:  openssl >= 0.9.8
 BuildRequires:  pesign
@@ -89,17 +79,12 @@
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
-%patch10 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-%patch15 -p1
 
 %build
 chmod +x "make-certs"
@@ -134,20 +119,25 @@
 touch shim.crt
 touch shim.cer
 # make sure cast warnings don't trigger post build check
-make VENDOR_CERT_FILE=shim-$suffix.der shim.efi MokManager.efi 2>/dev/null
+make VENDOR_CERT_FILE=shim-$suffix.der shim.efi MokManager.efi fallback.efi 
2>/dev/null
 # make VENDOR_CERT_FILE=cert.der VENDOR_DBX_FILE=dbx
 mv shim.efi shim-$suffix.efi
 
 %install
-export BRP_PESIGN_FILES='%{_libdir}/efi/shim*.efi 
%{_libdir}/efi/MokManager.efi'
+export BRP_PESIGN_FILES='%{_libdir}/efi/shim*.efi 
%{_libdir}/efi/MokManager.efi %{_libdir}/efi/fallback.efi'
 install -d %{buildroot}/%{_libdir}/efi
-install -m 444 shim-*.efi %{buildroot}/%{_libdir}/efi
+install -m 644 shim-*.efi %{buildroot}/%{_libdir}/efi
 install -m 444 shim-*.der %{buildroot}/%{_libdir}/efi
 # FIXME: install signed shim here
-install -m 444 %{SOURCE1} %{buildroot}/%{_libdir}/efi/shim.efi
-install -m 444 MokManager.efi %{buildroot}/%{_libdir}/efi/MokManager.efi
+install -m 644 %{SOURCE1} %{buildroot}/%{_libdir}/efi/shim.efi
+install -m 644 MokManager.efi %{buildroot}/%{_libdir}/efi/MokManager.efi
+install -m 644 fallback.efi %{buildroot}/%{_libdir}/efi/fallback.efi
 install -d %{buildroot}/%{_sbindir}
 install -m 755 %{SOURCE3} %{buildroot}/%{_sbindir}/
+# install SUSE certificate
+CERT_NAME=$(openssl x509 -sha1 -fingerprint -inform DER -in shim-*.der | grep 
"SHA1 Fingerprint" | cut -c 18- | cut -d ":" -f 1,2,3,4 | sed 's/://g')
+install -d %{buildroot}/%{_sysconfdir}/uefi/certs/
+install -m 444 shim-*.der %{buildroot}/%{_sysconfdir}/uefi/certs/$CERT_NAME.crt
 
 %clean
 %{?buildroot:%__rm -rf "%{buildroot}"}
@@ -163,6 +153,10 @@
 %{_libdir}/efi/shim-*.efi
 %{_libdir}/efi/shim-*.der
 %{_libdir}/efi/MokManager.efi
+%{_libdir}/efi/fallback.efi
 %{_sbindir}/shim-install
+%dir %{_sysconfdir}/uefi/
+%dir %{_sysconfdir}/uefi/certs/
+%{_sysconfdir}/uefi/certs/*.crt
 
 %changelog

++++++ shim-0.2.tar.bz2 -> shim-0.4.tar.bz2 ++++++
++++ 2835 lines of diff (skipped)

++++++ shim-bnc798043-no-doulbe-separators.patch ++++++
--- /var/tmp/diff_new_pack.Jr1LqW/_old  2013-07-24 17:29:50.000000000 +0200
+++ /var/tmp/diff_new_pack.Jr1LqW/_new  2013-07-24 17:29:50.000000000 +0200
@@ -1,17 +1,17 @@
-From 5c736550e8f7645f39df6948785ab5cae2201418 Mon Sep 17 00:00:00 2001
+From cf7f87688efab2712f41b47eaad32e75ec730653 Mon Sep 17 00:00:00 2001
 From: Gary Ching-Pang Lin <[email protected]>
 Date: Fri, 1 Mar 2013 18:04:06 +0800
 Subject: [PATCH] Remove double-separators from the bootpath
 
 ---
- shim.c |   27 ++++++++++++++++++++-------
+ shim.c | 27 ++++++++++++++++++++-------
  1 file changed, 20 insertions(+), 7 deletions(-)
 
 diff --git a/shim.c b/shim.c
-index 690d064..c36b641 100644
+index 0622c72..806f065 100644
 --- a/shim.c
 +++ b/shim.c
-@@ -907,7 +907,7 @@ static EFI_STATUS generate_path(EFI_LOADED_IMAGE *li, 
CHAR16 *ImagePath,
+@@ -969,7 +969,7 @@ static EFI_STATUS generate_path(EFI_LOADED_IMAGE *li, 
CHAR16 *ImagePath,
  {
        EFI_DEVICE_PATH *devpath;
        EFI_HANDLE device;
@@ -20,7 +20,7 @@
        unsigned int pathlen = 0;
        EFI_STATUS efi_status = EFI_SUCCESS;
        CHAR16 *bootpath;
-@@ -927,14 +927,27 @@ static EFI_STATUS generate_path(EFI_LOADED_IMAGE *li, 
CHAR16 *ImagePath,
+@@ -989,14 +989,27 @@ static EFI_STATUS generate_path(EFI_LOADED_IMAGE *li, 
CHAR16 *ImagePath,
                if (bootpath[i] == '/')
                        bootpath[i] = '\\';
        }
@@ -55,5 +55,5 @@
        while (*ImagePath == '\\')
                ImagePath++;
 -- 
-1.7.10.4
+1.8.1.4
 

++++++ shim-bnc804631-fix-broken-bootpath.patch ++++++
--- /var/tmp/diff_new_pack.Jr1LqW/_old  2013-07-24 17:29:50.000000000 +0200
+++ /var/tmp/diff_new_pack.Jr1LqW/_new  2013-07-24 17:29:50.000000000 +0200
@@ -1,4 +1,4 @@
-From 6b70850baa958b196ec332cf0224ffa9d5a81f5f Mon Sep 17 00:00:00 2001
+From bfffac234fabdf8110e8e8c53557d57d61320098 Mon Sep 17 00:00:00 2001
 From: Gary Ching-Pang Lin <[email protected]>
 Date: Thu, 21 Feb 2013 17:49:29 +0800
 Subject: [PATCH] Fix the broken bootpath
@@ -12,14 +12,14 @@
 
 Based on the patch from Michal Marek <[email protected]>
 ---
- shim.c |   22 +++++++++++++++++-----
+ shim.c | 22 +++++++++++++++++-----
  1 file changed, 17 insertions(+), 5 deletions(-)
 
 diff --git a/shim.c b/shim.c
-index 37a5898..690d064 100644
+index 94b9710..0622c72 100644
 --- a/shim.c
 +++ b/shim.c
-@@ -919,15 +919,25 @@ static EFI_STATUS generate_path(EFI_LOADED_IMAGE *li, 
CHAR16 *ImagePath,
+@@ -981,15 +981,25 @@ static EFI_STATUS generate_path(EFI_LOADED_IMAGE *li, 
CHAR16 *ImagePath,
  
        pathlen = StrLen(bootpath);
  
@@ -50,7 +50,7 @@
  
        *PathName = AllocatePool(StrSize(bootpath) + StrSize(ImagePath));
  
-@@ -944,6 +954,8 @@ static EFI_STATUS generate_path(EFI_LOADED_IMAGE *li, 
CHAR16 *ImagePath,
+@@ -1007,6 +1017,8 @@ static EFI_STATUS generate_path(EFI_LOADED_IMAGE *li, 
CHAR16 *ImagePath,
        *grubpath = FileDevicePath(device, *PathName);
  
  error:
@@ -60,5 +60,5 @@
  }
  
 -- 
-1.7.10.4
+1.8.1.4
 

++++++ shim-bnc807760-change-pxe-2nd-loader-name.patch ++++++
--- /var/tmp/diff_new_pack.Jr1LqW/_old  2013-07-24 17:29:50.000000000 +0200
+++ /var/tmp/diff_new_pack.Jr1LqW/_new  2013-07-24 17:29:50.000000000 +0200
@@ -1,11 +1,11 @@
-From 8222b5f6dd8ff34368173b86ae6108cb792802a7 Mon Sep 17 00:00:00 2001
+From 9cf8c7fefdcfb5930cb96091676a67cc0c0402b9 Mon Sep 17 00:00:00 2001
 From: Gary Ching-Pang Lin <[email protected]>
 Date: Thu, 7 Mar 2013 11:59:44 +0800
 Subject: [PATCH] Define the PXE 2nd stage loader in the beginning of the file
 
 Make it easier to change the PXE 2nd stage loader.
 ---
- netboot.c |   12 +++++++-----
+ netboot.c | 12 +++++++-----
  1 file changed, 7 insertions(+), 5 deletions(-)
 
 diff --git a/netboot.c b/netboot.c
@@ -54,5 +54,5 @@
  
        /* Note we don't capture the filename option here because we know its 
shim.efi
 -- 
-1.7.10.4
+1.8.1.4
 

++++++ shim-bnc808106-correct-certcount.patch ++++++
--- /var/tmp/diff_new_pack.Jr1LqW/_old  2013-07-24 17:29:50.000000000 +0200
+++ /var/tmp/diff_new_pack.Jr1LqW/_new  2013-07-24 17:29:50.000000000 +0200
@@ -1,17 +1,17 @@
-From 822b44b8d978449a43fb2cd7bcd1381d961d0b25 Mon Sep 17 00:00:00 2001
+From 37b8af226ea8e3af467944b3b6253218ba13838c Mon Sep 17 00:00:00 2001
 From: Gary Ching-Pang Lin <[email protected]>
 Date: Fri, 8 Mar 2013 14:44:50 +0800
 Subject: [PATCH] Correct the certificate count of the signature list
 
 ---
- shim.c |    4 ++--
+ shim.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/shim.c b/shim.c
-index c36b641..1daa84b 100644
+index 806f065..7219d53 100644
 --- a/shim.c
 +++ b/shim.c
-@@ -228,7 +228,7 @@ static CHECK_STATUS 
check_db_cert_in_ram(EFI_SIGNATURE_LIST *CertList,
+@@ -230,7 +230,7 @@ static CHECK_STATUS 
check_db_cert_in_ram(EFI_SIGNATURE_LIST *CertList,
  
        while ((dbsize > 0) && (dbsize >= CertList->SignatureListSize)) {
                if (CompareGuid (&CertList->SignatureType, &CertType) == 0) {
@@ -20,7 +20,7 @@
                        Cert = (EFI_SIGNATURE_DATA *) ((UINT8 *) CertList + 
sizeof (EFI_SIGNATURE_LIST) + CertList->SignatureHeaderSize);
                        for (Index = 0; Index < CertCount; Index++) {
                                IsFound = AuthenticodeVerify (data->CertData,
-@@ -293,7 +293,7 @@ static CHECK_STATUS 
check_db_hash_in_ram(EFI_SIGNATURE_LIST *CertList,
+@@ -295,7 +295,7 @@ static CHECK_STATUS 
check_db_hash_in_ram(EFI_SIGNATURE_LIST *CertList,
        BOOLEAN IsFound = FALSE;
  
        while ((dbsize > 0) && (dbsize >= CertList->SignatureListSize)) {
@@ -30,5 +30,5 @@
                if (CompareGuid(&CertList->SignatureType, &CertType) == 0) {
                        for (Index = 0; Index < CertCount; Index++) {
 -- 
-1.7.10.4
+1.8.1.4
 

++++++ shim-fix-pointer-casting.patch ++++++
>From 23002e8e5c03800845afae8aaa7e42770c3e5d17 Mon Sep 17 00:00:00 2001
From: Peter Jones <[email protected]>
Date: Tue, 11 Jun 2013 14:58:25 -0400
Subject: [PATCH] Fix some pointer casting issues.

This also fixes the size of an empty vendor_cert or dbx_cert.

Signed-off-by: Peter Jones <[email protected]>
---
 cert.S | 2 +-
 shim.c | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/cert.S b/cert.S
index 2ed9b6d..66a05b8 100644
--- a/cert.S
+++ b/cert.S
@@ -32,5 +32,5 @@ vendor_cert:
        .size   vendor_cert_size, 4
        .section .vendor_cert, "a", @progbits
 vendor_cert_size:
-       .long   1
+       .long   0
 #endif
diff --git a/shim.c b/shim.c
index 94b9710..7d43f04 100644
--- a/shim.c
+++ b/shim.c
@@ -59,7 +59,7 @@ static UINT32 load_options_size;
  */
 extern UINT8 vendor_cert[];
 extern UINT32 vendor_cert_size;
-extern EFI_SIGNATURE_LIST *vendor_dbx;
+extern UINT8 vendor_dbx[];
 extern UINT32 vendor_dbx_size;
 
 #define EFI_IMAGE_SECURITY_DATABASE_GUID { 0xd719b2cb, 0x3d3a, 0x4596, { 0xa3, 
0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f }}
@@ -359,16 +359,17 @@ static EFI_STATUS check_blacklist 
(WIN_CERTIFICATE_EFI_PKCS *cert,
                                   UINT8 *sha256hash, UINT8 *sha1hash)
 {
        EFI_GUID secure_var = EFI_IMAGE_SECURITY_DATABASE_GUID;
+       EFI_SIGNATURE_LIST *dbx = (EFI_SIGNATURE_LIST *)vendor_dbx;
 
-       if (check_db_hash_in_ram(vendor_dbx, vendor_dbx_size, sha256hash,
+       if (check_db_hash_in_ram(dbx, vendor_dbx_size, sha256hash,
                                 SHA256_DIGEST_SIZE, EfiHashSha256Guid) ==
                                DATA_FOUND)
                return EFI_ACCESS_DENIED;
-       if (check_db_hash_in_ram(vendor_dbx, vendor_dbx_size, sha1hash,
+       if (check_db_hash_in_ram(dbx, vendor_dbx_size, sha1hash,
                                 SHA1_DIGEST_SIZE, EfiHashSha1Guid) ==
                                DATA_FOUND)
                return EFI_ACCESS_DENIED;
-       if (check_db_cert_in_ram(vendor_dbx, vendor_dbx_size, cert,
+       if (check_db_cert_in_ram(dbx, vendor_dbx_size, cert,
                                 sha256hash) == DATA_FOUND)
                return EFI_ACCESS_DENIED;
 
-- 
1.8.1.4

++++++ shim-fix-simple-file-selector.patch ++++++
>From ed9cf192de86c58e9c5397afa48de7b6d7bab7a7 Mon Sep 17 00:00:00 2001
From: Gary Ching-Pang Lin <[email protected]>
Date: Thu, 30 May 2013 14:05:59 +0800
Subject: [PATCH 1/2] simple_file: Allocate buffers for file entries

The dir filter appends L'/' to the directory entries without
allocating a new buffer, and this could crash the whole program.
---
 lib/simple_file.c | 42 ++++++++++++++++++++++++++++++++++--------
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/lib/simple_file.c b/lib/simple_file.c
index 0e5ecd2..e288272 100644
--- a/lib/simple_file.c
+++ b/lib/simple_file.c
@@ -344,9 +344,12 @@ simple_dir_filter(EFI_HANDLE image, CHAR16 *name, CHAR16 
*filter,
                        goto next;
 
                if (next->Attribute & EFI_FILE_DIRECTORY) {
-                               (*result)[(*count)] = next->FileName;
-                               (*result)[(*count)][len] = '/';
-                               (*result)[(*count)++][len + 1] = '\0';
+                               (*result)[(*count)] = PoolPrint(L"%s/", 
next->FileName);
+                               if (!(*result)[(*count)]) {
+                                       Print(L"Failed to allocate buffer");
+                                       return EFI_OUT_OF_RESOURCES;
+                               }
+                               (*count)++;
                                goto next;
                }
 
@@ -354,7 +357,12 @@ simple_dir_filter(EFI_HANDLE image, CHAR16 *name, CHAR16 
*filter,
                        offs = StrLen(filterarr[c]);
 
                        if (StrCmp(&next->FileName[len - offs], filterarr[c]) 
== 0) {
-                               (*result)[(*count)++] = next->FileName;
+                               (*result)[(*count)] = 
StrDuplicate(next->FileName);
+                               if (!(*result)[(*count)]) {
+                                       Print(L"Failed to allocate buffer");
+                                       return EFI_OUT_OF_RESOURCES;
+                               }
+                               (*count)++;
                        } else {
                                continue;
                        }
@@ -362,7 +370,7 @@ simple_dir_filter(EFI_HANDLE image, CHAR16 *name, CHAR16 
*filter,
                }
 
        next:           
-               if (StrCmp(next->FileName, L"../") == 0) {
+               if (StrCmp(next->FileName, L"..") == 0) {
                        /* place .. directory first */
                        CHAR16 *tmp = (*result)[(*count) - 1];
 
@@ -392,6 +400,15 @@ simple_dir_filter(EFI_HANDLE image, CHAR16 *name, CHAR16 
*filter,
        return status;
 }
 
+static void
+free_entries(CHAR16 **entries, int count)
+{
+       int i;
+
+       for (i = 0; i<count; i++)
+               FreePool(entries[i]);
+}
+
 void
 simple_file_selector(EFI_HANDLE *im, CHAR16 **title, CHAR16 *name,
                     CHAR16 *filter, CHAR16 **result)
@@ -436,8 +453,6 @@ simple_file_selector(EFI_HANDLE *im, CHAR16 **title, CHAR16 
*name,
                /* ESC key */
                goto out_free;
        selected = entries[select];
-       FreePool(entries);
-       entries = NULL;
        /* note that memory used by selected is valid until dmp is freed */
        len = StrLen(selected);
        if (selected[len - 1] == '/') {
@@ -445,6 +460,9 @@ simple_file_selector(EFI_HANDLE *im, CHAR16 **title, CHAR16 
*name,
 
                /* stay where we are */
                if (StrCmp(selected, L"./") == 0) {
+                       free_entries(entries, count);
+                       FreePool(entries);
+                       entries = NULL;
                        FreePool(dmp);
                        goto redo;
                } else if (StrCmp(selected, L"../") == 0) {
@@ -463,6 +481,9 @@ simple_file_selector(EFI_HANDLE *im, CHAR16 **title, CHAR16 
*name,
                        if (StrCmp(name, L"\\") != 0
                            && StrCmp(&name[i], L"..") != 0) {
                                name[i] = '\0';
+                               free_entries(entries, count);
+                               FreePool(entries);
+                               entries = NULL;
                                FreePool(dmp);
                                goto redo;
                        }
@@ -478,6 +499,9 @@ simple_file_selector(EFI_HANDLE *im, CHAR16 **title, CHAR16 
*name,
                /* remove trailing / */
                newname[StrLen(newname) - 1] = '\0';
 
+               free_entries(entries, count);
+               FreePool(entries);
+               entries = NULL;
                FreePool(dmp);
                FreePool(name);
                name = newname;
@@ -494,8 +518,10 @@ simple_file_selector(EFI_HANDLE *im, CHAR16 **title, 
CHAR16 *name,
 
  out_free:
        FreePool(dmp);
-       if (entries)
+       if (entries) {
+               free_entries(entries, count);
                FreePool(entries);
+       }
  out_free_name:
        FreePool(name);
 }
-- 
1.8.1.4


>From 33080500e6bf33324a7c1463f4608f3f21d923b3 Mon Sep 17 00:00:00 2001
From: Gary Ching-Pang Lin <[email protected]>
Date: Thu, 30 May 2013 14:10:56 +0800
Subject: [PATCH 2/2] Clean lib/, too

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index f64f409..ed47360 100644
--- a/Makefile
+++ b/Makefile
@@ -109,6 +109,7 @@ lib/lib.a:
 clean:
        $(MAKE) -C Cryptlib clean
        $(MAKE) -C Cryptlib/OpenSSL clean
+       $(MAKE) -C lib clean
        rm -rf $(TARGET) $(OBJS) $(MOK_OBJS) $(FALLBACK_OBJS) $(KEYS) certdb
        rm -f *.debug *.so *.efi
 
-- 
1.8.1.4

++++++ shim-merge-lf-loader-code.patch ++++++
++++ 5260 lines (skipped)

++++++ shim-mokmanager-support-crypt-hash-method.patch ++++++
++++ 719 lines (skipped)
++++ between 
/work/SRC/openSUSE:Factory/shim/shim-mokmanager-support-crypt-hash-method.patch
++++ and 
/work/SRC/openSUSE:Factory/.shim.new/shim-mokmanager-support-crypt-hash-method.patch

++++++ shim-mokmanager-ui-revamp.patch ++++++
++++ 12161 lines (skipped)
++++ between /work/SRC/openSUSE:Factory/shim/shim-mokmanager-ui-revamp.patch
++++ and /work/SRC/openSUSE:Factory/.shim.new/shim-mokmanager-ui-revamp.patch


++++++ shim-suse-build.patch ++++++
--- /var/tmp/diff_new_pack.Jr1LqW/_old  2013-07-24 17:29:50.000000000 +0200
+++ /var/tmp/diff_new_pack.Jr1LqW/_new  2013-07-24 17:29:50.000000000 +0200
@@ -1,11 +1,13 @@
-Index: shim-0.2/Makefile
-===================================================================
---- shim-0.2.orig/Makefile
-+++ shim-0.2/Makefile
+---
+ Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Makefile
++++ b/Makefile
 @@ -6,7 +6,7 @@ LIB_PATH       = /usr/lib64
  
  EFI_INCLUDE   = /usr/include/efi
- EFI_INCLUDES  = -nostdinc -ICryptlib -ICryptlib/Include -I$(EFI_INCLUDE) 
-I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol 
+ EFI_INCLUDES  = -nostdinc -ICryptlib -ICryptlib/Include -I$(EFI_INCLUDE) 
-I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol
 -EFI_PATH      = /usr/lib64/gnuefi
 +EFI_PATH      = /usr/lib64
  

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to