]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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>
Wed, 5 Nov 2025 13:59:35 +0000 (13:59 +0000)
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/client/Client.cc

index 43ffb082e8c38d5f22bbc75f0655f608c7cd21f9..04a3f4f24ccd8fb6c099609c09aaae52defb91b2 100644 (file)
@@ -15291,8 +15291,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);
 }