* Craig Rodrigues <[EMAIL PROTECTED]> [ 2006-05-30 ]
        [ Re: cvs commit: src/sys/ufs/ffs ffs_vfsops.c ]
> On Tue, May 30, 2006 at 11:11:34AM +0400, Maxim Konovalov wrote:
> > [EMAIL PROTECTED] ~]# mount -u -o noexec,ro /vol0
> 
> Can you try this patch?

Instead of playing games with strcmp(3) to avoid getopt(3), you might want to
try using the existing getopt(3).  I think something like this might make sense,
but it's not even compile tested.  I'm not sure if the second chunk is
necessary, but I get the impression from surrounding code that it prevents a
redundant "noro,noro" in the options list.

%%%
Index: mount.c
===================================================================
RCS file: /home/ncvs/src/sbin/mount/mount.c,v
retrieving revision 1.84
diff -u -r1.84 mount.c
--- mount.c     10 May 2006 14:40:40 -0000      1.84
+++ mount.c     30 May 2006 23:55:43 -0000
@@ -215,8 +215,11 @@
                        init_flags |= MNT_FORCE;
                        break;
                case 'o':
-                       if (*optarg)
+                       if (*optarg) {
                                options = catopt(options, optarg);
+                               if (strcmp(optarg, "ro") == 0)
+                                       ro = 1;
+                       }
                        break;
                case 'p':
                        fstab_style = 1;
@@ -240,6 +243,7 @@
                        break;
                case 'w':
                        options = catopt(options, "noro");
+                       ro = 0;
                        break;
                case '?':
                default:
%%%
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to