Date: Tue, 30 May 2006 13:58:53 -1000 From: Juli Mallett <jmallett@FreeBSD.org> To: Craig Rodrigues <rodrigc@crodrigues.org> Cc: cvs-src@FreeBSD.org, Maxim Konovalov <maxim@macomnet.ru>, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/ufs/ffs ffs_vfsops.c Message-ID: <20060530235853.GA42051@toxic.magnesium.net> In-Reply-To: <20060530224448.GA42556@crodrigues.org> References: <200605261244.k4QCiCsl057619@repoman.freebsd.org> <20060529193947.M63890@mp2.macomnet.net> <20060529215827.D78736@mp2.macomnet.net> <20060530034531.GA36462@crodrigues.org> <20060530110750.A96470@mp2.macomnet.net> <20060530224448.GA42556@crodrigues.org>
next in thread | previous in thread | raw e-mail | index | archive | help
* Craig Rodrigues <rodrigc@crodrigues.org> [ 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: > > [root@sonnie ~]# 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: %%%
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060530235853.GA42051>