From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10639 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] increase buffer size in getmntent to 4096 bytes Date: Mon, 17 Oct 2016 16:29:58 -0400 Message-ID: <20161017202958.GG19318@brightrain.aerifal.cx> References: <1476699865-5593-1-git-send-email-rostislav@tuxera.com> <20161017144817.299986f4@ncopa-desktop.copa.dup.pw> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1476736238 16119 195.159.176.226 (17 Oct 2016 20:30:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 20:30:38 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-10652-gllmg-musl=m.gmane.org@lists.openwall.com Mon Oct 17 22:30:34 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1bwEXz-00015f-Tp for gllmg-musl@m.gmane.org; Mon, 17 Oct 2016 22:30:12 +0200 Original-Received: (qmail 5709 invoked by uid 550); 17 Oct 2016 20:30:11 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5686 invoked from network); 17 Oct 2016 20:30:10 -0000 Content-Disposition: inline In-Reply-To: <20161017144817.299986f4@ncopa-desktop.copa.dup.pw> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10639 Archived-At: On Mon, Oct 17, 2016 at 02:48:17PM +0200, Natanael Copa wrote: > On Mon, 17 Oct 2016 10:24:25 +0000 > Rostislav Skudnov wrote: > > > getmntent fails if the length of the mount entry exceeds the buffer > > size. The new buffer size matches that of glibc. > > --- > > Even after this patch, getmntent may still fail since the device and mount > > paths may be up to PATH_MAX in length, and the mount options may > > (theoretically) have unlimited length. The same would happen in glibc, though. > > This patch solve the same problem, but uses getline to malloc the buffer as needed: > http://www.openwall.com/lists/musl/2016/09/08/1 Indeed. We can't go making every program use an additional page of memory just for a rare program that uses getmntent, so dynamic allocation it had to be. Rich