Lines Matching refs:path
269 : path(_path), in fuse()
285 if (android::base::StartsWith(path, PRIMARY_VOLUME_PREFIX)) { in GetEffectiveRootPath()
286 return path + "/" + MY_USER_ID_STRING; in GetEffectiveRootPath()
288 return path; in GetEffectiveRootPath()
321 inline bool IsTranscodeSupportedPath(const string& path) { in IsTranscodeSupportedPath()
323 if (!android::base::EndsWithIgnoreCase(path, ".mp4")) { in IsTranscodeSupportedPath()
329 if (android::base::StartsWithIgnoreCase(path, base_path + relative_path)) { in IsTranscodeSupportedPath()
337 inline bool IsUncachedPath(const std::string& path) { in IsUncachedPath()
340 if (android::base::StartsWithIgnoreCase(path, base_path + relative_path)) { in IsUncachedPath()
348 inline bool ShouldNotCache(const std::string& path) { in ShouldNotCache()
359 if (!android::base::StartsWithIgnoreCase(path, PRIMARY_VOLUME_PREFIX)) { in ShouldNotCache()
364 if (android::base::EndsWith(path, "/")) { in ShouldNotCache()
365 return IsUncachedPath(path); in ShouldNotCache()
368 return IsUncachedPath(path + "/"); in ShouldNotCache()
373 const string path; member
441 static int set_file_lock(int fd, bool for_read, const std::string& path) { in set_file_lock() argument
465 static bool is_file_locked(int fd, const std::string& path) { in is_file_locked() argument
484 static bool is_package_owned_path(const string& path, const string& fuse_path) { in is_package_owned_path() argument
485 if (path.rfind(fuse_path, 0) != 0) { in is_package_owned_path()
488 return std::regex_match(path, PATTERN_OWNED_PATH); in is_package_owned_path()
491 static bool is_bpf_backing_path(const string& path) { in is_bpf_backing_path() argument
492 return std::regex_match(path, PATTERN_BPF_BACKING_PATH); in is_bpf_backing_path()
498 const string& child_name, const string& path) { in fuse_inval() argument
499 if (mediaprovider::fuse::containsMount(path)) { in fuse_inval()
511 static double get_entry_timeout(const string& path, bool should_inval, struct fuse* fuse) { in get_entry_timeout() argument
512 if (fuse->disable_dentry_cache || should_inval || is_package_owned_path(path, fuse->path) || in get_entry_timeout()
513 fuse->ShouldNotCache(path)) { in get_entry_timeout()
536 static inline bool is_synthetic_path(const string& path, struct fuse* fuse) { in is_synthetic_path() argument
538 path, fuse->GetTransformsDir() + "/" + TRANSFORM_SYNTHETIC_DIR); in is_synthetic_path()
541 static inline bool is_transforms_dir_path(const string& path, struct fuse* fuse) { in is_transforms_dir_path() argument
542 return android::base::StartsWithIgnoreCase(path, fuse->GetTransformsDir()); in is_transforms_dir_path()
546 const std::string& path, const std::string& name, fuse_req_t req, int* error_code, in validate_node_path() argument
552 const bool synthetic_path = is_synthetic_path(path, fuse); in validate_node_path()
553 if (lstat(path.c_str(), &e->attr) < 0 && !(op == FuseOp::lookup && synthetic_path)) { in validate_node_path()
558 if (is_transforms_dir_path(path, fuse)) { in validate_node_path()
561 if (!(android::base::EqualsIgnoreCase(path, fuse->GetTransformsDir()) || in validate_node_path()
563 path, fuse->GetTransformsDir() + "/" + TRANSFORM_SYNTHETIC_DIR))) { in validate_node_path()
581 if (!synthetic_path && !fuse->IsTranscodeSupportedPath(path)) { in validate_node_path()
588 fuse->mp->FileLookup(path, req->ctx.uid, req->ctx.pid); in validate_node_path()
592 LOG(WARNING) << "Failed to fetch FileLookupResult for " << path; in validate_node_path()
608 const string& parent_path, const string& path, in make_node_entry() argument
617 validate_node_path(path, name, req, error_code, e, op); in make_node_entry()
638 } else if (!mediaprovider::fuse::containsMount(path)) { in make_node_entry()
657 std::thread t([=]() { fuse_inval(fuse->se, parent_ino, child_ino, node_name, path); }); in make_node_entry()
672 if (should_invalidate && fuse->IsTranscodeSupportedPath(path)) { in make_node_entry()
703 e->entry_timeout = get_entry_timeout(path, should_invalidate, fuse); in make_node_entry()
704 e->attr_timeout = fuse->ShouldNotCache(path) ? 0 : std::numeric_limits<double>::max(); in make_node_entry()
784 if (android::base::StartsWith(fuse->path, PRIMARY_VOLUME_PREFIX)) { in removeLevelDbConnection()
790 std::string volume_name = (fuse->path).substr(9); in removeLevelDbConnection()
801 LOG(INFO) << "DESTROY " << fuse->path; in pf_destroy()
807 static bool is_app_accessible_path(struct fuse* fuse, const string& path, uid_t uid) { in is_app_accessible_path() argument
814 if (path == PRIMARY_VOLUME_PREFIX) { in is_app_accessible_path()
821 if (std::regex_match(path, match, PATTERN_OWNED_PATH)) { in is_app_accessible_path()
828 if (!fuse->bpf && android::base::StartsWith(path, PRIMARY_VOLUME_PREFIX)) { in is_app_accessible_path()
831 LOG(WARNING) << "Rejected access to app-private dir on FUSE: " << path in is_app_accessible_path()
835 if (!mp->isUidAllowedAccessToDataOrObbPath(uid, path)) { in is_app_accessible_path()
836 PLOG(WARNING) << "Invalid other package file access from " << uid << "(: " << path; in is_app_accessible_path()
843 void fuse_bpf_fill_entries(const string& path, const int bpf_fd, struct fuse_entry_param* e, in fuse_bpf_fill_entries() argument
854 backing_fd = open(path.c_str(), O_CLOEXEC | O_DIRECTORY | O_RDONLY); in fuse_bpf_fill_entries()
856 PLOG(ERROR) << "Failed to open: " << path; in fuse_bpf_fill_entries()
880 } else if (is_package_owned_path(child_path, fuse->path)) { in fuse_bpf_install()
888 static bool is_user_accessible_path(fuse_req_t req, const struct fuse* fuse, const string& path) { in is_user_accessible_path() argument
890 std::regex_search(path, match, storage_emulated_regex); in is_user_accessible_path()
980 const string path = parent_node->BuildPath() + "/" + name; in pf_lookup_postfilter() local
982 !fuse->mp->isUidAllowedAccessToDataOrObbPath(req->ctx.uid, path)) { in pf_lookup_postfilter()
1048 const string& path = get_path(node); in pf_getattr() local
1049 if (!is_app_accessible_path(fuse, path, req->ctx.uid)) { in pf_getattr()
1057 if (lstat(path.c_str(), &s) < 0) { in pf_getattr()
1061 fuse->ShouldNotCache(path) ? 0 : std::numeric_limits<double>::max()); in pf_getattr()
1077 const string& path = get_path(node); in pf_setattr() local
1078 if (!is_app_accessible_path(fuse, path, req->ctx.uid)) { in pf_setattr()
1091 path, path, ctx->uid, ctx->pid, node->GetTransformsReason(), true /* for_write */, in pf_setattr()
1113 res = truncate64(path.c_str(), attr->st_size); in pf_setattr()
1152 res = utimensat(-1, path.c_str(), times, 0); in pf_setattr()
1163 lstat(path.c_str(), attr); in pf_setattr()
1164 fuse_reply_attr(req, attr, fuse->ShouldNotCache(path) ? 0 : std::numeric_limits<double>::max()); in pf_setattr()
1171 const string& path = node ? get_path(node) : ""; in pf_canonical_path() local
1173 if (node && is_app_accessible_path(fuse, path, req->ctx.uid)) { in pf_canonical_path()
1175 fuse_reply_canonical_path(req, path.c_str()); in pf_canonical_path()
1433 static handle* create_handle_for_node(struct fuse* fuse, const string& path, int fd, uid_t uid, in create_handle_for_node() argument
1479 is_file_locked(fd, path) || fuse->ShouldNotCache(path); in create_handle_for_node()
1507 static OpenInfo parse_open_flags(const string& path, const int in_flags) { in parse_open_flags() argument
1516 if (android::base::StartsWith(path, PRIMARY_VOLUME_PREFIX)) { in parse_open_flags()
1873 const string path = node->BuildPath(); in pf_opendir() local
1874 if (!is_app_accessible_path(fuse, path, ctx->uid)) { in pf_opendir()
1881 int status = fuse->mp->IsOpendirAllowed(path, ctx->uid, /* forWrite */ false); in pf_opendir()
1887 DIR* dir = opendir(path.c_str()); in pf_opendir()
1923 const string path = node->BuildPath(); in do_readdir_common() local
1924 if (!is_app_accessible_path(fuse, path, req->ctx.uid)) { in do_readdir_common()
1933 if (!is_user_accessible_path(req, fuse, path)) { in do_readdir_common()
1943 h->de = fuse->mp->GetDirectoryEntries(req->ctx.uid, path, h->d); in do_readdir_common()
2034 const string path = node->BuildPath(); in pf_readdir_postfilter() local
2047 std::string child_path = path + "/" + child_name; in pf_readdir_postfilter()
2135 const string path = node->BuildPath(); in pf_access() local
2136 if (path != PRIMARY_VOLUME_PREFIX && !is_app_accessible_path(fuse, path, req->ctx.uid)) { in pf_access()
2144 int res = access(path.c_str(), F_OK); in pf_access()
2149 if (lstat(path.c_str(), &stat)) { in pf_access()
2160 if (path == PRIMARY_VOLUME_PREFIX && mask == X_OK) { in pf_access()
2163 int res = access(path.c_str(), X_OK); in pf_access()
2167 status = fuse->mp->IsOpendirAllowed(path, req->ctx.uid, for_write); in pf_access()
2176 path, path, req->ctx.uid, req->ctx.pid, node->GetTransformsReason(), for_write, in pf_access()
2367 bool FuseDaemon::ShouldOpenWithFuse(int fd, bool for_read, const std::string& path) { in ShouldOpenWithFuse() argument
2379 const node* node = node::LookupAbsolutePath(fuse->root, path); in ShouldOpenWithFuse()
2386 use_fuse = set_file_lock(fd, for_read, path); in ShouldOpenWithFuse()
2399 void FuseDaemon::InvalidateFuseDentryCache(const std::string& path) { in InvalidateFuseDentryCache() argument
2407 const node* node = node::LookupAbsolutePath(fuse->root, path); in InvalidateFuseDentryCache()
2416 std::thread t([=]() { fuse_inval(fuse->se, parent, child, name, path); }); in InvalidateFuseDentryCache()
2467 void FuseDaemon::Start(android::base::unique_fd fd, const std::string& path, in Start() argument
2478 if (lstat(path.c_str(), &stat)) { in Start()
2479 PLOG(ERROR) << "ERROR: failed to stat source " << path; in Start()
2489 if (fuse_opt_add_arg(&args, path.c_str()) || fuse_opt_add_arg(&args, "-odebug") || in Start()
2512 struct fuse fuse_default(path, stat.st_ino, uncached_mode, bpf_enabled, std::move(bpf_fd), in Start()
2553 se->mountpoint = strdup(path.c_str()); in Start()
2599 void FuseDaemon::InitializeDeviceId(const std::string& path) { in InitializeDeviceId() argument
2602 if (lstat(path.c_str(), &stat)) { in InitializeDeviceId()
2603 PLOG(ERROR) << "InitializeDeviceId failed to stat given path " << path; in InitializeDeviceId()
2654 std::string deriveVolumeName(const std::string& path) { in deriveVolumeName() argument
2656 if (!android::base::StartsWith(path, STORAGE_PREFIX)) { in deriveVolumeName()
2658 } else if (android::base::StartsWith(path, PRIMARY_VOLUME_PREFIX)) { in deriveVolumeName()
2662 volume_name = path.substr(9, 9); in deriveVolumeName()