Re: screen-4.6.0 regression: within su: Cannot open your terminal '/dev/pts/14' - please check

Andrew Savchenko <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <[email protected]>
On Fri, 30 Jun 2017 13:25:18 +0200 Axel Beckert wrote:
> Hi,
> 
> On Fri, Jun 30, 2017 at 02:50:48PM +0800, Clark Wang wrote:
> > On Thu, Jun 29, 2017 at 7:52 PM, Axel Beckert <[email protected]> wrote:
> > > I know that behaviour of screen for ages and even saw people
> > > recommending tmux because it doesn't seem to have this issue.
> > >
> > > > /dev/pts/14 is indeed not owned by user test, but this way screen
> > > > have worked fine for as long as I can remember, so this access
> > > > should not be mandatory.
> > > >
> > > > Any way to return the old behaviour?
> > >
> > > I'd rather be interested in how you got that working all these years.
> > > :-)
> > 
> > Just tried v4.5. /usr/bin/screen (rwxr-sr-x) does not work with su but
> > /usr/local/bin/screen (rwsr-xr-x) I built from source works fine:
> > 
> > # ls -Ll /usr/bin/screen /usr/local/bin/screen
> > -rwxr-sr-x 1 root utmp   457608 2017-05-23 07:57 /usr/bin/screen
> > -rwsr-xr-x 1 root staff 1441416 2017-01-19 13:59 /usr/local/bin/screen
> 
> Thanks for the comparison.
> 
> Ok, so the screen binary which is setuid root works and the one which
> is not, doesn't. Sounds like a reason.

Setuid root is not necessary for this to work. In Gentoo I never
had a problem with screen after su (except for 4.6.0 version).
Looks like it works the following way:

1. screen is configured as follows:
  --with-pty-mode=0620 \
  --with-pty-group=5

2. pty permissions are set to 0620 user:tty (tty gid is 5) using
udev.

screen binary is not SUID root for non-multiuser configurations:
  2755 root:utmp for /usr/bin/screen
  0775 root:utmp for /tmp/screen
for utmp access

If user chooses to enable multiuser support during package
compilation, /usr/bin/screen perms are set to 4755, but I don't use
that.

> But I won't revert to setuid for the Debian package. In contrary,
> Debian's screen package in the next stable release will contain, and also already
> 4.5.1 in the current Debian Testing and Unstable already contains
> libutempter support to avoid issues like the privilege escalation in
> 4.5.0. (While in 4.6.0 this doesn't seem to make a difference
> anymore.)
> 
> 		Kind regards, Axel


Best regards,
Andrew Savchenko

_______________________________________________
screen-users mailing list
screen-users-mXXj517/[email protected]
https://lists.gnu.org/mailman/listinfo/screen-users
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE63ZIHsdeM+1XgNer9lNaM7oe5I0FAllj50wACgkQ9lNaM7oe
5I3NuRAAlDLOtih3iYgdS1n3kH2Z+d0K5HhSKHZqw3zSXL6iLRyrnRCuT0ItQUR2
5wMwgGQgIFGuMzMLmIFnkbz0RzD9p/QlJnEw8xnxkkole3iLnWwWzn0N+4jMjnbe
nfXrgxq+3//rHaWKWHK1xcVSJUMUVxTcpLsOB/cvyPoFYR5SEeMUnopQXmuiz5j1
+czKvTmYDmjIpiwdg47drGYz2Op0xQ8S2xm4Qv7OKnJ9ruBrNAyyTXRjAFdM1XbD
KXGfUgfQGrNP01f+B8DKI3VCCz6GPLEDoGpcgT0OHlsmyMIjfBzh77qZbPCvKlch
qwJSDAbphe63aL+Ssbyd9NU3C2ueX4qXznluywK9NHbMmfWPR2rfWgYlwzKpWjdd
SfxcY7W0AwrkaFeb3OB+OL4yuSgzg5wvFLxwWUL0P5tTPK0009+v8Tt23bqHXFTh
MIFNotzLUmEW6IMdmkRq8nTcByQMLrFLVvfl73wk/xQmm9r0oJqGPk/C/33QtnRv
y+/88w8KzfjSxv0o6BFvb3f4TJud6udxIntRZrZrFRQiiOAL2YKoHPPrsb/3VRDC
QsJ2GJ26Gdxz+zGff7MMNa2BDAIYyjiV6zkDEWdVwskuRK+s9ECIMUFakYZg9+rz
Cb7KV3MlPJYAMhMWSx7Bw8qltRdknrwsA5R8axrsz/QeNn01Bic=
=E1CC
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.