Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-12 Thread Jakub Wilk

* Aurelien Jarno , 2015-12-04, 18:11:
In that case given the issue is due to a user misconfiguration, I 
guess we should just try to detect it, display a note and fail the 
installation.


Warning the user would be certainly a good idea. But of course that 
would only help if the devpts filesystem was misconfigured at 
installation time. For me, this wasn't the case.


What was the issue on your case?


I had schroot configured to mount /dev/pts with default permissions. 
(This should not be the problem for most schroot users. By default 
schroot bind-mounts /dev/pts from the host.) So my /dev/pts permissions 
were fine on upgrade; they only broke later, when I tried to build a 
package.


In another mail Aurelien wrote:


usertags 806882 + serious
thanks


tag 806882 + serious
thanks

Due to a typo, this bug didn't get upgraded to serious.


FWIW, it wasn't a typo. :) It's an actual usertag of mine:
https://udd.debian.org/cgi-bin/bts-usertags.cgi?tag=serious=jwilk%40debian.org

--
Jakub Wilk



Processed (with 4 errors): Re: Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-08 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> On 2015-12-04 11:52, Jakub Wilk wrote:
Unknown command or malformed arguments to command.
> > usertags 806882 + serious
Unknown command or malformed arguments to command.
> > thanks
Unknown command or malformed arguments to command.
> tag 806882 + serious
Unknown tag/s: serious.
Recognized are: patch wontfix moreinfo unreproducible fixed potato woody sid 
help security upstream pending sarge sarge-ignore experimental d-i confirmed 
ipv6 lfs fixed-in-experimental fixed-upstream l10n newcomer etch etch-ignore 
lenny lenny-ignore squeeze squeeze-ignore wheezy wheezy-ignore jessie 
jessie-ignore stretch stretch-ignore buster buster-ignore.

Bug #806882 [libc-bin] libc-bin: unable to set pts permissions (and open a 
terminal...)
Requested to add no tags; doing nothing.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
806882: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=806882
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-08 Thread Aurelien Jarno
On 2015-12-04 11:52, Jakub Wilk wrote:
> usertags 806882 + serious
> thanks

tag 806882 + serious
thanks

Due to a typo, this bug didn't get upgraded to serious. Do it now so
that glibc 2.21 doesn't migrate to testing until we find a solution.

Aurelien

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net



Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-07 Thread Domenico Andreoli
On Fri, Dec 4, 2015 at 3:05 PM, Aurelien Jarno  wrote:

> On 2015-12-04 11:52, Jakub Wilk wrote:
> >
> > All devpts fstab entries need to have correct options, because all devpts
> > filesystems are shared by default. (You can probably use the
> "newinstance"
> > option to disable sharing them.)
>
> You really mean the other entries in the fstab are causing the
> permissions of /dev/pts to be changed?
>

yes, converting the chroot mounts into binding solved the issue.


> In that case given the issue is due to a user misconfiguration, I guess
> we should just try to detect it, display a note and fail the
> installation.
>

yes, I think this would be reasonable.

thanks,
Domenico


Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-04 Thread Jakub Wilk

usertags 806882 + serious
thanks

I've been bitten by it too...

Couldn't libc just leave ownership/permission as they are if /dev/pts 
is a devpts filesystem?


* Domenico Andreoli , 2015-12-02, 17:13:

$ grep devpts /etc/fstab
none  /mnt/sid64/dev/pts devpts   defaults
0   0
none  /mnt/sid64/home/chernobyl/dev/pts  devpts   defaults
0   0


"defaults" are not correct options. You need "gid=5" at least.

All devpts fstab entries need to have correct options, because all 
devpts filesystems are shared by default. (You can probably use the 
"newinstance" option to disable sharing them.)


--
Jakub Wilk



Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-04 Thread Aurelien Jarno
On 2015-12-04 11:52, Jakub Wilk wrote:
> usertags 806882 + serious
> thanks
> 
> I've been bitten by it too...
> 
> Couldn't libc just leave ownership/permission as they are if /dev/pts is a
> devpts filesystem?

What do you mean? The libc doesn't change anymore the permissions
(pt_chown has been removed for security reasons), and that's actually
the issue.

> * Domenico Andreoli , 2015-12-02, 17:13:
> >$ grep devpts /etc/fstab
> >none  /mnt/sid64/dev/pts devpts   defaults
> >0   0
> >none  /mnt/sid64/home/chernobyl/dev/pts  devpts   defaults
> >0   0
> 
> "defaults" are not correct options. You need "gid=5" at least.

Well they are the one in the chroots...

> All devpts fstab entries need to have correct options, because all devpts
> filesystems are shared by default. (You can probably use the "newinstance"
> option to disable sharing them.)

You really mean the other entries in the fstab are causing the
permissions of /dev/pts to be changed?

In that case given the issue is due to a user misconfiguration, I guess
we should just try to detect it, display a note and fail the
installation.

Aurelien

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net



Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-04 Thread Aurelien Jarno
On 2015-12-04 17:20, Jakub Wilk wrote:
> Hi Aurelien!
> 
> Thanks for looking into this bug.
> 
> * Aurelien Jarno , 2015-12-04, 15:05:
> >>Couldn't libc just leave ownership/permission as they are if /dev/pts is
> >>a devpts filesystem?
> >
> >What do you mean? The libc doesn't change anymore the permissions
> >(pt_chown has been removed for security reasons), and that's actually the
> >issue.
> 
> grantpt() calls chown() or chmod() if the device ownership or mode is not
> what it expects. See sysdeps/unix/grantpt.c, lines 130-171.
> 
> And it Domenico's strace output, it was chown() that failed:
> 
> chown("/dev/pts/2", 1000, 5)= -1 EPERM (Operation not permitted)
> 
> Now, I realize that changing ownership and permissions of the device is
> exactly what grantpt() is documented to do. The problem is that it turns a
> minor configuration problem (devpts mounted without gid=5) into a big
> usability problem, which is difficult to debug.
> 
> IMO it'd be practical for glibc to assume that the devpts filesystem is
> always correctly configured and that changing ownership and permissions is
> not necessary. This would also fix bug #705056.

It might be practical and might work when grantpt() is preceded by the
call to posix_openpt(). It might break some programs which do other
things in between and which really assume that grantpt() is going to do
what it is supposed to do. It might even have some security implications.

And it will also likely be a POSIX violation as it clearly precise the
mode and the group to be used.

