[klibc] [PATCH klibc 3/3] mount: Implement -o defaults

Ben Hutchings ben at decadent.org.uk
Tue Jan 5 17:09:36 PST 2016


This is needed to support mounting non-root filesystems in
initramfs-tools.

Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: Digital signature
URL: <http://www.zytor.com/pipermail/klibc/attachments/20160106/56400a52/attachment.sig>


More information about the klibc mailing list