============================================================================ Testsuite summary for GNU sed 4.3 ============================================================================ # TOTAL: 107 # PASS: 97 # SKIP: 5 # XFAIL: 4 # FAIL: 1 # XPASS: 0 # ERROR: 0 FAIL: testsuite/panic-tests.sh --- FAIL: testsuite/panic-tests =========================== --- exp-err-tty 2017-01-06 15:42:36.073141748 +1300 +++ err-tty 2017-01-06 15:42:36.086141949 +1300 @@ -1 +1 @@ -sed: couldn't edit X: is a terminal +sed: can't read /dev/pts/3: Permission denied FAIL testsuite/panic-tests.sh (exit status: 1)
The test suite didn't fail when I committed sed-4.3 so pelase give us the usual information like emerge --info and build.log file.
Created attachment 458880 [details] build.log.xz I'm guessing its partly due to running under paludis, which I think implies different environment constraints. My hope is we can nail this problem as being environmentally sensitive enough to false-fail and then simply block that test out.
Created attachment 458882 [details] cave info =sys-apps/sed-4.3 | ansifilter
Looking into it seems to suggest package manager difference is significant here. Portage basically hides the problem because portage creates a new tty, which tty naturally returns the ID of, and naturally has both read and write access to. Paludis does not create its own tty and instead inherits the tty of the calling user, which in this case is root crw--w---- 1 root tty 136, 3 Jan 6 21:00 3 The user paludis runs as *is* a member of the tty group, however, that doesn't help, as that only has -w access, not -r It is suggested that perhaps this test should create a tty that it knows to be in control of before executing this test, instead of relying on the environment to be specifically tailored for the test in advance.
Created attachment 459122 [details, diff] sed-4.3-test-pty-readable.patch
Attached patch works around the bug by extending the existing guards that check for tty writeability, by also checking for tty readability. As sed can't report "is a tty" without first being able to read the device, unreadable devices can't yeild the "is a tty" error, only EACCESS. This patch allows this test to continue to operate under portage or any other environment where the tty is +rw, but automatically skips that test if the tty is not +r or +w
Serious question: How do I report this upstream? This page is utterly useless for finding a bug tracker: http://sed.sourceforge.net/ Issue still prevalent in 4.4 and the fix is trivial.
(In reply to Kent Fredric (IRC: kent\n) from comment #4) if paludis doesn't create a new tty, sounds like it's subject to injection attacks via ioctl(TIOCSTI) (In reply to Kent Fredric (IRC: kent\n) from comment #5) patch looks fine if you want to add it to the tree. just make sure to include links to this bug & upstream mailing list. (In reply to Kent Fredric (IRC: kent\n) from comment #7) https://lists.gnu.org/mailman/listinfo/bug-sed although it looks like you've already found it
Expected fixed in next release: https://git.savannah.gnu.org/cgit/sed.git/commit/?id=b092d4a6c07b25f743d302b05c308325edcfc599