> >>* Domenico Andreoli , 2015-12-02, 17:13:
> >>>$ grep devpts /etc/fstab
> >>>none  /mnt/sid64/dev/pts devpts   defaults
> >>>0   0
> >>>none  /mnt/sid64/home/chernobyl/dev/pts  devpts   defaults
> >>>0   0
> >>
> >>"defaults" are not correct options. You need "gid=5" at least.
> >
> >Well they are the one in the chroots...
> >
> >>All devpts fstab entries need to have correct options, because all
> >>devpts filesystems are shared by default. (You can probably use the
> >>"newinstance" option to disable sharing them.)
> >
> >You really mean the other entries in the fstab are causing the permissions
> >of /dev/pts to be changed?
> 
> It's very surprising, but yet, this is the case, at least on Linux:
> 
> # mount | grep /dev/pts
> devpts on /dev/pts type devpts 
> (rw,nosuid,noexec,relatime,gid=5,mode=600,ptmxmode=000)
> # mount -t devpts devpts /mnt
> # mount | grep devpts
> devpts on /dev/pts type devpts 
> (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
> devpts on /mnt type devpts (rw,relatime,mode=600,ptmxmode=000)
> 
> As you can see, options changed for both mounts.

That's totally stupid and it seems to be also the case for chroots. And
it seems that at least cowbuilder is mounting /dev/pts in the chroot
with the default options.

> >In that case given the issue is due to a user misconfiguration, I guess we
> >should just try to detect it, display a note and fail the installation.
> 
> Warning the user would be certainly a good idea. But of course that would
> only help if the devpts filesystem was misconfigured at installation time.
> For me, this wasn't the case.

What was the issue on your case?

Aurelien

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net



Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-04 Thread Jakub Wilk

Hi Aurelien!

Thanks for looking into this bug.

* Aurelien Jarno , 2015-12-04, 15:05:
Couldn't libc just leave ownership/permission as they are if /dev/pts 
is a devpts filesystem?


What do you mean? The libc doesn't change anymore the permissions 
(pt_chown has been removed for security reasons), and that's actually 
the issue.


grantpt() calls chown() or chmod() if the device ownership or mode is 
not what it expects. See sysdeps/unix/grantpt.c, lines 130-171.


And it Domenico's strace output, it was chown() that failed:

chown("/dev/pts/2", 1000, 5)= -1 EPERM (Operation not permitted)

Now, I realize that changing ownership and permissions of the device is 
exactly what grantpt() is documented to do. The problem is that it turns 
a minor configuration problem (devpts mounted without gid=5) into a big 
usability problem, which is difficult to debug.


IMO it'd be practical for glibc to assume that the devpts filesystem is 
always correctly configured and that changing ownership and permissions 
is not necessary. This would also fix bug #705056.



* Domenico Andreoli , 2015-12-02, 17:13:

$ grep devpts /etc/fstab
none  /mnt/sid64/dev/pts devpts   defaults
0   0
none  /mnt/sid64/home/chernobyl/dev/pts  devpts   defaults
0   0


"defaults" are not correct options. You need "gid=5" at least.


Well they are the one in the chroots...

All devpts fstab entries need to have correct options, because all 
devpts filesystems are shared by default. (You can probably use the 
"newinstance" option to disable sharing them.)


You really mean the other entries in the fstab are causing the 
permissions of /dev/pts to be changed?


It's very surprising, but yet, this is the case, at least on Linux:

# mount | grep /dev/pts
devpts on /dev/pts type devpts 
(rw,nosuid,noexec,relatime,gid=5,mode=600,ptmxmode=000)
# mount -t devpts devpts /mnt
# mount | grep devpts
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
devpts on /mnt type devpts (rw,relatime,mode=600,ptmxmode=000)

As you can see, options changed for both mounts.

In that case given the issue is due to a user misconfiguration, I guess 
we should just try to detect it, display a note and fail the 
installation.


Warning the user would be certainly a good idea. But of course that 
would only help if the devpts filesystem was misconfigured at 
installation time. For me, this wasn't the case.


--
Jakub Wilk



Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-03 Thread Aurelien Jarno
On 2015-12-03 09:50, Domenico Andreoli wrote:
> On Wed, Dec 2, 2015 at 5:44 PM, Aurelien Jarno  wrote:
> 
> > On 2015-12-02 17:13, Domenico Andreoli wrote:
> > > On Wed, Dec 2, 2015 at 5:06 PM, Aurelien Jarno 
> > wrote:
> > >
> > > > On 2015-12-02 13:45, Domenico Andreoli wrote:
> > > > > Package: libc-bin
> > > > > Version: 2.21-1
> > > > >
> > > > > Hi,
> > > > >
> > > > >   I'm unable to open some terminal applications like rxvt and
> > konsole,
> > > > > don't know why but xterm still works.
> > > > >
> > > > > Running rxvt gives this output:
> > > > >
> > > > > $ rxvt
> > > > > rxvt: can't open pseudo-tty
> > > > > rxvt: aborting
> > > > > $ strace rxvt
> > > > > statfs("/dev/pts", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096,
> > > > f_blocks=0,
> > > > > f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0},
> > > > f_namelen=255,
> > > > > f_frsize=4096}) = 0
> > > > > ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
> > > > > ioctl(4, TIOCGPTN, [2]) = 0
> > > > > stat("/dev/pts/2", {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2),
> > ...})
> > > > = 0
> > > > > getuid()= 1000
> > > > > open("/etc/group", O_RDONLY|O_CLOEXEC)  = 5
> > > > > lseek(5, 0, SEEK_CUR)   = 0
> > > > > fstat(5, {st_mode=S_IFREG|0644, st_size=624, ...}) = 0
> > > > > mmap(NULL, 624, PROT_READ, MAP_SHARED, 5, 0) = 0x7f02d0366000
> > > > > lseek(5, 624, SEEK_SET) = 624
> > > > > munmap(0x7f02d0366000, 624) = 0
> > > > > close(5)= 0
> > > > > chown("/dev/pts/2", 1000, 5)= -1 EPERM (Operation not
> > > > permitted)
> > > > > close(4)= 0
> > > > > open("/dev/pty??", O_RDWR|O_NOCTTY) = -1 ENOENT (No such file or
> > > > > directory)
> > > > > write(2, "rxvt: ", 6rxvt: )   = 6
> > > > > write(2, "can't open pseudo-tty", 21can't open pseudo-tty)   = 21
> > > > > write(2, "\n", 1
> > > > > )
> > > > > $ ls -l /dev/pts/*
> > > > > crw--- 1 cavok cavok 136, 0 Dec  2  2015 /dev/pts/0
> > > > > crw--- 1 cavok cavok 136, 1 Dec  2 12:38 /dev/pts/1
> > > > >
> > > > > Investigating konsole, the issue looks the same: unable to set pts
> > > > > permission.
> > > > >
> > > > > Downgrading libc6 and libc6-i686 to 2.19-22 doesn't help, but
> > downgrading
> > > > > libc-bin actually does the trick.
> > > > >
> > > > > Could you please help here?
> > > >
> > > > This is due to the changes introduced to fix the bug #717544. Your
> > > > system is supposed to have /dev/pts mounted with some options:
> > > >
> > > >   devpts on /dev/pts type devpts
> > > > (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
> > > >
> > > > This should be the default and can be modified in /etc/default/devpts.
> > > > It looks like in your case /dev/pts is not mounted or mounted with the
> > > > wrong options. Can you send the output of the following command:
> > > >
> > > >   mount | grep devpts
> > > >
> > >
> > > $ mount | grep devpts
> > > devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
> > > none on /mnt/sid64/dev/pts type devpts (rw,relatime,mode=600)
> > > none on /mnt/sid64/home/chernobyl/dev/pts type devpts
> > (rw,relatime,mode=600)
> > > $ grep devpts /etc/fstab
> > > none  /mnt/sid64/dev/pts devpts   defaults
> > > 0   0
> > > none  /mnt/sid64/home/chernobyl/dev/pts  devpts   defaults
> > > 0   0
> > >
> > > commenting out TTYGRP in /etc/default/devpts doesn't help.
> >
> > Ok. Do you have a /dev/ptmx device and what are its permissions?
> >
> 
> $ ls -l /dev/ptmx
> crw-rw-rw- 1 root tty 5, 2 Dec  3 08:48 /dev/ptmx

That looks fine.

So far I am lacking ideas. That said if you want to use the glibc 2.21
and try to debug it yourself, you can copy /usr/lib/pt_chown (with mode
4755) from libc-bin 2.19.

Aurelien

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net



Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-03 Thread Domenico Andreoli
On Wed, Dec 2, 2015 at 5:44 PM, Aurelien Jarno  wrote:

> On 2015-12-02 17:13, Domenico Andreoli wrote:
> > On Wed, Dec 2, 2015 at 5:06 PM, Aurelien Jarno 
> wrote:
> >
> > > On 2015-12-02 13:45, Domenico Andreoli wrote:
> > > > Package: libc-bin
> > > > Version: 2.21-1
> > > >
> > > > Hi,
> > > >
> > > >   I'm unable to open some terminal applications like rxvt and
> konsole,
> > > > don't know why but xterm still works.
> > > >
> > > > Running rxvt gives this output:
> > > >
> > > > $ rxvt
> > > > rxvt: can't open pseudo-tty
> > > > rxvt: aborting
> > > > $ strace rxvt
> > > > statfs("/dev/pts", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096,
> > > f_blocks=0,
> > > > f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0},
> > > f_namelen=255,
> > > > f_frsize=4096}) = 0
> > > > ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
> > > > ioctl(4, TIOCGPTN, [2]) = 0
> > > > stat("/dev/pts/2", {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2),
> ...})
> > > = 0
> > > > getuid()= 1000
> > > > open("/etc/group", O_RDONLY|O_CLOEXEC)  = 5
> > > > lseek(5, 0, SEEK_CUR)   = 0
> > > > fstat(5, {st_mode=S_IFREG|0644, st_size=624, ...}) = 0
> > > > mmap(NULL, 624, PROT_READ, MAP_SHARED, 5, 0) = 0x7f02d0366000
> > > > lseek(5, 624, SEEK_SET) = 624
> > > > munmap(0x7f02d0366000, 624) = 0
> > > > close(5)= 0
> > > > chown("/dev/pts/2", 1000, 5)= -1 EPERM (Operation not
> > > permitted)
> > > > close(4)= 0
> > > > open("/dev/pty??", O_RDWR|O_NOCTTY) = -1 ENOENT (No such file or
> > > > directory)
> > > > write(2, "rxvt: ", 6rxvt: )   = 6
> > > > write(2, "can't open pseudo-tty", 21can't open pseudo-tty)   = 21
> > > > write(2, "\n", 1
> > > > )
> > > > $ ls -l /dev/pts/*
> > > > crw--- 1 cavok cavok 136, 0 Dec  2  2015 /dev/pts/0
> > > > crw--- 1 cavok cavok 136, 1 Dec  2 12:38 /dev/pts/1
> > > >
> > > > Investigating konsole, the issue looks the same: unable to set pts
> > > > permission.
> > > >
> > > > Downgrading libc6 and libc6-i686 to 2.19-22 doesn't help, but
> downgrading
> > > > libc-bin actually does the trick.
> > > >
> > > > Could you please help here?
> > >
> > > This is due to the changes introduced to fix the bug #717544. Your
> > > system is supposed to have /dev/pts mounted with some options:
> > >
> > >   devpts on /dev/pts type devpts
> > > (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
> > >
> > > This should be the default and can be modified in /etc/default/devpts.
> > > It looks like in your case /dev/pts is not mounted or mounted with the
> > > wrong options. Can you send the output of the following command:
> > >
> > >   mount | grep devpts
> > >
> >
> > $ mount | grep devpts
> > devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
> > none on /mnt/sid64/dev/pts type devpts (rw,relatime,mode=600)
> > none on /mnt/sid64/home/chernobyl/dev/pts type devpts
> (rw,relatime,mode=600)
> > $ grep devpts /etc/fstab
> > none  /mnt/sid64/dev/pts devpts   defaults
> > 0   0
> > none  /mnt/sid64/home/chernobyl/dev/pts  devpts   defaults
> > 0   0
> >
> > commenting out TTYGRP in /etc/default/devpts doesn't help.
>
> Ok. Do you have a /dev/ptmx device and what are its permissions?
>

$ ls -l /dev/ptmx
crw-rw-rw- 1 root tty 5, 2 Dec  3 08:48 /dev/ptmx

thanks,
Domenico


Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-02 Thread Aurelien Jarno
On 2015-12-02 13:45, Domenico Andreoli wrote:
> Package: libc-bin
> Version: 2.21-1
> 
> Hi,
> 
>   I'm unable to open some terminal applications like rxvt and konsole,
> don't know why but xterm still works.
> 
> Running rxvt gives this output:
> 
> $ rxvt
> rxvt: can't open pseudo-tty
> rxvt: aborting
> $ strace rxvt
> statfs("/dev/pts", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096, f_blocks=0,
> f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255,
> f_frsize=4096}) = 0
> ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
> ioctl(4, TIOCGPTN, [2]) = 0
> stat("/dev/pts/2", {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2), ...}) = 0
> getuid()= 1000
> open("/etc/group", O_RDONLY|O_CLOEXEC)  = 5
> lseek(5, 0, SEEK_CUR)   = 0
> fstat(5, {st_mode=S_IFREG|0644, st_size=624, ...}) = 0
> mmap(NULL, 624, PROT_READ, MAP_SHARED, 5, 0) = 0x7f02d0366000
> lseek(5, 624, SEEK_SET) = 624
> munmap(0x7f02d0366000, 624) = 0
> close(5)= 0
> chown("/dev/pts/2", 1000, 5)= -1 EPERM (Operation not permitted)
> close(4)= 0
> open("/dev/pty??", O_RDWR|O_NOCTTY) = -1 ENOENT (No such file or
> directory)
> write(2, "rxvt: ", 6rxvt: )   = 6
> write(2, "can't open pseudo-tty", 21can't open pseudo-tty)   = 21
> write(2, "\n", 1
> )
> $ ls -l /dev/pts/*
> crw--- 1 cavok cavok 136, 0 Dec  2  2015 /dev/pts/0
> crw--- 1 cavok cavok 136, 1 Dec  2 12:38 /dev/pts/1
> 
> Investigating konsole, the issue looks the same: unable to set pts
> permission.
> 
> Downgrading libc6 and libc6-i686 to 2.19-22 doesn't help, but downgrading
> libc-bin actually does the trick.
> 
> Could you please help here?

This is due to the changes introduced to fix the bug #717544. Your
system is supposed to have /dev/pts mounted with some options:

  devpts on /dev/pts type devpts 
(rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)

This should be the default and can be modified in /etc/default/devpts.
It looks like in your case /dev/pts is not mounted or mounted with the
wrong options. Can you send the output of the following command:

  mount | grep devpts

Thanks,
Aurelien

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net



Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-02 Thread Domenico Andreoli
On Wed, Dec 2, 2015 at 5:06 PM, Aurelien Jarno  wrote:

> On 2015-12-02 13:45, Domenico Andreoli wrote:
> > Package: libc-bin
> > Version: 2.21-1
> >
> > Hi,
> >
> >   I'm unable to open some terminal applications like rxvt and konsole,
> > don't know why but xterm still works.
> >
> > Running rxvt gives this output:
> >
> > $ rxvt
> > rxvt: can't open pseudo-tty
> > rxvt: aborting
> > $ strace rxvt
> > statfs("/dev/pts", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096,
> f_blocks=0,
> > f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0},
> f_namelen=255,
> > f_frsize=4096}) = 0
> > ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
> > ioctl(4, TIOCGPTN, [2]) = 0
> > stat("/dev/pts/2", {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2), ...})
> = 0
> > getuid()= 1000
> > open("/etc/group", O_RDONLY|O_CLOEXEC)  = 5
> > lseek(5, 0, SEEK_CUR)   = 0
> > fstat(5, {st_mode=S_IFREG|0644, st_size=624, ...}) = 0
> > mmap(NULL, 624, PROT_READ, MAP_SHARED, 5, 0) = 0x7f02d0366000
> > lseek(5, 624, SEEK_SET) = 624
> > munmap(0x7f02d0366000, 624) = 0
> > close(5)= 0
> > chown("/dev/pts/2", 1000, 5)= -1 EPERM (Operation not
> permitted)
> > close(4)= 0
> > open("/dev/pty??", O_RDWR|O_NOCTTY) = -1 ENOENT (No such file or
> > directory)
> > write(2, "rxvt: ", 6rxvt: )   = 6
> > write(2, "can't open pseudo-tty", 21can't open pseudo-tty)   = 21
> > write(2, "\n", 1
> > )
> > $ ls -l /dev/pts/*
> > crw--- 1 cavok cavok 136, 0 Dec  2  2015 /dev/pts/0
> > crw--- 1 cavok cavok 136, 1 Dec  2 12:38 /dev/pts/1
> >
> > Investigating konsole, the issue looks the same: unable to set pts
> > permission.
> >
> > Downgrading libc6 and libc6-i686 to 2.19-22 doesn't help, but downgrading
> > libc-bin actually does the trick.
> >
> > Could you please help here?
>
> This is due to the changes introduced to fix the bug #717544. Your
> system is supposed to have /dev/pts mounted with some options:
>
>   devpts on /dev/pts type devpts
> (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
>
> This should be the default and can be modified in /etc/default/devpts.
> It looks like in your case /dev/pts is not mounted or mounted with the
> wrong options. Can you send the output of the following command:
>
>   mount | grep devpts
>

$ mount | grep devpts
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
none on /mnt/sid64/dev/pts type devpts (rw,relatime,mode=600)
none on /mnt/sid64/home/chernobyl/dev/pts type devpts (rw,relatime,mode=600)
$ grep devpts /etc/fstab
none  /mnt/sid64/dev/pts devpts   defaults
0   0
none  /mnt/sid64/home/chernobyl/dev/pts  devpts   defaults
0   0

commenting out TTYGRP in /etc/default/devpts doesn't help.

thanks,
Domenico


Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-02 Thread Aurelien Jarno
On 2015-12-02 17:13, Domenico Andreoli wrote:
> On Wed, Dec 2, 2015 at 5:06 PM, Aurelien Jarno  wrote:
> 
> > On 2015-12-02 13:45, Domenico Andreoli wrote:
> > > Package: libc-bin
> > > Version: 2.21-1
> > >
> > > Hi,
> > >
> > >   I'm unable to open some terminal applications like rxvt and konsole,
> > > don't know why but xterm still works.
> > >
> > > Running rxvt gives this output:
> > >
> > > $ rxvt
> > > rxvt: can't open pseudo-tty
> > > rxvt: aborting
> > > $ strace rxvt
> > > statfs("/dev/pts", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096,
> > f_blocks=0,
> > > f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0},
> > f_namelen=255,
> > > f_frsize=4096}) = 0
> > > ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
> > > ioctl(4, TIOCGPTN, [2]) = 0
> > > stat("/dev/pts/2", {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2), ...})
> > = 0
> > > getuid()= 1000
> > > open("/etc/group", O_RDONLY|O_CLOEXEC)  = 5
> > > lseek(5, 0, SEEK_CUR)   = 0
> > > fstat(5, {st_mode=S_IFREG|0644, st_size=624, ...}) = 0
> > > mmap(NULL, 624, PROT_READ, MAP_SHARED, 5, 0) = 0x7f02d0366000
> > > lseek(5, 624, SEEK_SET) = 624
> > > munmap(0x7f02d0366000, 624) = 0
> > > close(5)= 0
> > > chown("/dev/pts/2", 1000, 5)= -1 EPERM (Operation not
> > permitted)
> > > close(4)= 0
> > > open("/dev/pty??", O_RDWR|O_NOCTTY) = -1 ENOENT (No such file or
> > > directory)
> > > write(2, "rxvt: ", 6rxvt: )   = 6
> > > write(2, "can't open pseudo-tty", 21can't open pseudo-tty)   = 21
> > > write(2, "\n", 1
> > > )
> > > $ ls -l /dev/pts/*
> > > crw--- 1 cavok cavok 136, 0 Dec  2  2015 /dev/pts/0
> > > crw--- 1 cavok cavok 136, 1 Dec  2 12:38 /dev/pts/1
> > >
> > > Investigating konsole, the issue looks the same: unable to set pts
> > > permission.
> > >
> > > Downgrading libc6 and libc6-i686 to 2.19-22 doesn't help, but downgrading
> > > libc-bin actually does the trick.
> > >
> > > Could you please help here?
> >
> > This is due to the changes introduced to fix the bug #717544. Your
> > system is supposed to have /dev/pts mounted with some options:
> >
> >   devpts on /dev/pts type devpts
> > (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
> >
> > This should be the default and can be modified in /etc/default/devpts.
> > It looks like in your case /dev/pts is not mounted or mounted with the
> > wrong options. Can you send the output of the following command:
> >
> >   mount | grep devpts
> >
> 
> $ mount | grep devpts
> devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
> none on /mnt/sid64/dev/pts type devpts (rw,relatime,mode=600)
> none on /mnt/sid64/home/chernobyl/dev/pts type devpts (rw,relatime,mode=600)
> $ grep devpts /etc/fstab
> none  /mnt/sid64/dev/pts devpts   defaults
> 0   0
> none  /mnt/sid64/home/chernobyl/dev/pts  devpts   defaults
> 0   0
> 
> commenting out TTYGRP in /etc/default/devpts doesn't help.

Ok. Do you have a /dev/ptmx device and what are its permissions?

Aurelien

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net



Bug#806882: libc-bin: unable to set pts permissions (and open a terminal...)

2015-12-02 Thread Domenico Andreoli
Package: libc-bin
Version: 2.21-1

Hi,

  I'm unable to open some terminal applications like rxvt and konsole,
don't know why but xterm still works.

Running rxvt gives this output:

$ rxvt
rxvt: can't open pseudo-tty
rxvt: aborting
$ strace rxvt
statfs("/dev/pts", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096, f_blocks=0,
f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255,
f_frsize=4096}) = 0
ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, TIOCGPTN, [2]) = 0
stat("/dev/pts/2", {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2), ...}) = 0
getuid()= 1000
open("/etc/group", O_RDONLY|O_CLOEXEC)  = 5
lseek(5, 0, SEEK_CUR)   = 0
fstat(5, {st_mode=S_IFREG|0644, st_size=624, ...}) = 0
mmap(NULL, 624, PROT_READ, MAP_SHARED, 5, 0) = 0x7f02d0366000
lseek(5, 624, SEEK_SET) = 624
munmap(0x7f02d0366000, 624) = 0
close(5)= 0
chown("/dev/pts/2", 1000, 5)= -1 EPERM (Operation not permitted)
close(4)= 0
open("/dev/pty??", O_RDWR|O_NOCTTY) = -1 ENOENT (No such file or
directory)
write(2, "rxvt: ", 6rxvt: )   = 6
write(2, "can't open pseudo-tty", 21can't open pseudo-tty)   = 21
write(2, "\n", 1
)
$ ls -l /dev/pts/*
crw--- 1 cavok cavok 136, 0 Dec  2  2015 /dev/pts/0
crw--- 1 cavok cavok 136, 1 Dec  2 12:38 /dev/pts/1

Investigating konsole, the issue looks the same: unable to set pts
permission.

Downgrading libc6 and libc6-i686 to 2.19-22 doesn't help, but downgrading
libc-bin actually does the trick.

Could you please help here?

Kind regards,
Domenico