Lines Matching refs:path
2376 st = (0 == lstat(r->physical.path.ptr, &stp)) ? &stp : NULL; in webdav_if_match_or_unmodified_since()
2416 stat_cache_update_entry(BUF_PTR_LEN(&r->physical.path), st, etagb); in webdav_response_etag()
2421 webdav_parent_modified (const buffer *path) in webdav_parent_modified() argument
2423 uint32_t dirlen = buffer_clen(path); in webdav_parent_modified()
2424 const char *fn = path->ptr; in webdav_parent_modified()
2467 stat_cache_delete_entry(BUF_PTR_LEN(&dst->path)); in webdav_unlinkat()
2484 if (0 == unlink(dst->path.ptr)) { in webdav_delete_file()
2485 stat_cache_delete_entry(BUF_PTR_LEN(&dst->path)); in webdav_delete_file()
2506 DIR * const dir = opendir(dst->path.ptr); in webdav_delete_dir()
2508 const int dfd = fdevent_open_dirname(dst->path.ptr, 0); in webdav_delete_dir()
2519 const uint32_t dst_path_used = dst->path.used; in webdav_delete_dir()
2548 buffer_append_string_len(&dst->path, de->d_name, len); in webdav_delete_dir()
2557 if (0 != stat(dst->path.ptr, &st)) { in webdav_delete_dir()
2558 dst->path.ptr[ (dst->path.used = dst_path_used) -1]='\0'; in webdav_delete_dir()
2567 buffer_append_char(&dst->path, '/'); in webdav_delete_dir()
2580 dst->path.ptr[ (dst->path.used = dst_path_used) -1] = '\0'; in webdav_delete_dir()
2587 if (0 == rmdir(dst->path.ptr)) in webdav_delete_dir()
2658 if (0==clonefile(src->path.ptr,dst->path.ptr,CLONE_NOFOLLOW)) in webdav_copytmp_rename()
2686 buffer_append_str2(tmpb, BUF_PTR_LEN(&dst->path), in webdav_copytmp_rename()
2702 if (0 == clonefile(src->path.ptr, tmpb->ptr, CLONE_NOFOLLOW)) in webdav_copytmp_rename()
2726 const int ifd = fdevent_open_cloexec(src->path.ptr, 0, O_RDONLY, 0); in webdav_copytmp_rename()
2749 if (CopyFile((LPTSTR)src->path.ptr, (LPTSTR)tmpb->ptr, TRUE)) { in webdav_copytmp_rename()
2877 if (0 == lstat(dst->path.ptr, &stb) || errno != ENOENT) { in webdav_copytmp_rename()
2884 if (0 == rename(tmpb->ptr, dst->path.ptr)) in webdav_copytmp_rename()
2887 AT_FDCWD, dst->path.ptr, in webdav_copytmp_rename()
2893 stat_cache_delete_entry(BUF_PTR_LEN(&dst->path)); in webdav_copytmp_rename()
2921 if (0 == lstat(dst->path.ptr, &st) || errno != ENOENT) in webdav_copymove_file()
2926 if (0 == rename(src->path.ptr, dst->path.ptr)) in webdav_copymove_file()
2928 if (0 == renameat2(AT_FDCWD, src->path.ptr, in webdav_copymove_file()
2929 AT_FDCWD, dst->path.ptr, in webdav_copymove_file()
2943 if (overwrite) unlink(src->path.ptr); in webdav_copymove_file()
2946 stat_cache_delete_entry(BUF_PTR_LEN(&dst->path)); in webdav_copymove_file()
2947 stat_cache_delete_entry(BUF_PTR_LEN(&src->path)); in webdav_copymove_file()
2955 if (0 == linkat(AT_FDCWD, src->path.ptr, AT_FDCWD, dst->path.ptr, 0)){ in webdav_copymove_file()
2962 if (0 == webdav_linktmp_rename(pconf, &src->path, &dst->path)) { in webdav_copymove_file()
2990 if (0 == mkdir(dst->path.ptr, WEBDAV_DIR_MODE)) { in webdav_mkdir()
2991 webdav_parent_modified(&dst->path); in webdav_mkdir()
3013 force_assert(2 <= dst->path.used); in webdav_mkdir()
3019 dst->path.ptr[dst->path.used-2] = '\0'; /*(trailing slash)*/ in webdav_mkdir()
3020 status = lstat(dst->path.ptr, &st); in webdav_mkdir()
3021 dst->path.ptr[dst->path.used-2] = '/'; /*(restore slash)*/ in webdav_mkdir()
3031 dst->path.ptr[dst->path.used-2] = '\0'; /*(trailing slash)*/ in webdav_mkdir()
3034 dst->path.ptr[dst->path.used-2] = '/'; /*(restore slash)*/ in webdav_mkdir()
3039 webdav_parent_modified(&dst->path); in webdav_mkdir()
3040 return (0 == mkdir(dst->path.ptr, WEBDAV_DIR_MODE)) in webdav_mkdir()
3105 if (0 == lstat(dst->path.ptr, &st) || errno != ENOENT) { in webdav_copymove_dir()
3112 if (0 == rename(src->path.ptr, dst->path.ptr)) in webdav_copymove_dir()
3114 if (0 == renameat2(AT_FDCWD, src->path.ptr, in webdav_copymove_dir()
3115 AT_FDCWD, dst->path.ptr, in webdav_copymove_dir()
3141 force_assert(2 <= dst->path.used); in webdav_copymove_dir()
3144 dst->path.ptr[dst->path.used-2] = '\0'; /*(trailing slash)*/ in webdav_copymove_dir()
3145 status = lstat(dst->path.ptr, &st); in webdav_copymove_dir()
3146 dst->path.ptr[dst->path.used-2] = '/'; /*(restore slash)*/ in webdav_copymove_dir()
3157 dst->path.ptr[dst->path.used-2] = '\0'; /*(remove slash)*/ in webdav_copymove_dir()
3160 dst->path.ptr[dst->path.used-2] = '/'; /*(restore slash)*/ in webdav_copymove_dir()
3167 if (0 == rename(src->path.ptr, dst->path.ptr)) { in webdav_copymove_dir()
3205 const uint32_t src_path_used = src->path.used; in webdav_copymove_dir()
3207 const uint32_t dst_path_used = dst->path.used; in webdav_copymove_dir()
3212 DIR * const srcdir = opendir(src->path.ptr); in webdav_copymove_dir()
3214 dfd = fdevent_open_dirname(src->path.ptr, 0); in webdav_copymove_dir()
3248 buffer_append_string_len(&src->path, de->d_name, len); in webdav_copymove_dir()
3249 buffer_append_string_len(&dst->path, de->d_name, len); in webdav_copymove_dir()
3258 if (0 != stat(src->path.ptr, &st)) { in webdav_copymove_dir()
3259 src->path.ptr[ (src->path.used = src_path_used) -1]='\0'; in webdav_copymove_dir()
3261 dst->path.ptr[ (dst->path.used = dst_path_used) -1]='\0'; in webdav_copymove_dir()
3270 buffer_append_char(&src->path, '/'); in webdav_copymove_dir()
3271 buffer_append_char(&dst->path, '/'); in webdav_copymove_dir()
3295 src->path.ptr[ (src->path.used = src_path_used) -1] = '\0'; in webdav_copymove_dir()
3297 dst->path.ptr[ (dst->path.used = dst_path_used) -1] = '\0'; in webdav_copymove_dir()
3497 stat_cache_mimetype_by_ext(mtypes, BUF_PTR_LEN(&pb->dst->path)); in webdav_propfind_live_props()
3746 DIR * const dir = opendir(dst->path.ptr); in webdav_propfind_dir()
3748 const int dfd = fdevent_open_dirname(dst->path.ptr, 0); in webdav_propfind_dir()
3766 const uint32_t dst_path_used = dst->path.used; in webdav_propfind_dir()
3785 buffer_append_string_len(&dst->path, de->d_name, len); in webdav_propfind_dir()
3788 if (0 != stat(dst->path.ptr, &pb->st)) { in webdav_propfind_dir()
3789 dst->path.ptr[ (dst->path.used = dst_path_used) -1]='\0'; in webdav_propfind_dir()
3795 buffer_append_char(&dst->path, '/'); in webdav_propfind_dir()
3804 dst->path.ptr[ (dst->path.used = dst_path_used) -1] = '\0'; in webdav_propfind_dir()
4072 if (0 != lstat(r->physical.path.ptr, &st)) { in webdav_has_lock()
4232 ? 0 != lstat(r->physical.path.ptr, &pb.st) in mod_webdav_propfind()
4233 : 0 != stat(r->physical.path.ptr, &pb.st)) { /* non-standard */ in mod_webdav_propfind()
4238 if (!buffer_has_pathsep_suffix(&r->physical.path)) { in mod_webdav_propfind()
4242 buffer_append_char(&r->physical.path, '/'); in mod_webdav_propfind()
4246 else if (buffer_has_pathsep_suffix(&r->physical.path)) { in mod_webdav_propfind()
4427 if (-1 == lstat(r->physical.path.ptr, &st)) { in mod_webdav_delete()
4438 if (!buffer_has_pathsep_suffix(&r->physical.path)) { in mod_webdav_delete()
4446 buffer_append_char(&r->physical.path, '/'); in mod_webdav_delete()
4486 stat_cache_delete_dir(BUF_PTR_LEN(&r->physical.path)); in mod_webdav_delete()
4488 else if (buffer_has_pathsep_suffix(&r->physical.path)) in mod_webdav_delete()
4566 fd = fdevent_open_cloexec(r->physical.path.ptr, 0, in mod_webdav_put_0()
4576 webdav_parent_modified(&r->physical.path); in mod_webdav_put_0()
4590 fd = fdevent_open_cloexec(r->physical.path.ptr, 0, in mod_webdav_put_0()
4607 if (buffer_has_pathsep_suffix(&r->physical.path)) { in mod_webdav_put_prep()
4638 size_t len = buffer_clen(&r->physical.path); in mod_webdav_put_prep()
4640 char *slash = memrchr(r->physical.path.ptr, '/', len); in mod_webdav_put_prep()
4641 if (slash == r->physical.path.ptr) slash = NULL; in mod_webdav_put_prep()
4643 fd = fdevent_open_cloexec(r->physical.path.ptr, 1, in mod_webdav_put_prep()
4649 buffer_append_string_len(&r->physical.path, CONST_STR_LEN("-XXXXXX")); in mod_webdav_put_prep()
4650 fd = fdevent_mkostemp(r->physical.path.ptr, 0); in mod_webdav_put_prep()
4651 if (fd >= 0) unlink(r->physical.path.ptr); in mod_webdav_put_prep()
4652 buffer_truncate(&r->physical.path, len); in mod_webdav_put_prep()
4680 chunkqueue_append_file_fd(cq, &r->physical.path, fd, 0, cqlen); in mod_webdav_put_prep()
4683 chunkqueue_append_file_fd(cq, &r->physical.path, fd, 0, 1); in mod_webdav_put_prep()
4718 AT_FDCWD, r->physical.path.ptr, RENAME_NOREPLACE)) in mod_webdav_put_linkat_rename()
4720 else if (0 == rename(pathtemp, r->physical.path.ptr)) in mod_webdav_put_linkat_rename()
4724 http_status_set_fin(r, 0 == lstat(r->physical.path.ptr, &st) in mod_webdav_put_linkat_rename()
4728 webdav_parent_modified(&r->physical.path); in mod_webdav_put_linkat_rename()
4729 if (0 != rename(pathtemp, r->physical.path.ptr)) in mod_webdav_put_linkat_rename()
4775 const int ifd = fdevent_open_cloexec(r->physical.path.ptr, 0, in mod_webdav_put_range()
4867 if (0 == rename(pconf->tmpb->ptr, r->physical.path.ptr)) in mod_webdav_put_range()
4870 AT_FDCWD, r->physical.path.ptr, 0)) in mod_webdav_put_range()
4874 stat_cache_delete_entry(BUF_PTR_LEN(&r->physical.path)); in mod_webdav_put_range()
4957 buffer_append_str2(tmpb, BUF_PTR_LEN(&r->physical.path), in mod_webdav_put()
5014 http_status_set_fin(r, 0 == lstat(r->physical.path.ptr, &ste) in mod_webdav_put()
5018 webdav_parent_modified(&r->physical.path); in mod_webdav_put()
5019 if (0 == rename(pathtemp, r->physical.path.ptr)) { in mod_webdav_put()
5040 buffer * const dst_path = &dst->path; in mod_webdav_copymove_b()
5172 if (r->physical.path.used - 1 <= remain) { /*(should not happen)*/ in mod_webdav_copymove_b()
5177 r->physical.path.ptr + r->physical.path.used-1-remain, in mod_webdav_copymove_b()
5183 r->physical.path.ptr, in mod_webdav_copymove_b()
5184 r->physical.path.used - 1 - remain, in mod_webdav_copymove_b()
5203 if (r->physical.path.used <= dst_path->used in mod_webdav_copymove_b()
5204 && 0 == memcmp(r->physical.path.ptr, dst_path->ptr, in mod_webdav_copymove_b()
5205 r->physical.path.used-1) in mod_webdav_copymove_b()
5206 && (buffer_has_pathsep_suffix(&r->physical.path) in mod_webdav_copymove_b()
5207 || dst_path->ptr[r->physical.path.used-1] == '/' in mod_webdav_copymove_b()
5208 || dst_path->ptr[r->physical.path.used-1] == '\0')) { in mod_webdav_copymove_b()
5215 if (-1 == lstat(r->physical.path.ptr, &st)) { in mod_webdav_copymove_b()
5227 if (!buffer_has_pathsep_suffix(&r->physical.path)) { in mod_webdav_copymove_b()
5301 stat_cache_delete_dir(BUF_PTR_LEN(&r->physical.path)); in mod_webdav_copymove_b()
5304 else if (buffer_has_pathsep_suffix(&r->physical.path)) { in mod_webdav_copymove_b()
5325 if (NULL != (sep = strrchr(r->physical.path.ptr, '/'))) { in mod_webdav_copymove_b()
5326 size_t len = r->physical.path.used - 1 in mod_webdav_copymove_b()
5327 - (sep - r->physical.path.ptr); in mod_webdav_copymove_b()
5402 dst.path = *dst_path; in mod_webdav_copymove()
5405 *dst_path = dst.path; in mod_webdav_copymove()
5436 if (0 != lstat(r->physical.path.ptr, &st)) { in mod_webdav_proppatch()
5447 if (!buffer_has_pathsep_suffix(&r->physical.path)) { in mod_webdav_proppatch()
5451 buffer_append_char(&r->physical.path, '/'); in mod_webdav_proppatch()
5455 else if (buffer_has_pathsep_suffix(&r->physical.path)) { in mod_webdav_proppatch()
5569 webdav_xml_response_status(r, &r->physical.path, 200); in mod_webdav_proppatch()
5792 if (0 != lstat(r->physical.path.ptr, &st)) { in mod_webdav_lock()
5817 (errno == ENOENT && !buffer_has_pathsep_suffix(&r->physical.path)) in mod_webdav_lock()
5818 ? fdevent_open_cloexec(r->physical.path.ptr, 0, in mod_webdav_lock()
5827 webdav_parent_modified(&r->physical.path); in mod_webdav_lock()
5833 else if (0 != lstat(r->physical.path.ptr, &st)) { in mod_webdav_lock()
5850 if (!buffer_has_pathsep_suffix(&r->physical.path)) { in mod_webdav_lock()
5859 else if (buffer_has_pathsep_suffix(&r->physical.path)) { in mod_webdav_lock()
6019 force_assert(2 <= r->physical.path.used); in PHYSICALPATH_FUNC()