klibc-bot for Ben Hutchings
2016-Jan-06 01:54 UTC
[klibc] [klibc:master] mount: Implement -o defaults
Commit-ID: 76e7a4a89826c76b9ebbe9d6015ab16aadbe3dcd Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=76e7a4a89826c76b9ebbe9d6015ab16aadbe3dcd Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Wed, 6 Jan 2016 01:09:36 +0000 Committer: H. Peter Anvin <hpa at linux.intel.com> CommitDate: Tue, 5 Jan 2016 17:48:54 -0800 [klibc] mount: Implement -o defaults This is needed to support mounting non-root filesystems in initramfs-tools. Signed-off-by: Ben Hutchings <ben at decadent.org.uk> Signed-off-by: H. Peter Anvin <hpa at linux.intel.com> --- usr/utils/mount_opts.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/usr/utils/mount_opts.c b/usr/utils/mount_opts.c index 05d1729..bb26c7d 100644 --- a/usr/utils/mount_opts.c +++ b/usr/utils/mount_opts.c @@ -89,8 +89,13 @@ parse_mount_options(char *arg, unsigned long rwflag, struct extra_opts *extra) break; } - if (res != 0 && s[0]) - add_extra_option(extra, opt); + if (res != 0 && s[0]) { + if (!strcmp(opt, "defaults")) + rwflag &= ~(MS_RDONLY|MS_NOSUID|MS_NODEV| + MS_NOEXEC|MS_SYNCHRONOUS); + else + add_extra_option(extra, opt); + } } return rwflag;