bcachefs: Set lost+found mode to 0700

For security and conformance with other filesystems, the lost+found
directory should not be world or group accessible.

Signed-off-by: Justin Husted <sigstop@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Justin Husted 2019-11-09 19:15:40 -08:00 committed by Kent Overstreet
parent 0897705163
commit b627c7d8f4
2 changed files with 2 additions and 2 deletions

View file

@ -797,7 +797,7 @@ static int check_lostfound(struct bch_fs *c,
bch2_create_trans(&trans,
BCACHEFS_ROOT_INO, root_inode,
lostfound_inode, &lostfound,
0, 0, S_IFDIR|0755, 0, NULL, NULL));
0, 0, S_IFDIR|0700, 0, NULL, NULL));
if (ret)
bch_err(c, "error creating lost+found: %i", ret);

View file

@ -1013,7 +1013,7 @@ int bch2_fs_initialize(struct bch_fs *c)
bch2_create_trans(&trans, BCACHEFS_ROOT_INO,
&root_inode, &lostfound_inode,
&lostfound,
0, 0, S_IFDIR|0755, 0,
0, 0, S_IFDIR|0700, 0,
NULL, NULL));
if (ret)
goto err;