[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241106022527.493421-1-danielyangkang@gmail.com>
Date: Tue, 5 Nov 2024 18:25:26 -0800
From: Daniel Yang <danielyangkang@...il.com>
To: Tyler Hicks <code@...icks.com>,
"GitAuthor: Daniel Yang" <danielyangkang@...il.com>,
ecryptfs@...r.kernel.org (open list:ECRYPT FILE SYSTEM),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] ecryptfs_parse_options(): Replace strcpy with strscpy
The function strcpy is deprecated. strscpy is recommended to replace
strcpy. Instances of strcpy in ecryptfs_parse_options() don't require
strcpy return value so the different methods of detecting truncation
shouldn't be an issue here.
Signed-off-by: Daniel Yang <danielyangkang@...il.com>
---
fs/ecryptfs/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 577c56302..d0b8ce70c 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -379,12 +379,12 @@ static int ecryptfs_parse_options(struct ecryptfs_sb_info *sbi, char *options,
int cipher_name_len = strlen(ECRYPTFS_DEFAULT_CIPHER);
BUG_ON(cipher_name_len > ECRYPTFS_MAX_CIPHER_NAME_SIZE);
- strcpy(mount_crypt_stat->global_default_cipher_name,
+ strscpy(mount_crypt_stat->global_default_cipher_name,
ECRYPTFS_DEFAULT_CIPHER);
}
if ((mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)
&& !fn_cipher_name_set)
- strcpy(mount_crypt_stat->global_default_fn_cipher_name,
+ strscpy(mount_crypt_stat->global_default_fn_cipher_name,
mount_crypt_stat->global_default_cipher_name);
if (!cipher_key_bytes_set)
mount_crypt_stat->global_default_cipher_key_size = 0;
--
2.39.5
Powered by blists - more mailing lists