Issue Details (XML | Word | Printable)

Key: CHEF-1363
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Daniel DeLeo
Reporter: Daniel DeLeo
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Chef

ChefServerApi::SandboxFile assumes input is a StringIO

Created: 21/Jun/10 05:04 PM   Updated: 21/Jun/10 09:42 PM   Resolved: 21/Jun/10 09:41 PM
Component/s: Chef Server
Affects Version/s: 0.9.0
Fix Version/s: 0.9.2

Triage Status: Triaged


 Description  « Hide

but we can't rely on rack.input to support the #string method b/c the rack spec doesn't require it. use #read instead.



Sort Order: Ascending order - Click to sort in descending order
Daniel DeLeo added a comment - 21/Jun/10 05:21 PM

fixed as described



Daniel DeLeo added a comment - 21/Jun/10 08:04 PM

need to rewind the input, jerkface


Daniel DeLeo added a comment - 21/Jun/10 09:41 PM

Updated the patch to rewind the input before writing the file, and to read in 8k chunks. this is required because unicorn extra-wraps the input so we can't easily detect if it's a stringio or temporary file, therefore an input that doesn't look like a tempfile might actually be one (and contain an arbitrarily large amount of data). Confirmed with corp on IRC that this updated patch solves the problem.


Daniel DeLeo added a comment - 21/Jun/10 09:42 PM

updated fix is merged.