Date: Tue, 9 Jul 2013 19:56:59 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Robert Millan <rmh@freebsd.org> Cc: freebsd-fs@freebsd.org Subject: Re: Compatibility options for mount(8) Message-ID: <20130709165658.GO91021@kib.kiev.ua> In-Reply-To: <20130709150129.GA8289@icarus.home.lan> References: <CAOfDtXM_KJeLLUcsFA0EZOC8ZgSjKiLKuGeeNPQKCcZwcaJbCQ@mail.gmail.com> <20130702000732.GA72587@icarus.home.lan> <CAOfDtXNxT%2BhnS8n%2BOY6a7n=6UiwgDJo6M3GZx48JgskRKoY=gg@mail.gmail.com> <20130709150129.GA8289@icarus.home.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
--g7MhQE0aLFS2f2WM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 09, 2013 at 08:01:29AM -0700, Jeremy Chadwick wrote: > On Tue, Jul 09, 2013 at 04:47:46PM +0200, Robert Millan wrote: > > > 2. Please use strncmp(). I know other parts of the same code use str= cmp() > > > and those should really be improved at some other time, but while you= 're > > > already there you might as well use strncmp() (you'll see others have > > > done the same), i.e.: > > > > > > } else if (strncmp(p, "remount", 7) =3D=3D 0)= { > >=20 > > What is the rationale behind this? >=20 > Primarily security and stability. I won't get into a discussion about > this as it'll just bikeshed, particularly when there's an almost > indefinite amount of information online about the dangers of strcmp(3). Robert, please ignore this. The person does not know what he talks about. The use of strncmp() is plain wrong. E.g., it would match "remount1" as well as any longer option starting with "remount". Original patch is fine. --g7MhQE0aLFS2f2WM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJR3EDaAAoJEJDCuSvBvK1B048P/RxRZHYXHbofTOyg0zJx7ORl xi+qaeHQACvjMAwQSUsmCQLb+zz6bN5fYuB26aXRoWjmKkUhVzcLpb/9vAcIXZ46 JPxbNMnR817dJ+pCqt/pX0LTKAGJX9QIdwoEfG9w0G82VOOf8/G1X9Q4BK0YJj4x 6W/gCqd5Ps5j3TewQAg+NHtGq0xFVPCGHEM7oM91xONSVHm7IWRatOMV7ph8oU4d HsFt/BREsWX+5TcC0zL1FWi+PFt0OQi5gDBBAVid7+9iCe8/oDkEUBCTy5VPJJLc gfvi8RefZJtODFzbUes8l89cJMWktKohISupQQ+jtaGvSLg/8PjyyONqeZcU0fIU HooFHvtIMlo8cYTbu7ubetUfANZrhEoXj8rYe5aUE2ZZV1uRPq92xWcKS8w8fBkk p89olpxcufwkKWpzgfH0lSSw/OZdobOuZhQOhnh4+EulY0MdVRxEJuCWHm0PuoP5 dPpILPtYolIYhJo1nOfI20v50O6XD//kItlAD7fpRCb7KWjlvItCzYGBnugiRvBl pK4o+PIHmn6QVtorQYlxaRLFbBURdFz3vzLWAUPO7mMsH3YOzG9GBSstvELqUBbK J+KBceG9hnO7r3vCXE9595J3hZIKEl9jPkM0X5WVOPNl4tJjThjFsyXbK1vqkIBj UbBKncSUN9LiYdv/M9ob =ekgr -----END PGP SIGNATURE----- --g7MhQE0aLFS2f2WM--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130709165658.GO91021>