Skip to contentSkip to conversation

ecryptfs: show filename encryption options

PATCH In review Yichong Chen 2 participants 2 messages Jul 2 – Jul 21 Ecrypt file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ecryptfs: show filename encryption options

ecryptfs_show_options() prints most user-visible mount options but omits the filename encryption cipher and key size.

Print ecryptfs_fn_cipher and ecryptfs_fn_key_bytes when filename encryption is enabled so that the displayed mount options reflect the active filename encryption settings.

Fixes 87c94c4df014 ("eCryptfs: Filename Encryption: mount option")
---
 fs/ecryptfs/super.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/ecryptfs/super.c +7 -0
index 3bc21d677564..686b2b4a9cb5 100644
@@ -150,6 +150,13 @@ static int ecryptfs_show_options(struct seq_file *m, struct dentry *root)
 	if (mount_crypt_stat->global_default_cipher_key_size)
 		seq_printf(m, ",ecryptfs_key_bytes=%zd",
 			   mount_crypt_stat->global_default_cipher_key_size);
+	if (mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES) {
+		seq_printf(m, ",ecryptfs_fn_cipher=%s",
+			   mount_crypt_stat->global_default_fn_cipher_name);
+		if (mount_crypt_stat->global_default_fn_cipher_key_bytes)
+			seq_printf(m, ",ecryptfs_fn_key_bytes=%zd",
+				   mount_crypt_stat->global_default_fn_cipher_key_bytes);
+	}
 	if (mount_crypt_stat->flags & ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED)
 		seq_printf(m, ",ecryptfs_passthrough");
 	if (mount_crypt_stat->flags & ECRYPTFS_XATTR_METADATA_ENABLED)
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 8 lines · Yichong Chen

ecryptfs_show_options() prints most user-visible mount options but omits the filename encryption cipher and key size.

Print ecryptfs_fn_cipher and ecryptfs_fn_key_bytes when filename encryption is enabled so that the displayed mount options reflect the active filename encryption settings.

[...]

Thank you! This has been applied to the next branch of the tyhicks/ecryptfs.git tree.

You can find a direct link below but please be aware that the commit hash is unstable and, therefore, the URL may not be valid in the future.

[1/1] ecryptfs: show filename encryption options

      https://git.kernel.org/tyhicks/ecryptfs/c/496ec2d0852a02d2e631771b5c439130b9c7dce7

Tyler