From 2e271e3821e9bcb32d64ff89af759562d19bc8b7 Mon Sep 17 00:00:00 2001 From: "mkmelin+mozilla%iki.fi" Date: Wed, 5 Sep 2007 16:10:09 +0000 Subject: [PATCH] [Bug 280419] When a temporary file is created from the download manager it should be readonly. Also applies to attachments in mail. r=cbiesinger, sr=dmose, a=bsmedberg git-svn-id: svn://10.0.0.236/trunk@233952 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp b/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp index 6f0f09a73a1..9c939cdc7fb 100644 --- a/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -1976,6 +1976,9 @@ nsresult nsExternalAppHandler::OpenWithApplication() // if a stop request was already issued then proceed with launching the application. if (mStopRequestIssued) { + // make the tmp file readonly so users won't edit it and lose the changes + mFinalFileDestination->SetPermissions(0400); + rv = mMimeInfo->LaunchWithFile(mFinalFileDestination); if (NS_FAILED(rv)) {