From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58667 invoked by alias); 2 Jan 2018 05:19:51 -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 58656 invoked by uid 89); 2 Jan 2018 05:19:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=sus, falls, conclude, SUS X-HELO: mav.lukeshu.com Date: Tue, 02 Jan 2018 05:19:00 -0000 Message-ID: <87a7xwx2fh.wl-lukeshu@lukeshu.com> From: Luke Shumaker To: libc-alpha@sourceware.org Subject: Re: [PATCH v3] tst-ttyname: skip the test if failed to become root In-Reply-To: <20171231001152.GA26394@altlinux.org> References: <20171226141002.GA23091@altlinux.org> <20171226230703.GB28737@altlinux.org> <874lodskm6.fsf@mid.deneb.enyo.de> <87lghjx17h.wl-lukeshu@lukeshu.com> <20171231001152.GA26394@altlinux.org> <87efndljui.fsf@mid.deneb.enyo.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2018-01/txt/msg00071.txt.bz2 On Sat, 30 Dec 2017 19:11:52 -0500, Dmitry V. Levin wrote: > On Sat, Dec 30, 2017 at 06:09:22PM -0500, Luke Shumaker wrote: > > Florian Weimer wrote: > > > I don't think the glibc test suite is supposed to pass in such an > > > environment [without ptmx]. If you don't provide /dev/null, /sys, > > > or /proc to the tests, some of them will fail as well. I still > > > think that the current test accurately reflects the inadequacy of > > > your test environment. > > Also, one cannot declare these environments unsupported in master branch > without reaching a consensus. On Fri, 29 Dec 2017 08:55:17 -0500, Florian Weimer wrote: > * Dmitry V. Levin: > > It used to work perfectly for at least 15 years, and it still works > > when tst-ttyname is fixed. > > This just reflects that we did not have sufficient test coverage for > the PTY code. Obviously, I'm the outsider here; and can't authoritatively comment on whether glibc supports environments without ptmx / UNIX 98 PTYs, but from looking over the codebase: 1. There is insufficient test coverate of posix_openpt and friends to conclude that Linux environments without ptmx were previously supported. The only other tests that call posix_openpt or other PTY-opening functions are - debug/tst-chk1.c - login/tst-grantpt.c - login/tst-ptsname.c I don't have a good idea of what tst-chk1 does, or why it doesn't error if posix_openpt fails; but the other 2 ignore an error because "maybe the system does not have SUS pseudo terminals", and the posix_openpt bit is just one subtest case. Which is to say that posix_openpt is previously untested by the test suite. But, Linux does support SUS / UNIX 98 pseudo terminals; and tst-ttyname lives in sysdeps/unix/sysv/linux. Linux has no config option to disable ptmx. The only variable there is whatever sets up /dev. 2. The Linux implementation of getpt (a GNU extension) first tries posix_openpt to get a UNIX 98 PTY, but if that fails, it falls back to trying to get a BSD PTY. Which suggests that glibc supports Linux environments without ptmx. I find #2 fairly compelling. That is to say, I've changed my mind, and do support applying and backporting a patch to EXIT_UNSUPPORTED if posix_openpt returns ENOENT. -- Happy hacking, ~ Luke Shumaker