Lines 348-355
Link Here
|
348 |
status = apr_file_open(&outf, dst, APR_WRITE | APR_CREATE | APR_TRUNCATE |
348 |
status = apr_file_open(&outf, dst, APR_WRITE | APR_CREATE | APR_TRUNCATE |
349 |
| APR_BINARY, perms, p); |
349 |
| APR_BINARY, perms, p); |
350 |
if (status != APR_SUCCESS) { |
350 |
if (status != APR_SUCCESS) { |
|
|
351 |
char *dirpath = NULL; |
352 |
apr_finfo_t dir_finfo; |
353 |
apr_status_t rv; |
351 |
apr_file_close(inf); |
354 |
apr_file_close(inf); |
352 |
|
355 |
|
|
|
356 |
/* check if destination directory exists if not then return |
357 |
* HTTP_CONFLICT |
358 |
*/ |
359 |
dirpath = ap_make_dirstr_parent(p, dst); |
360 |
rv = apr_stat(&dir_finfo, dirpath, APR_FINFO_NORM, p); |
361 |
if (rv != APR_SUCCESS) |
362 |
return dav_new_error(p, HTTP_CONFLICT, 0, dirpath); |
363 |
|
353 |
return dav_new_error(p, MAP_IO2HTTP(status), 0, |
364 |
return dav_new_error(p, MAP_IO2HTTP(status), 0, |
354 |
"Could not open file for writing"); |
365 |
"Could not open file for writing"); |
355 |
} |
366 |
} |