• Home
  • Raw
  • Download

Lines Matching refs:path

260         : path(_path),  in fuse()
276 if (android::base::StartsWith(path, PRIMARY_VOLUME_PREFIX)) { in GetEffectiveRootPath()
277 return path + "/" + MY_USER_ID_STRING; in GetEffectiveRootPath()
279 return path; in GetEffectiveRootPath()
312 inline bool IsTranscodeSupportedPath(const string& path) { in IsTranscodeSupportedPath()
314 if (!android::base::EndsWithIgnoreCase(path, ".mp4")) { in IsTranscodeSupportedPath()
320 if (android::base::StartsWithIgnoreCase(path, base_path + relative_path)) { in IsTranscodeSupportedPath()
328 inline bool IsUncachedPath(const std::string& path) { in IsUncachedPath()
331 if (android::base::StartsWithIgnoreCase(path, base_path + relative_path)) { in IsUncachedPath()
339 inline bool ShouldNotCache(const std::string& path) { in ShouldNotCache()
350 if (!android::base::StartsWithIgnoreCase(path, PRIMARY_VOLUME_PREFIX)) { in ShouldNotCache()
355 if (android::base::EndsWith(path, "/")) { in ShouldNotCache()
356 return IsUncachedPath(path); in ShouldNotCache()
359 return IsUncachedPath(path + "/"); in ShouldNotCache()
364 const string path; member
428 static int set_file_lock(int fd, bool for_read, const std::string& path) { in set_file_lock() argument
452 static bool is_file_locked(int fd, const std::string& path) { in is_file_locked() argument
471 static bool is_package_owned_path(const string& path, const string& fuse_path) { in is_package_owned_path() argument
472 if (path.rfind(fuse_path, 0) != 0) { in is_package_owned_path()
475 return std::regex_match(path, PATTERN_OWNED_PATH); in is_package_owned_path()
478 static bool is_bpf_backing_path(const string& path) { in is_bpf_backing_path() argument
479 return std::regex_match(path, PATTERN_BPF_BACKING_PATH); in is_bpf_backing_path()
485 const string& child_name, const string& path) { in fuse_inval() argument
486 if (mediaprovider::fuse::containsMount(path)) { in fuse_inval()
498 static double get_entry_timeout(const string& path, bool should_inval, struct fuse* fuse) { in get_entry_timeout() argument
500 if (fuse->disable_dentry_cache || should_inval || is_package_owned_path(path, fuse->path) || in get_entry_timeout()
501 android::base::StartsWithIgnoreCase(path, media_path) || fuse->ShouldNotCache(path)) { in get_entry_timeout()
527 static inline bool is_synthetic_path(const string& path, struct fuse* fuse) { in is_synthetic_path() argument
529 path, fuse->GetTransformsDir() + "/" + TRANSFORM_SYNTHETIC_DIR); in is_synthetic_path()
532 static inline bool is_transforms_dir_path(const string& path, struct fuse* fuse) { in is_transforms_dir_path() argument
533 return android::base::StartsWithIgnoreCase(path, fuse->GetTransformsDir()); in is_transforms_dir_path()
537 const std::string& path, const std::string& name, fuse_req_t req, int* error_code, in validate_node_path() argument
543 const bool synthetic_path = is_synthetic_path(path, fuse); in validate_node_path()
544 if (lstat(path.c_str(), &e->attr) < 0 && !(op == FuseOp::lookup && synthetic_path)) { in validate_node_path()
549 if (is_transforms_dir_path(path, fuse)) { in validate_node_path()
552 if (!(android::base::EqualsIgnoreCase(path, fuse->GetTransformsDir()) || in validate_node_path()
554 path, fuse->GetTransformsDir() + "/" + TRANSFORM_SYNTHETIC_DIR))) { in validate_node_path()
572 if (!synthetic_path && !fuse->IsTranscodeSupportedPath(path)) { in validate_node_path()
579 fuse->mp->FileLookup(path, req->ctx.uid, req->ctx.pid); in validate_node_path()
583 LOG(WARNING) << "Failed to fetch FileLookupResult for " << path; in validate_node_path()
598 static node* make_node_entry(fuse_req_t req, node* parent, const string& name, const string& path, in make_node_entry() argument
607 validate_node_path(path, name, req, error_code, e, op); in make_node_entry()
628 } else if (!mediaprovider::fuse::containsMount(path)) { in make_node_entry()
647 std::thread t([=]() { fuse_inval(fuse->se, parent_ino, child_ino, node_name, path); }); in make_node_entry()
662 if (should_invalidate && fuse->IsTranscodeSupportedPath(path)) { in make_node_entry()
692 if (!fuse->bpf || !is_bpf_backing_path(path)) { in make_node_entry()
693 e->entry_timeout = get_entry_timeout(path, should_invalidate, fuse); in make_node_entry()
758 LOG(INFO) << "DESTROY " << fuse->path; in pf_destroy()
764 static bool is_app_accessible_path(struct fuse* fuse, const string& path, uid_t uid) { in is_app_accessible_path() argument
771 if (path == PRIMARY_VOLUME_PREFIX) { in is_app_accessible_path()
778 if (std::regex_match(path, match, PATTERN_OWNED_PATH)) { in is_app_accessible_path()
785 if (!fuse->bpf && android::base::StartsWith(path, PRIMARY_VOLUME_PREFIX)) { in is_app_accessible_path()
788 LOG(WARNING) << "Rejected access to app-private dir on FUSE: " << path in is_app_accessible_path()
792 if (!mp->isUidAllowedAccessToDataOrObbPath(uid, path)) { in is_app_accessible_path()
793 PLOG(WARNING) << "Invalid other package file access from " << uid << "(: " << path; in is_app_accessible_path()
800 void fuse_bpf_fill_entries(const string& path, const int bpf_fd, struct fuse_entry_param* e, in fuse_bpf_fill_entries() argument
810 backing_fd = open(path.c_str(), O_CLOEXEC | O_DIRECTORY | O_RDONLY); in fuse_bpf_fill_entries()
812 PLOG(ERROR) << "Failed to open: " << path; in fuse_bpf_fill_entries()
836 } else if (is_package_owned_path(child_path, fuse->path)) { in fuse_bpf_install()
954 const string& path = get_path(node); in pf_getattr() local
955 if (!is_app_accessible_path(fuse, path, req->ctx.uid)) { in pf_getattr()
963 if (lstat(path.c_str(), &s) < 0) { in pf_getattr()
982 const string& path = get_path(node); in pf_setattr() local
983 if (!is_app_accessible_path(fuse, path, req->ctx.uid)) { in pf_setattr()
996 path, path, ctx->uid, ctx->pid, node->GetTransformsReason(), true /* for_write */, in pf_setattr()
1018 res = truncate64(path.c_str(), attr->st_size); in pf_setattr()
1057 res = utimensat(-1, path.c_str(), times, 0); in pf_setattr()
1068 lstat(path.c_str(), attr); in pf_setattr()
1076 const string& path = node ? get_path(node) : ""; in pf_canonical_path() local
1078 if (node && is_app_accessible_path(fuse, path, req->ctx.uid)) { in pf_canonical_path()
1080 fuse_reply_canonical_path(req, path.c_str()); in pf_canonical_path()
1333 static handle* create_handle_for_node(struct fuse* fuse, const string& path, int fd, uid_t uid, in create_handle_for_node() argument
1379 is_file_locked(fd, path) || fuse->ShouldNotCache(path); in create_handle_for_node()
1407 static OpenInfo parse_open_flags(const string& path, const int in_flags) { in parse_open_flags() argument
1416 if (android::base::StartsWith(path, PRIMARY_VOLUME_PREFIX)) { in parse_open_flags()
1770 const string path = node->BuildPath(); in pf_opendir() local
1771 if (!is_app_accessible_path(fuse, path, ctx->uid)) { in pf_opendir()
1778 int status = fuse->mp->IsOpendirAllowed(path, ctx->uid, /* forWrite */ false); in pf_opendir()
1784 DIR* dir = opendir(path.c_str()); in pf_opendir()
1820 const string path = node->BuildPath(); in do_readdir_common() local
1821 if (!is_app_accessible_path(fuse, path, req->ctx.uid)) { in do_readdir_common()
1832 h->de = fuse->mp->GetDirectoryEntries(req->ctx.uid, path, h->d); in do_readdir_common()
1968 const string path = node->BuildPath(); in pf_access() local
1969 if (path != PRIMARY_VOLUME_PREFIX && !is_app_accessible_path(fuse, path, req->ctx.uid)) { in pf_access()
1977 int res = access(path.c_str(), F_OK); in pf_access()
1982 if (lstat(path.c_str(), &stat)) { in pf_access()
1993 if (path == PRIMARY_VOLUME_PREFIX && mask == X_OK) { in pf_access()
1996 int res = access(path.c_str(), X_OK); in pf_access()
2000 status = fuse->mp->IsOpendirAllowed(path, req->ctx.uid, for_write); in pf_access()
2009 path, path, req->ctx.uid, req->ctx.pid, node->GetTransformsReason(), for_write, in pf_access()
2200 bool FuseDaemon::ShouldOpenWithFuse(int fd, bool for_read, const std::string& path) { in ShouldOpenWithFuse() argument
2212 const node* node = node::LookupAbsolutePath(fuse->root, path); in ShouldOpenWithFuse()
2219 use_fuse = set_file_lock(fd, for_read, path); in ShouldOpenWithFuse()
2232 void FuseDaemon::InvalidateFuseDentryCache(const std::string& path) { in InvalidateFuseDentryCache() argument
2240 const node* node = node::LookupAbsolutePath(fuse->root, path); in InvalidateFuseDentryCache()
2249 fuse_inval(fuse->se, parent, child, name, path); in InvalidateFuseDentryCache()
2273 void FuseDaemon::Start(android::base::unique_fd fd, const std::string& path, in Start() argument
2284 if (lstat(path.c_str(), &stat)) { in Start()
2285 PLOG(ERROR) << "ERROR: failed to stat source " << path; in Start()
2295 if (fuse_opt_add_arg(&args, path.c_str()) || fuse_opt_add_arg(&args, "-odebug") || in Start()
2315 struct fuse fuse_default(path, stat.st_ino, uncached_mode, bpf_enabled, bpf_fd, in Start()
2356 se->mountpoint = strdup(path.c_str()); in Start()
2402 void FuseDaemon::InitializeDeviceId(const std::string& path) { in InitializeDeviceId() argument
2405 if (lstat(path.c_str(), &stat)) { in InitializeDeviceId()
2406 PLOG(ERROR) << "InitializeDeviceId failed to stat given path " << path; in InitializeDeviceId()