archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <>
Subject: [PATCH 3/3] common/encrypt: accept '-' character in no-key names
Date: Sun, 18 Jul 2021 14:06:58 -0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: Eric Biggers <>

Add the '-' character to the regex that generic/{419,429} use to match
no-key filenames.  This is needed to prevent these tests from failing
after the kernel is changed to use a more standard variant of Base64

Note that despite breaking these tests, the kernel change is not
expected to break any real users, as the fscrypt no-key name encoding
has always been considered an implementation detail.  So it is
appropriate to just update these tests.

Signed-off-by: Eric Biggers <>
 common/encrypt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/encrypt b/common/encrypt
index 766a6d81..f90c4ef0 100644
--- a/common/encrypt
+++ b/common/encrypt
@@ -935,5 +935,8 @@ _filter_nokey_filenames()
 	local dir=$1
-	sed "s|${dir}${dir:+/}[A-Za-z0-9+,_]\+|${dir}${dir:+/}NOKEY_NAME|g"
+	# The no-key name format is a filesystem implementation detail that has
+	# varied slightly over time.  Just look for names that consist entirely
+	# of characters that have ever been used in such names.
+	sed "s|${dir}${dir:+/}[A-Za-z0-9+,_-]\+|${dir}${dir:+/}NOKEY_NAME|g"

      parent reply	other threads:[~2021-07-18 19:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-18 19:06 [PATCH 0/3] xfstests: fscrypt no-key name updates Eric Biggers
2021-07-18 19:06 ` [PATCH 1/3] generic: update encryption tests to use term "no-key names" Eric Biggers
2021-07-18 19:06 ` [PATCH 2/3] common/encrypt: add helper function for filtering no-key names Eric Biggers
2021-07-18 19:06 ` Eric Biggers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: [PATCH 3/3] common/encrypt: accept '\''-'\'' character in no-key names' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).