Commit 116e5258 authored by Jan Kara's avatar Jan Kara

udf: Provide saner default for invalid uid / gid

Currently when UDF filesystem is recorded without uid / gid (ids are set
to -1), we will assign INVALID_[UG]ID to vfs inode unless user uses uid=
and gid= mount options. In such case filesystem could not be modified in
any way as VFS refuses to modify files with invalid ids (even by root).
This is confusing to users and not very useful default since such media
mode is generally used for removable media. Use overflow[ug]id instead
so that at least root can modify the filesystem.
Reported-by: default avatarSteve Kenton <skenton@ou.edu>
Reviewed-by: default avatarPali Rohár <pali.rohar@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 0c9850f4
...@@ -2111,8 +2111,9 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -2111,8 +2111,9 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
bool lvid_open = false; bool lvid_open = false;
uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT); uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT);
uopt.uid = INVALID_UID; /* By default we'll use overflow[ug]id when UDF inode [ug]id == -1 */
uopt.gid = INVALID_GID; uopt.uid = make_kuid(current_user_ns(), overflowuid);
uopt.gid = make_kgid(current_user_ns(), overflowgid);
uopt.umask = 0; uopt.umask = 0;
uopt.fmode = UDF_INVALID_MODE; uopt.fmode = UDF_INVALID_MODE;
uopt.dmode = UDF_INVALID_MODE; uopt.dmode = UDF_INVALID_MODE;
......
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