Commit b627c7d8 authored by Justin Husted's avatar Justin Husted Committed by Kent Overstreet

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: default avatarJustin Husted <sigstop@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 08977051
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment