From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4216 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: request: increase TTY_NAME_MAX in limits.h Date: Sat, 9 Nov 2013 11:36:03 -0500 Message-ID: <20131109163603.GG24286@brightrain.aerifal.cx> References: <527E1774.4060305@skarnet.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1384014974 32534 80.91.229.3 (9 Nov 2013 16:36:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Nov 2013 16:36:14 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4220-gllmg-musl=m.gmane.org@lists.openwall.com Sat Nov 09 17:36:18 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1VfBWE-0005AB-6r for gllmg-musl@plane.gmane.org; Sat, 09 Nov 2013 17:36:18 +0100 Original-Received: (qmail 6087 invoked by uid 550); 9 Nov 2013 16:36:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 6079 invoked from network); 9 Nov 2013 16:36:17 -0000 Content-Disposition: inline In-Reply-To: <527E1774.4060305@skarnet.org> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4216 Archived-At: On Sat, Nov 09, 2013 at 11:07:32AM +0000, Laurent Bercot wrote: > Hello, > > TTY_NAME_MAX is currently 20. This is not enough for me. Could it > be increased a bit ? The only thing that needs to be checked is if there are any places where increasing the value could cause buffer overflows (in an existing binary already compiled with the value of 20). A casual glance does not show any such issues. > Explanation: my /dev is actually a symlink to /mnt/tmpfs/dev, and > ttyname_r() writes fully resolved paths, so "/mnt/tmpfs/dev/pts/0" > is *just* too large to fit into the 20 bytes static buffer provided > by ttyname(). > Impact: it breaks dropbear, which instantly dies when ttyname() fails - > this is a deal breaker for me. Less importantly, it also breaks the %y% > prompt mechanism in zsh, which prints the default "tty" instead of the > correct name. Understood. > I'd like to be able to use prebuilt musl toolchains, like Gregor's ones, > or Rob's ones when they come out, so editing limits.h myself won't cut it. > 24 bytes would be enough for me to have 10k ptys (which will never happen). > So... can I haz 4 more bytes plz ? If we change it I think we might as well go with the glibc value of 32 rather than just increasing it by 4. Rich