src/modules/server/transaction.py
changeset 3315 e2377565405f
parent 3236 73d600045799
child 3339 c88573eb98ea
--- a/src/modules/server/transaction.py	Wed Mar 02 20:16:17 2016 -0800
+++ b/src/modules/server/transaction.py	Sun Feb 28 16:24:18 2016 -0800
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 from __future__ import print_function
@@ -483,9 +483,12 @@
                             digest.get_least_preferred_hash(action)
                         fname = hash_val
 
-                        # Extract ELF information
+                        # Extract ELF information if not already provided.
                         # XXX This needs to be modularized.
-                        if haveelf and data[:4] == "\x7fELF":
+                        if haveelf and data[:4] == "\x7fELF" and (
+                            "elfarch" not in action.attrs or
+                            "elfbits" not in action.attrs or
+                            "elfhash" not in action.attrs):
                                 elf_name = os.path.join(self.dir,
                                     ".temp-{0}".format(fname))
                                 elf_file = open(elf_name, "wb")