From owner-freebsd-bugs Wed May 5 3:30:10 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 7E147158FC for ; Wed, 5 May 1999 03:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id DAA03183; Wed, 5 May 1999 03:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Wed, 5 May 1999 03:30:03 -0700 (PDT) Message-Id: <199905051030.DAA03183@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: David Malone Subject: Re: bin/6399: [PATCH] When using "-u" mount doesn't start from the fstab options Reply-To: David Malone Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/6399; it has been noted by GNATS. From: David Malone To: jkoshy@freebsd.org Cc: Freebsd-gnats-submit@freebsd.org Subject: Re: bin/6399: [PATCH] When using "-u" mount doesn't start from the fstab options Date: Wed, 05 May 1999 11:23:05 +0100 > A late followup (better late than never!) with some review comments: ;-) I was working up to re-doing it for current again and then complaining bitterly! > 230 if ((fs = getfsfile(mntbuf->f_mntonname)) != NULL) > 231 mntfromname = fs->fs_spec; > 232 else > 233 mntfromname = mntbuf->f_mntfromname; > 234 options = update_options(options,fs->fs_mntops,mntbuf->f_flags); > > We have a null pointer deference here if `getfsfile()' on line 230 returns > NULL. Grand - I'll have a look at this one - should be easy enough to fix. > 606 strcpy(tmpopt,"no"); > 607 strcat(tmpopt,o); > 608 remopt(newopt,tmpopt); > 609 free(tmpopt); > 610 > 611 if (strncmp("no",o,2) == 0) remopt(newopt,o+2); > > Lines 606--608 are redundant if the option has a 'no' prefix; e.g:- > "nofoo". In this case the `remopt()' call gets called with `nonofoo' > and is effectively a noop. Shouldn't we be removing option 'foo' from > the `newopt' list instead? We remove "foo" on line 611. I think I was worried about options like "notice" and its obvious inverse "nonotice", it has the less obvious inverse "tice" which hopefully wouldn't be a distinct option. I'll produce a version for -current of today with the NULL pointer dereference fixed and send it later today. David. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message