mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: request: increase TTY_NAME_MAX in limits.h
Date: Sat, 9 Nov 2013 11:36:03 -0500	[thread overview]
Message-ID: <20131109163603.GG24286@brightrain.aerifal.cx> (raw)
In-Reply-To: <527E1774.4060305@skarnet.org>

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


  reply	other threads:[~2013-11-09 16:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-09 11:07 Laurent Bercot
2013-11-09 16:36 ` Rich Felker [this message]
2013-11-09 17:20   ` Laurent Bercot
2013-11-09 17:38     ` Rich Felker
2013-11-28 16:05       ` Rob Landley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131109163603.GG24286@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).