mtd-utils: mkfs.ubifs with fscrypt does not crypt hardlink files
Manuel Dipolt
mdipolt at robart.cc
Tue Jun 23 05:35:50 EDT 2020
hi,
Hardlink files gets not crypted per default via mkfs.ubifs with fscrypt (missing fctx parameter for the add_multi_linked_files function)
Is http://git.infradead.org/mtd-utils.git currently down?
yours,
Manuel
Patch to crypt also hardlinks:
diff --git a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
index 0b5e2e0..c32ebc3 100644
--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
+++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
@@ -2202,7 +2200,7 @@ out_free:
/**
* add_multi_linked_files - write all the files for which we counted links.
*/
-static int add_multi_linked_files(void)
+static int add_multi_linked_files(struct fscrypt_context *fctx)
{
int i, err;
@@ -2213,7 +2211,7 @@ static int add_multi_linked_files(void)
for (im = hash_table[i]; im; im = im->next) {
dbg_msg(2, "%s", im->path_name);
err = add_non_dir(im->path_name, &im->use_inum,
- im->use_nlink, &type, &im->st, NULL);
+ im->use_nlink, &type, &im->st, fctx);
if (err)
return err;
}
@@ -2264,7 +2262,7 @@ static int write_data(void)
err = add_directory(root, UBIFS_ROOT_INO, &root_st, !!root, root_fctx);
if (err)
return err;
- err = add_multi_linked_files();
+ err = add_multi_linked_files(root_fctx);
if (err)
return err;
return flush_nodes();
More information about the linux-mtd
mailing list