Date: Tue, 30 May 2006 18:44:48 -0400 From: Craig Rodrigues <rodrigc@crodrigues.org> To: Maxim Konovalov <maxim@macomnet.ru> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/ufs/ffs ffs_vfsops.c Message-ID: <20060530224448.GA42556@crodrigues.org> In-Reply-To: <20060530110750.A96470@mp2.macomnet.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>
next in thread | previous in thread | raw e-mail | index | archive | help
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? 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 30 May 2006 20:13:23 -0000 @@ -184,6 +184,32 @@ return (0); } +static +int specified_ro(int argc, char *argv[]) +{ + int i; + char *optbuf, *opt; + int ret = 0; + + for (i=1; i < argc; i++) { + if (strcmp(argv[i-1], "-o") == 0) { + optbuf = strdup(argv[i]); + 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[]) { @@ -200,6 +226,9 @@ options = NULL; vfslist = NULL; vfstype = "ufs"; + + if (specified_ro(argc, argv)) + ro = 1; while ((ch = getopt(argc, argv, "adF:fo:prwt:uv")) != -1) switch (ch) { case 'a': -- Craig Rodrigues rodrigc@crodrigues.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060530224448.GA42556>