From 6ff845a9c10bc2f8506e10e781c0584843d752a1 Mon Sep 17 00:00:00 2001 From: "JesusFreke@JesusFreke.com" Date: Sun, 8 Nov 2009 05:00:55 +0000 Subject: [PATCH] open the odex file as read-only git-svn-id: https://smali.googlecode.com/svn/trunk@482 55b6fa8a-2a1e-11de-a435-ffa8d773f76a --- deodexerant/Main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deodexerant/Main.c b/deodexerant/Main.c index 56edf5a2..77159fde 100644 --- a/deodexerant/Main.c +++ b/deodexerant/Main.c @@ -417,7 +417,7 @@ int main(int argc, char* const argv[]) return 1; } - int odexFd = open(inputFileName, O_RDWR, 0644); + int odexFd = open(inputFileName, O_RDONLY); if (odexFd < 0) { fprintf(stderr, "Unable to open '%s': %s\n", inputFileName, strerror(errno)); return 1; @@ -466,8 +466,8 @@ int main(int argc, char* const argv[]) */ bool success; void* mapAddr; - mapAddr = mmap(NULL, inputInfo.st_size, PROT_READ|PROT_WRITE, - MAP_SHARED, odexFd, 0); + mapAddr = mmap(NULL, inputInfo.st_size, PROT_READ, + MAP_PRIVATE, odexFd, 0); if (mapAddr == MAP_FAILED) { fprintf(stderr, "unable to mmap DEX cache: %s\n", strerror(errno)); return 1;