From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30305 invoked by alias); 10 Aug 2016 23:26:53 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 30287 invoked by uid 89); 10 Aug 2016 23:26:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=doable, ldv@altlinux.org, levin, ttyname_r X-HELO: h2.hallyn.com Date: Wed, 10 Aug 2016 23:26:00 -0000 From: "Serge E. Hallyn" To: "Serge E. Hallyn" , Florian Weimer , libc-alpha@sourceware.org Subject: Re: [PATCH] linux ttyname and ttyname_r: return link if appropriate Message-ID: <20160810232640.GC20138@mail.hallyn.com> References: <20160420185141.GA31095@ubuntumail> <20160727165711.GA27815@altlinux.org> <20160806020855.GA19897@mail.hallyn.com> <20160806084559.GS6702@vapier.lan> <20160806150002.GA24315@mail.hallyn.com> <20160809211841.GB2566@altlinux.org> <20160809213937.GA3392@mail.hallyn.com> <20160810230351.GA20138@mail.hallyn.com> <20160810231818.GA20183@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160810231818.GA20183@altlinux.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2016-08/txt/msg00337.txt.bz2 Quoting Dmitry V. Levin (ldv@altlinux.org): > On Wed, Aug 10, 2016 at 06:03:51PM -0500, Serge E. Hallyn wrote: > [...] > > But, even if we decide that part is dangerous, the part where we do not > > return /dev/pts/N when /proc/self/fd/M is from a different devpts mount > > than the /dev/pts/N in caller's namespace is I think very important, and > > should at least be separately applied. > > I agree. > In that case, what should ttyname/ttyname_r set errno to? ENOTTY? Ideally something like EXDEV, which updated userspace could recognize as "shucks i'll just use /proc/self/fd/N", but that probably isn't realistically do-able?