Lines Matching refs:ptr

549                     if (!mod_webdav_sqlite3_init(cpv->v.b->ptr, srv->errh))  in SETDEFAULTS_FUNC()
587 "unrecognized webdav.opts: %s", ds->key.ptr); in SETDEFAULTS_FUNC()
711 typedef struct { const char *ptr; uint32_t used; uint32_t size; } tagb; member
730 webdav_property_name *ptr; member
778 s = c->mem->ptr + c->offset; in webdav_xml_log_response()
1003 iov[1].iov_base = lockdata->ownerinfo.ptr; in webdav_xml_activelock()
1467 const char * const dbname = cpv->v.b->ptr; in SERVER_FUNC()
1552 && 0 == memcmp(lockdata->lockroot.ptr, text, text_len) in webdav_lock_match()
1587 lockdata->locktoken.ptr = (char *)sqlite3_column_text(stmt, 0); in webdav_lock_activelocks_lockdata()
1589 lockdata->lockroot.ptr = (char *)sqlite3_column_text(stmt, 1); in webdav_lock_activelocks_lockdata()
1596 lockdata->owner->ptr = (char *)sqlite3_column_text(stmt, 4); in webdav_lock_activelocks_lockdata()
1598 lockdata->ownerinfo.ptr = (char *)sqlite3_column_text(stmt, 5); in webdav_lock_activelocks_lockdata()
2347 const char * const semi = strchr(vb->ptr, ';'); in webdav_reqbody_type_xml()
2348 uint32_t len = semi ? (uint32_t)(semi - vb->ptr) : buffer_clen(vb); in webdav_reqbody_type_xml()
2349 return ((len==15 && 0==memcmp(vb->ptr, "application/xml", 15)) in webdav_reqbody_type_xml()
2350 || (len==8 && 0==memcmp(vb->ptr, "text/xml", 8))); in webdav_reqbody_type_xml()
2376 st = (0 == lstat(r->physical.path.ptr, &stp)) ? &stp : NULL; in webdav_if_match_or_unmodified_since()
2385 if (NULL == st || !http_etag_matches(etagb, im->ptr, 0)) in webdav_if_match_or_unmodified_since()
2392 : http_etag_matches(etagb, inm->ptr, 1)) in webdav_if_match_or_unmodified_since()
2424 const char *fn = path->ptr; in webdav_parent_modified()
2445 switch (*h->ptr) { in webdav_parse_Depth()
2484 if (0 == unlink(dst->path.ptr)) { 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()
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()
2559 dst->rel_path.ptr[(dst->rel_path.used = dst_rel_path_used)-1]='\0'; in webdav_delete_dir()
2580 dst->path.ptr[ (dst->path.used = dst_path_used) -1] = '\0'; in webdav_delete_dir()
2581 dst->rel_path.ptr[(dst->rel_path.used = dst_rel_path_used)-1] = '\0'; in webdav_delete_dir()
2587 if (0 == rmdir(dst->path.ptr)) in webdav_delete_dir()
2626 && 0 == linkat(AT_FDCWD, src->ptr, AT_FDCWD, tmpb->ptr, 0)) { in webdav_linktmp_rename()
2628 rc = rename(tmpb->ptr, dst->ptr); in webdav_linktmp_rename()
2640 unlink(tmpb->ptr); in webdav_linktmp_rename()
2658 if (0==clonefile(src->path.ptr,dst->path.ptr,CLONE_NOFOLLOW)) 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()
2755 const int ofd = fdevent_open_cloexec(tmpb->ptr, 0, in webdav_copytmp_rename()
2859 unlink(tmpb->ptr); in webdav_copytmp_rename()
2877 if (0 == lstat(dst->path.ptr, &stb) || errno != ENOENT) { in webdav_copytmp_rename()
2878 unlink(tmpb->ptr); in webdav_copytmp_rename()
2884 if (0 == rename(tmpb->ptr, dst->path.ptr)) in webdav_copytmp_rename()
2886 if (0 == renameat2(AT_FDCWD, tmpb->ptr, in webdav_copytmp_rename()
2887 AT_FDCWD, dst->path.ptr, in webdav_copytmp_rename()
2898 unlink(tmpb->ptr); 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()
2955 if (0 == linkat(AT_FDCWD, src->path.ptr, AT_FDCWD, dst->path.ptr, 0)){ in webdav_copymove_file()
2990 if (0 == mkdir(dst->path.ptr, WEBDAV_DIR_MODE)) { 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()
3032 dst->rel_path.ptr[dst->rel_path.used-2] = '\0'; in webdav_mkdir()
3034 dst->path.ptr[dst->path.used-2] = '/'; /*(restore slash)*/ in webdav_mkdir()
3035 dst->rel_path.ptr[dst->rel_path.used-2] = '/'; 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()
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()
3158 dst->rel_path.ptr[dst->rel_path.used-2] = '\0'; in webdav_copymove_dir()
3160 dst->path.ptr[dst->path.used-2] = '/'; /*(restore slash)*/ in webdav_copymove_dir()
3161 dst->rel_path.ptr[dst->rel_path.used-2] = '/'; in webdav_copymove_dir()
3167 if (0 == rename(src->path.ptr, dst->path.ptr)) { 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()
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()
3260 src->rel_path.ptr[(src->rel_path.used = src_rel_path_used)-1]='\0'; in webdav_copymove_dir()
3261 dst->path.ptr[ (dst->path.used = dst_path_used) -1]='\0'; in webdav_copymove_dir()
3262 dst->rel_path.ptr[(dst->rel_path.used = dst_rel_path_used)-1]='\0'; in webdav_copymove_dir()
3295 src->path.ptr[ (src->path.used = src_path_used) -1] = '\0'; in webdav_copymove_dir()
3296 src->rel_path.ptr[(src->rel_path.used = src_rel_path_used)-1] = '\0'; in webdav_copymove_dir()
3297 dst->path.ptr[ (dst->path.used = dst_path_used) -1] = '\0'; in webdav_copymove_dir()
3298 dst->rel_path.ptr[(dst->rel_path.used = dst_rel_path_used)-1] = '\0'; in webdav_copymove_dir()
3593 const webdav_property_name *prop = props->ptr; in webdav_propfind_resource_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()
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()
3790 dst->rel_path.ptr[(dst->rel_path.used = dst_rel_path_used)-1]='\0'; in webdav_propfind_dir()
3804 dst->path.ptr[ (dst->path.used = dst_path_used) -1] = '\0'; in webdav_propfind_dir()
3805 dst->rel_path.ptr[(dst->rel_path.used = dst_rel_path_used)-1] = '\0'; in webdav_propfind_dir()
3858 xmlstr = c->mem->ptr + c->offset; in webdav_parse_chunkqueue()
4035 char *p = h->ptr; in webdav_has_lock()
4072 if (0 != lstat(r->physical.path.ptr, &st)) { in webdav_has_lock()
4117 cbdata.tokens[cbdata.used].ptr = p+1; in webdav_has_lock()
4123 (uint32_t)(p - cbdata.tokens[cbdata.used].ptr + 1); 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()
4254 pb.proplist.ptr = NULL; in mod_webdav_propfind()
4290 free(pb.proplist.ptr); in mod_webdav_propfind()
4302 free(pb.proplist.ptr); in mod_webdav_propfind()
4306 ck_realloc_u32((void **)&pb.proplist.ptr, in mod_webdav_propfind()
4308 32, sizeof(*pb.proplist.ptr)); in mod_webdav_propfind()
4326 pb.proplist.ptr[pb.proplist.used].ns = ""; in mod_webdav_propfind()
4327 pb.proplist.ptr[pb.proplist.used].nslen = 0; in mod_webdav_propfind()
4328 pb.proplist.ptr[pb.proplist.used].name = NULL; in mod_webdav_propfind()
4329 pb.proplist.ptr[pb.proplist.used].namelen = in mod_webdav_propfind()
4344 pb.proplist.ptr + pb.proplist.used++; in mod_webdav_propfind()
4360 if (NULL == pb.proplist.ptr && !pb.propname) in mod_webdav_propfind()
4391 if (pb.proplist.ptr) in mod_webdav_propfind()
4392 free(pb.proplist.ptr); in mod_webdav_propfind()
4421 if (NULL != strchr(r->target_orig.ptr, '#')) { in mod_webdav_delete()
4427 if (-1 == lstat(r->physical.path.ptr, &st)) { in mod_webdav_delete()
4566 fd = fdevent_open_cloexec(r->physical.path.ptr, 0, in mod_webdav_put_0()
4590 fd = fdevent_open_cloexec(r->physical.path.ptr, 0, in mod_webdav_put_0()
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()
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()
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()
4729 if (0 != rename(pathtemp, r->physical.path.ptr)) in mod_webdav_put_linkat_rename()
4761 const char *num = h->ptr; in mod_webdav_put_range()
4775 const int ifd = fdevent_open_cloexec(r->physical.path.ptr, 0, in mod_webdav_put_range()
4804 fd = fdevent_open_cloexec(pconf->tmpb->ptr, 0, in mod_webdav_put_range()
4808 unlink(pconf->tmpb->ptr); in mod_webdav_put_range()
4853 unlink(pconf->tmpb->ptr); in mod_webdav_put_range()
4867 if (0 == rename(pconf->tmpb->ptr, r->physical.path.ptr)) in mod_webdav_put_range()
4869 if (0 == renameat2(AT_FDCWD, pconf->tmpb->ptr, in mod_webdav_put_range()
4870 AT_FDCWD, r->physical.path.ptr, 0)) in mod_webdav_put_range()
4883 unlink(pconf->tmpb->ptr); in mod_webdav_put_range()
4972 const char *pathtemp = tmpb->ptr; in mod_webdav_put()
5014 http_status_set_fin(r, 0 == lstat(r->physical.path.ptr, &ste) in mod_webdav_put()
5019 if (0 == rename(pathtemp, r->physical.path.ptr)) { in mod_webdav_put()
5058 || ((h->ptr[0] & 0xdf) != 'F' && (h->ptr[0] & 0xdf) != 'T')) { in mod_webdav_copymove_b()
5062 if ((h->ptr[0] & 0xdf) == 'F') in mod_webdav_copymove_b()
5088 const char *sep = destination->ptr, *start; in mod_webdav_copymove_b()
5092 if (0 != strncmp(start, r->uri.scheme.ptr, sep - start) in mod_webdav_copymove_b()
5119 ? destination->ptr + destination->used-1 - start in mod_webdav_copymove_b()
5132 if (buffer_is_blank(dst_rel_path) || dst_rel_path->ptr[0] != '/') { in mod_webdav_copymove_b()
5166 const char * const p1 = r->physical.rel_path.ptr; in mod_webdav_copymove_b()
5167 const char * const p2 = dst_rel_path->ptr; in mod_webdav_copymove_b()
5176 if (0 == memcmp(r->physical.rel_path.ptr+i, /*(suffix match)*/ 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()
5185 dst_rel_path->ptr+i, in mod_webdav_copymove_b()
5204 && 0 == memcmp(r->physical.path.ptr, dst_path->ptr, 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()
5257 if (0 == lstat(dst_path->ptr, &st)) { in mod_webdav_copymove_b()
5320 int rc = lstat(dst_path->ptr, &st); in mod_webdav_copymove_b()
5325 if (NULL != (sep = strrchr(r->physical.path.ptr, '/'))) { in mod_webdav_copymove_b()
5327 - (sep - r->physical.path.ptr); in mod_webdav_copymove_b()
5338 rc = lstat(dst_path->ptr, &st); in mod_webdav_copymove_b()
5350 if ((slash = strrchr(dst_path->ptr, '/'))) { in mod_webdav_copymove_b()
5352 if (0 == lstat(dst_path->ptr, &st) && S_ISDIR(st.st_mode)) { in mod_webdav_copymove_b()
5436 if (0 != lstat(r->physical.path.ptr, &st)) { in mod_webdav_proppatch()
5563 if (vb && 0 == strncmp(vb->ptr, "Microsoft-WebDAV-MiniRedir/", in mod_webdav_proppatch()
5662 { r->physical.rel_path.ptr, r->physical.rel_path.used, 0}, /*lockroot*/ in mod_webdav_lock()
5676 const char *p = h->ptr; in mod_webdav_lock()
5758 lockdata.ownerinfo.ptr = in mod_webdav_lock()
5760 if (lockdata.ownerinfo.ptr) in mod_webdav_lock()
5761 lockdata.ownerinfo.used = strlen(lockdata.ownerinfo.ptr)+1; in mod_webdav_lock()
5792 if (0 != lstat(r->physical.path.ptr, &st)) { in mod_webdav_lock()
5818 ? fdevent_open_cloexec(r->physical.path.ptr, 0, in mod_webdav_lock()
5833 else if (0 != lstat(r->physical.path.ptr, &st)) { in mod_webdav_lock()
5870 lockdata.locktoken.ptr = lockstr+1; /*(without surrounding <>)*/ in mod_webdav_lock()
5894 xmlFree(lockdata.ownerinfo.ptr); in mod_webdav_lock()
5901 || h->used < 6 || h->ptr[1] != '<' || h->ptr[h->used-3] != '>') { in mod_webdav_lock()
5907 lockdata.locktoken.ptr = h->ptr+2; in mod_webdav_lock()
5936 || h->used < 4 || h->ptr[0] != '<' || h->ptr[h->used-2] != '>') { in mod_webdav_unlock()
5947 { h->ptr+1, h->used-2, 0 }, /* locktoken (remove < > around token) */ in mod_webdav_unlock()
5948 { r->physical.rel_path.ptr, r->physical.rel_path.used, 0}, /*lockroot*/ in mod_webdav_unlock()