Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java
index 546b3f47c5..d404469168 100644
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java
+++ b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java
@@ -143,8 +143,18 @@ public class UntarAction extends ProvisioningAction {
FileOutputStream outStream = new FileOutputStream(outFile);
tarIn.copyEntryContents(outStream);
outStream.close();
+
+ // Set last modified time from the tar entry
long lastModified = tarEntry.getModTime().getTime();
outFile.setLastModified(lastModified);
+
+ // Set the executable bits from the tar entry
+ // we let the umask determine the r/w
+ int mode = tarEntry.getMode();
+ boolean exec = (mode & 0x111) != 0;
+ boolean execOwner = (mode & 0x11) == 0;
+ outFile.setExecutable(exec, execOwner);
+
fileList.add(outFile);
}
}

Back to the top