bug-sed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25692: [PATCH] sed fails testsuite/panic-tests when tty is not owned


From: Kent Fredric
Subject: bug#25692: [PATCH] sed fails testsuite/panic-tests when tty is not owned by current user
Date: Sun, 12 Feb 2017 01:45:27 +1300

If the tty is owned by a privileged user, and that privileged user is building
sed after changing UID, the state of the tty's may look as follows:

> tty
/dev/pts/9

> ls -la $(tty)
crw--w---- 1 root tty 136, 9 Feb 12 01:27 /dev/pts/9

> whoami
builder

> if [[ -r $(tty) ]]; then echo "readable"; else echo "not readable"; fi
not readable

This leads to the test producing the following diff:

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)


And failing.

This failure makes sense however, and there's no sane way I know of to
make the terminal readable, other than demanding sed run the test
inside a pty it created.

So an effective workaround is just guard the test with a -r check
like it presently has for -w , because the tty dev can't be read for
sed to decide "its a tty" in this condition.

Tested patch that adds this trivial check attached.

Thanks.


---
Downstream Bug: https://bugs.gentoo.org/show_bug.cgi?id=604798

Attachment: sed-4.3-test-pty-readable.patch
Description: Text Data

Attachment: pgpkfr6UNJDtV.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]