linux-fscrypt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: fstests@vger.kernel.org
Cc: linux-fscrypt@vger.kernel.org
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: <20210718190658.61621-4-ebiggers@kernel.org> (raw)
In-Reply-To: <20210718190658.61621-1-ebiggers@kernel.org>

From: Eric Biggers <ebiggers@google.com>

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
(https://lkml.kernel.org/r/20210718000125.59701-1-ebiggers@kernel.org).

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 <ebiggers@google.com>
---
 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"
 }
-- 
2.32.0


      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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20210718190658.61621-4-ebiggers@kernel.org \
    --to=ebiggers@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --subject='Re: [PATCH 3/3] common/encrypt: accept '\''-'\'' character in no-key names' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).