Status/Resolution/Reason: To Fix//BugVerified
Reporter/Name(from Bugbase): Earl Schellhous / Earl Schellhous (Earl Schellhous)
Created: 02/04/2016
Components: File Management
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Normal / Some users will encounter
Locale/System: English / Linux OracleLinux 6
Vote Count: 0
+++++++++Problem Description: I'm using <cfzip> because the production server is still on CF9. <cfzip> is first used to zip a directory recursively into a temporary zip file. A directory is created using <cfdirectory> and set to mode="775". Then the files are extracted into the new directory using <cfzip>. All directories and files created by <cfzip> are read only.
Steps to Reproduce:
Use the relevant parts of the code to reproduce:
<!--- zipfile = /var/www/html/admin.temp.zip --->
<cfset zipfile = request.webroot & "admin/temp.zip" />
<cfzip action="zip" source="#sourceFolder#" file="#zipfile#" recurse="yes" storePath="yes">
<cfif NOT DirectoryExists(destFolder)>
<!---
destFolder = /var/www/html/CHE2A/SSII2016 and is saved as mode 775
ls -al:
drwxrwxr-x 15 apache devel 4096 Feb 4 09:50 SSII2016
--->
<cfdirectory action="CREATE" directory="#destFolder#" mode="775" />
<cfzip action="unzip" file="#zipfile#" recurse="yes" storePath="yes" destination="#destFolder#" />
<cfoutput><strong>Directory #destFolder# created and files placed.</strong><br></cfoutput>
<cffile action="READ" file="#destFolder#/Application.cfm" variable="appFile" />
<!--- do some stuff to the file
<cfset appFile = Replace(appFile,"DEFAULTCOURSENAME",CNUMBER & Year) />
<cfset appFile = Replace(appFile,"DEFAULTCOID",FORM.NewCOID) />
--->
<!---
Fails at <cffile action="WRITE"> files and folders under destFolder are
saved as mode 755 (read only for group). ColdFusion is running under user apache
and group devel and saves the extracted folders as 755 and the .cfm files
as 444 (read only for all).
ls -al:
drwxr-xr-x 2 apache devel 4096 Feb 4 09:37 Exercise
-r--r--r-- 1 apache devel 2988 Jul 21 2006 index.cfm
--->
<cffile action="WRITE" file="#destFolder#/Application.cfm" output="#appFile#" />
<cfoutput><strong>Application.cfm modified.</strong><br></cfoutput>
<cffile action="DELETE" file="#zipfile#" />
<cfoutput><strong>Temp zip file deleted.</strong><br></cfoutput>
<cfelse>
<cfoutput><strong>Directory #destFolder# already exists.</strong></cfoutput>
</cfif>
Actual Result:
Files and directories are created read-only
Expected Result:
Files and directories should be writeable by the same group that created them.
Any Workarounds:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4114019
External Customer Info:
External Company:
External Customer Name: Earl Schellhous
External Customer Email:
External Test Config: My Hardware and Environment details:
Server Product ColdFusion
Version 11,0,07,296330
Edition Developer
Operating System UNIX
OS Version 3.8.13-55.1.5.el6uek.x86_64
Update Level /opt/coldfusion11/cfusion/lib/updates/chf11000007.jar
Adobe Driver Version 5.1.3 (Build 000094)
Attachments:
Comments: