cvs commit: src/sys/ufs/ffs ffs_vfsops.c

Craig Rodrigues rodrigc at crodrigues.org
Wed May 31 14:26:49 PDT 2006


On Wed, May 31, 2006 at 11:44:14AM +0400, Maxim Konovalov wrote:
> This one works, thanks!  But I worry about mountd/NFS interaction to
> mount I described in my first email.  Any ideas?

Not sure about the mountd/NFS interaction yet.

This patch is a bit better for mount(8):


Index: mount.c
===================================================================
RCS file: /home/ncvs/src/sbin/mount/mount.c,v
retrieving revision 1.84
diff -u -u -r1.84 mount.c
--- mount.c	10 May 2006 14:40:40 -0000	1.84
+++ mount.c	31 May 2006 21:23:35 -0000
@@ -184,6 +184,26 @@
 	return (0);
 }
 
+static
+int specified_ro(const char *arg)
+{
+	char *optbuf, *opt;
+	int ret = 0;
+
+	optbuf = strdup(arg);
+	if (optbuf == NULL)
+		 err(1, NULL);
+
+	for (opt = optbuf; (opt = strtok(opt, ",")) != NULL; opt = NULL) {
+		if (strcmp(opt, "ro") == 0) {
+			ret = 1;
+			break;
+		}
+	}
+	free(optbuf);
+	return (ret);
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -215,8 +236,11 @@
 			init_flags |= MNT_FORCE;
 			break;
 		case 'o':
-			if (*optarg)
+			if (*optarg) {
 				options = catopt(options, optarg);
+				if (specified_ro(optarg))
+					ro = 1;
+			}
 			break;
 		case 'p':
 			fstab_style = 1;


-- 
Craig Rodrigues        
rodrigc at crodrigues.org


More information about the cvs-all mailing list