]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: Rework vxattr_cb_fscrypt_file_set to assign properly
authorChristopher Hoffman <choffman@redhat.com>
Mon, 21 Apr 2025 12:28:16 +0000 (12:28 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Fri, 15 Aug 2025 16:03:31 +0000 (16:03 +0000)
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/client/Client.cc

index 2a864a6092d9178a896d9afc20d4c8657b156fce..b1daaeb5d9650ac41f7023aa0640323716615f5d 100644 (file)
@@ -15174,8 +15174,12 @@ int Client::_vxattrcb_fscrypt_file_set(Inode *in, const void *val, size_t size,
   std::vector<uint8_t> aux;
 
   aux.resize(sizeof(uint64_t));
-  memcpy(aux.data(), val, size);
+  uint64_t the_size;
+
+  memcpy(&the_size, val, size);
+  *(ceph_le64 *)aux.data() = the_size;
 
+  // TODO: rework _do_setattr to pass mask CEPH_SETATTR_FSCRYPT_FILE
   return _do_setattr(in, &stx, CEPH_SETATTR_SIZE, perms, nullptr, &aux);
 }