]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: Do not encrypt '.' or '..'
authorChristopher Hoffman <choffman@redhat.com>
Fri, 24 Jan 2025 14:28:11 +0000 (14:28 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Wed, 5 Nov 2025 13:59:34 +0000 (13:59 +0000)
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/client/FSCrypt.cc

index b1ca273afce080b5f04c4018aff21b90972a245c..cea679d437209da152b67510239dd6d571a14763 100644 (file)
@@ -737,6 +737,10 @@ int FSCryptFNameDenc::get_encrypted_name_length(const int& plain_size) const
 
 int FSCryptFNameDenc::get_encrypted_fname(const std::string& plain, std::string *encrypted, std::string *alt_name)
 {
+  if (plain == "." || plain == ".." ) {
+    *encrypted = plain;
+    return plain.length();
+  }
   auto plain_size = plain.size();
   auto filename_padded_size = get_encrypted_name_length(plain_size);