From owner-cvs-all@FreeBSD.ORG Tue May 30 23:58:53 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8658916A5BF; Tue, 30 May 2006 23:58:53 +0000 (UTC) (envelope-from flata@magnesium.net) Received: from toxic.magnesium.net (toxic.magnesium.net [207.154.84.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 453E943D46; Tue, 30 May 2006 23:58:53 +0000 (GMT) (envelope-from flata@magnesium.net) Received: by toxic.magnesium.net (Postfix, from userid 1212) id 1E9FDDA8B2; Tue, 30 May 2006 16:58:53 -0700 (PDT) Date: Tue, 30 May 2006 13:58:53 -1000 From: Juli Mallett To: Craig Rodrigues Message-ID: <20060530235853.GA42051@toxic.magnesium.net> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060530224448.GA42556@crodrigues.org> User-Agent: Mutt/1.5.11 Cc: cvs-src@FreeBSD.org, Maxim Konovalov , src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/ufs/ffs ffs_vfsops.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2006 23:58:59 -0000 * Craig Rodrigues [ 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: %%%