Lines Matching refs:hdr
541 static bool get_caller_has_rw_locked(struct fuse* fuse, const struct fuse_in_header *hdr) {
547 appid_t appid = multiuser_get_app_id(hdr->uid);
555 const struct fuse_in_header *hdr, const struct node* parent_node,
573 if (hdr->uid == 0) {
580 if (parent_node && hdr->uid == parent_node->uid) {
592 const struct fuse_in_header *hdr, const struct node* node, int mode, bool has_rw) {
593 return check_caller_access_to_name(fuse, hdr, node->parent, node->name, mode, has_rw);
781 struct fuse_out_header hdr;
782 hdr.len = sizeof(hdr);
783 hdr.error = err;
784 hdr.unique = unique;
785 write(fuse->fd, &hdr, sizeof(hdr));
790 struct fuse_out_header hdr;
794 hdr.len = len + sizeof(hdr);
795 hdr.error = 0;
796 hdr.unique = unique;
798 vec[0].iov_base = &hdr;
799 vec[0].iov_len = sizeof(hdr);
855 const struct fuse_in_header *hdr, const char* name)
863 parent_node = lookup_node_and_path_by_id_locked(fuse, hdr->nodeid,
865 TRACE("[%d] LOOKUP %s @ %"PRIx64" (%s)\n", handler->token, name, hdr->nodeid,
873 if (!check_caller_access_to_name(fuse, hdr, parent_node, name, R_OK, false)) {
877 return fuse_reply_entry(fuse, hdr->unique, parent_node, name, actual_name, child_path);
881 const struct fuse_in_header *hdr, const struct fuse_forget_in *req)
886 node = lookup_node_by_id_locked(fuse, hdr->nodeid);
888 hdr->nodeid, node ? node->name : "?");
900 const struct fuse_in_header *hdr, const struct fuse_getattr_in *req)
906 node = lookup_node_and_path_by_id_locked(fuse, hdr->nodeid, path, sizeof(path));
908 req->getattr_flags, req->fh, hdr->nodeid, node ? node->name : "?");
914 if (!check_caller_access_to_node(fuse, hdr, node, R_OK, false)) {
918 return fuse_reply_attr(fuse, hdr->unique, node, path);
922 const struct fuse_in_header *hdr, const struct fuse_setattr_in *req)
930 has_rw = get_caller_has_rw_locked(fuse, hdr);
931 node = lookup_node_and_path_by_id_locked(fuse, hdr->nodeid, path, sizeof(path));
933 req->fh, req->valid, hdr->nodeid, node ? node->name : "?");
939 if (!check_caller_access_to_node(fuse, hdr, node, W_OK, has_rw)) {
981 return fuse_reply_attr(fuse, hdr->unique, node, path);
985 const struct fuse_in_header* hdr, const struct fuse_mknod_in* req, const char* name)
994 has_rw = get_caller_has_rw_locked(fuse, hdr);
995 parent_node = lookup_node_and_path_by_id_locked(fuse, hdr->nodeid,
998 name, req->mode, hdr->nodeid, parent_node ? parent_node->name : "?");
1005 if (!check_caller_access_to_name(fuse, hdr, parent_node, name, W_OK, has_rw)) {
1012 return fuse_reply_entry(fuse, hdr->unique, parent_node, name, actual_name, child_path);
1016 const struct fuse_in_header* hdr
1025 has_rw = get_caller_has_rw_locked(fuse, hdr);
1026 parent_node = lookup_node_and_path_by_id_locked(fuse, hdr->nodeid,
1029 name, req->mode, hdr->nodeid, parent_node ? parent_node->name : "?");
1036 if (!check_caller_access_to_name(fuse, hdr, parent_node, name, W_OK, has_rw)) {
1062 return fuse_reply_entry(fuse, hdr->unique, parent_node, name, actual_name, child_path);
1066 const struct fuse_in_header* hdr, const char* name)
1074 has_rw = get_caller_has_rw_locked(fuse, hdr);
1075 parent_node = lookup_node_and_path_by_id_locked(fuse, hdr->nodeid,
1078 name, hdr->nodeid, parent_node ? parent_node->name : "?");
1085 if (!check_caller_access_to_name(fuse, hdr, parent_node, name, W_OK, has_rw)) {
1095 const struct fuse_in_header* hdr, const char* name)
1103 has_rw = get_caller_has_rw_locked(fuse, hdr);
1104 parent_node = lookup_node_and_path_by_id_locked(fuse, hdr->nodeid,
1107 name, hdr->nodeid, parent_node ? parent_node->name : "?");
1114 if (!check_caller_access_to_name(fuse, hdr, parent_node, name, W_OK, has_rw)) {
1124 const struct fuse_in_header* hdr, const struct fuse_rename_in* req,
1139 has_rw = get_caller_has_rw_locked(fuse, hdr);
1140 old_parent_node = lookup_node_and_path_by_id_locked(fuse, hdr->nodeid,
1146 hdr->nodeid, old_parent_node ? old_parent_node->name : "?",
1152 if (!check_caller_access_to_name(fuse, hdr, old_parent_node, old_name, W_OK, has_rw)) {
1156 if (!check_caller_access_to_name(fuse, hdr, new_parent_node, new_name, W_OK, has_rw)) {
1217 const struct fuse_in_header* hdr, const struct fuse_open_in* req)
1226 has_rw = get_caller_has_rw_locked(fuse, hdr);
1227 node = lookup_node_and_path_by_id_locked(fuse, hdr->nodeid, path, sizeof(path));
1229 req->flags, hdr->nodeid, node ? node->name : "?");
1235 if (!check_caller_access_to_node(fuse, hdr, node,
1252 fuse_reply(fuse, hdr->unique, &out, sizeof(out));
1257 const struct fuse_in_header* hdr, const struct fuse_read_in* req)
1260 __u64 unique = hdr->unique;
1266 /* Don't access any other fields of hdr or req beyond this point, the read buffer
1284 const struct fuse_in_header* hdr, const struct fuse_write_in* req,
1304 fuse_reply(fuse, hdr->unique, &out, sizeof(out));
1309 const struct fuse_in_header* hdr)
1335 fuse_reply(fuse, hdr->unique, &out, sizeof(out));
1340 const struct fuse_in_header* hdr, const struct fuse_release_in* req)
1351 const struct fuse_in_header* hdr, const struct fuse_fsync_in* req)
1353 bool is_dir = (hdr->opcode == FUSE_FSYNCDIR);
1376 const struct fuse_in_header* hdr)
1383 const struct fuse_in_header* hdr, const struct fuse_open_in* req)
1391 node = lookup_node_and_path_by_id_locked(fuse, hdr->nodeid, path, sizeof(path));
1393 hdr->nodeid, node ? node->name : "?");
1399 if (!check_caller_access_to_node(fuse, hdr, node, R_OK, false)) {
1415 fuse_reply(fuse, hdr->unique, &out, sizeof(out));
1420 const struct fuse_in_header* hdr, const struct fuse_read_in* req)
1443 fuse_reply(fuse, hdr->unique, fde,
1449 const struct fuse_in_header* hdr, const struct fuse_release_in* req)
1460 const struct fuse_in_header* hdr, const struct fuse_init_in* req)
1473 fuse_reply(fuse, hdr->unique, &out, sizeof(out));
1478 const struct fuse_in_header *hdr, const void *data, size_t data_len)
1480 switch (hdr->opcode) {
1483 return handle_lookup(fuse, handler, hdr, name);
1488 return handle_forget(fuse, handler, hdr, req);
1493 return handle_getattr(fuse, handler, hdr, req);
1498 return handle_setattr(fuse, handler, hdr, req);
1506 return handle_mknod(fuse, handler, hdr, req, name);
1512 return handle_mkdir(fuse, handler, hdr, req, name);
1517 return handle_unlink(fuse, handler, hdr, name);
1522 return handle_rmdir(fuse, handler, hdr, name);
1529 return handle_rename(fuse, handler, hdr, req, old_name, new_name);
1535 return handle_open(fuse, handler, hdr, req);
1540 return handle_read(fuse, handler, hdr, req);
1546 return handle_write(fuse, handler, hdr, req, buffer);
1550 return handle_statfs(fuse, handler, hdr);
1555 return handle_release(fuse, handler, hdr, req);
1561 return handle_fsync(fuse, handler, hdr, req);
1569 return handle_flush(fuse, handler, hdr);
1574 return handle_opendir(fuse, handler, hdr, req);
1579 return handle_readdir(fuse, handler, hdr, req);
1584 return handle_releasedir(fuse, handler, hdr, req);
1589 return handle_init(fuse, handler, hdr, req);
1594 handler->token, hdr->opcode, hdr->unique, hdr->nodeid);
1618 const struct fuse_in_header *hdr = (void*)handler->request_buffer;
1619 if (hdr->len != (size_t)len) {
1620 ERROR("[%d] malformed header: len=%zu, hdr->len=%u\n",
1621 handler->token, (size_t)len, hdr->len);
1627 __u64 unique = hdr->unique;
1628 int res = handle_fuse_request(fuse, handler, hdr, data, data_len);