Bug 112189
Summary: | PublishedFile.delete() incorrectly deletes ALL pubToFS content on Windows | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Enterprise CMS | Reporter: | Mike Bonnet <mikeb> | ||||||
Component: | other | Assignee: | ccm-bugs-list | ||||||
Status: | CLOSED WONTFIX | QA Contact: | Jon Orris <jorris> | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 6.0 | CC: | richardl | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2006-09-05 17:57:39 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Mike Bonnet
2003-12-15 20:41:29 UTC
Sorry, let me clarify that statement about data loss. This bug does not cause any permanent loss of data (everything is still in the database). However, if pubToFS is being used to generate static HTML for a live site, then content will disappear from the live site unexpectedly, and it will appear to users that data is missing. Also, there is no way to restore that data to the live site, since republishing any already-live content requires an unpublish first, and since unpublishing triggers the deletion of all currently published content. Created attachment 96558 [details]
Replace backslashes with forward-slashes in filesystem path before comparing to path stored in the database
Tested successfully on Windows in WebSphere 5.
Bug 112576 points out the existence of java.io.File.separator. Perhaps a better implementation would be something like: filePath = filePath.replace(java.io.File.separator, '/'); ? We store paths in the database. Do we want the stored path format to be platform-dependent? If yes, then it means it would be harder for users to switch from a Unix-hosted servlet container to a Windows-hosted one, or vice versa. If no, then we have to pick either forward slash or backslash as a separator for paths stored in the database. Created attachment 96680 [details]
occurrences of "/", '/', and java.io.File.separator
Looking at Core+CMS, we have about 250 occurrences of the literal string
"/", 44 occurrences of the literal char '/', and 9 occurrences of
java.io.File.separator. That's a lot of code to audit.
Closing old tickets |