• Home
  • Raw
  • Download

Lines Matching refs:path

71 static bool should_use_fs_config(const std::string& path) {  in should_use_fs_config()  argument
74 return !android::base::StartsWith(path, "/data/"); in should_use_fs_config()
76 UNUSED(path); in should_use_fs_config()
81 static bool update_capabilities(const char* path, uint64_t capabilities) { in update_capabilities() argument
85 removexattr(path, XATTR_NAME_CAPS); in update_capabilities()
95 return setxattr(path, XATTR_NAME_CAPS, &cap_data, sizeof(cap_data), 0) != -1; in update_capabilities()
97 UNUSED(path, capabilities); in update_capabilities()
102 static bool secure_mkdirs(const std::string& path) { in secure_mkdirs() argument
103 if (path[0] != '/') return false; in secure_mkdirs()
105 std::vector<std::string> path_components = android::base::Split(path, "/"); in secure_mkdirs()
143 static bool do_lstat_v1(int s, const char* path) { in do_lstat_v1() argument
148 lstat(path, &st); in do_lstat_v1()
155 static bool do_stat_v2(int s, uint32_t id, const char* path) { in do_stat_v2() argument
167 int rc = stat_fn(path, &st); in do_stat_v2()
187 static bool do_list(int s, const char* path) { in do_list() argument
200 std::unique_ptr<DIR, int(*)(DIR*)> d(opendir(path), closedir); in do_list()
207 std::string filename(StringPrintf("%s/%s", path, de->d_name)); in do_list()
247 static bool do_list_v1(int s, const char* path) { in do_list_v1() argument
248 return do_list<false>(s, path); in do_list_v1()
251 static bool do_list_v2(int s, const char* path) { in do_list_v2() argument
252 return do_list<true>(s, path); in do_list_v2()
347 static bool handle_send_file(borrowed_fd s, const char* path, uint32_t* timestamp, uid_t uid, in handle_send_file() argument
355 __android_log_security_bswrite(SEC_TAG_ADB_SEND_FILE, path); in handle_send_file()
356 fd.reset(adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, mode)); in handle_send_file()
359 if (!secure_mkdirs(Dirname(path))) { in handle_send_file()
363 fd.reset(adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, mode)); in handle_send_file()
366 fd.reset(adb_open_mode(path, O_WRONLY | O_CLOEXEC, mode)); in handle_send_file()
378 if (!Realpath(path, &real_path) || lstat(Dirname(real_path).c_str(), &st) == -1 || in handle_send_file()
387 selinux_android_restorecon(path, 0); in handle_send_file()
407 if (!update_capabilities(path, capabilities)) { in handle_send_file()
445 if (do_unlink) adb_unlink(path); in handle_send_file()
450 extern bool handle_send_link(int s, const std::string& path,
454 static bool handle_send_link(int s, const std::string& path, uint32_t* timestamp, bool dry_run, in handle_send_link() argument
474 if (!android::base::Readlink(path, &buf_link) || (buf_link != &buffer[0])) { in handle_send_link()
475 adb_unlink(path.c_str()); in handle_send_link()
476 auto ret = symlink(&buffer[0], path.c_str()); in handle_send_link()
478 if (!secure_mkdirs(Dirname(path))) { in handle_send_link()
482 ret = symlink(&buffer[0], path.c_str()); in handle_send_link()
507 static bool send_impl(int s, const std::string& path, mode_t mode, CompressionType compression, in send_impl() argument
513 do_unlink = (lstat(path.c_str(), &st) == -1) || S_ISREG(st.st_mode) || in send_impl()
517 adb_unlink(path.c_str()); in send_impl()
523 result = handle_send_link(s, path, &timestamp, dry_run, buffer); in send_impl()
533 if (should_use_fs_config(path) && !dry_run) { in send_impl()
534 adbd_fs_config(path.c_str(), 0, nullptr, &uid, &gid, &mode, &capabilities); in send_impl()
537 result = handle_send_file(s, path.c_str(), &timestamp, uid, gid, capabilities, mode, in send_impl()
550 lutimes(path.c_str(), tv); in send_impl()
562 std::string path = spec.substr(0, comma); in do_send_v1() local
571 return send_impl(s, path, mode, CompressionType::None, false, buffer); in do_send_v1()
574 static bool do_send_v2(int s, const std::string& path, std::vector<char>& buffer) { in do_send_v2() argument
627 return send_impl(s, path, msg.send_v2_setup.mode, compression.value_or(CompressionType::None), in do_send_v2()
631 static bool recv_impl(borrowed_fd s, const char* path, CompressionType compression, in recv_impl() argument
633 __android_log_security_bswrite(SEC_TAG_ADB_RECV_FILE, path); in recv_impl()
635 unique_fd fd(adb_open(path, O_RDONLY | O_CLOEXEC)); in recv_impl()
722 static bool do_recv_v1(borrowed_fd s, const char* path, std::vector<char>& buffer) { in do_recv_v1() argument
723 return recv_impl(s, path, CompressionType::None, buffer); in do_recv_v1()
726 static bool do_recv_v2(borrowed_fd s, const char* path, std::vector<char>& buffer) { in do_recv_v2() argument
772 return recv_impl(s, path, compression.value_or(CompressionType::None), buffer); in do_recv_v2()