From owner-freebsd-bugs Wed May 5 1:50: 6 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 1284514F0E for ; Wed, 5 May 1999 01:50:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id BAA96636; Wed, 5 May 1999 01:50:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Wed, 5 May 1999 01:50:02 -0700 (PDT) Message-Id: <199905050850.BAA96636@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Subject: Re: bin/6399: [PATCH] When using "-u" mount doesn't start from the fstab options Reply-To: 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: To: dwmalone@maths.tcd.ie Cc: Freebsd-gnats-submit@freebsd.org Subject: Re: bin/6399: [PATCH] When using "-u" mount doesn't start from the fstab options Date: Wed, 5 May 1999 01:45:09 -0700 (PDT) A late followup (better late than never!) with some review comments: 1 ::: 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. 2 ::: 602 for ( p = expopt; (o = strsep(&p, ",")) != NULL; ) { 603 if ( (tmpopt = malloc( strlen(o) + 2 + 1 )) == NULL) 604 err(1,NULL); 605 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? Thanks for (patiently) redoing the patch for -current. Regards, Koshy To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message