Opened 14 years ago
Closed 14 years ago
#1024 closed Defect (fixed)
Client does not handle paths when copy-tag specified for WU files
Reported by: | jbk | Owned by: | davea |
---|---|---|---|
Priority: | Minor | Milestone: | Undetermined |
Component: | Client - Daemon | Version: | 6.10.58 |
Keywords: | copy, open_name, directory support | Cc: |
Description
Summary: Some applications require files to be in specific directories. When specifying a path in the open_name for a file reference the client will attempt to create a file at that path. This will fail, however, if the path does not exist. (And could be a problem if the path exists but is outside the BOINC directory and if we aren't running in sandbox mode).
Example: ... <file_ref>
<file_number>xyz</file_number> <open_name>directory/filename.file</open_name> <copy_file/>
</file_ref> ...
Current behaviour: 2010-10-23T19:09:38 CEST BuggyProject? [error] Can't copy projects/bugy.project.net/fileXYZ to slots/0/directory/filename.file: fopen() failed
Expected behaviour: That "directory" is created as a subdirectory in slots/0 and that the file is then copied there afterwards.
Solution: Make lib/filesys.cpp::boinc_copy() check whether newf contains a path. If it does then create any missing directories before copying the file.
pseudo code:
int boinc_copy(const char* orig, const char* newf) {
}