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

Bug#137260: marked as done (libc6: grantpt should set slave pty group writable, but does not)



Your message dated Mon, 22 May 2006 09:44:22 +0200
with message-id <20060522074421.GA13264@henry.aurel32.net>
and subject line Bug#137260: libc6: grantpt should set slave pty group writable, but does not
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libc6
Version: 2.2.5-3
Severity: normal

According to the glibc manual,

 - Function: int grantpt (int FILEDES)
     The `grantpt' function changes the ownership and access permission
     of the slave pseudo-terminal device corresponding to the master
     pseudo-terminal device associated with the file descriptor
     FILEDES.  The owner is set from the real user ID of the calling
     process (*note Process Persona::), and the group is set to a
     special group (typically "tty") or from the real group ID of the
     calling process.  The access permission is set such that the file
     is both readable and writable by the owner and only writable by
     the group.

However, if I try it in real life, here is the result:

crw-------    1 root     tty      136,   4 Dec 31  1969 /dev/pts/4

Is pt_chown not doing its thing or something? For what it's worth, I'm
using devfs, although I see the same behavior on another system that is
using devpts. It looks like mounting devpts with mode=620 might give the
documented behavior, but that is not the default as far as I can tell.

Here's my little test program:

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>

main () {
	struct stat buf;
	char *pts;
	int p = open("/dev/ptmx", O_RDWR);
	if (p == -1)
		perror("open");
	if (grantpt(p) == -1)
		perror("grantpt");
	pts = ptsname(p);
	if (pts == NULL) 
		perror("ttyname");
	stat(pts, &buf);
	fprintf(stderr, "%s is mode %lo\n", pts, (long) buf.st_mode);
}

-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux silk 2.4.18 #1 Tue Feb 26 00:23:37 EST 2002 i686
Locale: LANG=C, LC_CTYPE=C



--- End Message ---
--- Begin Message ---
On Thu, Mar 07, 2002 at 02:38:14PM -0500, Joey Hess wrote:
> Package: libc6
> Version: 2.2.5-3
> Severity: normal
> 
> According to the glibc manual,
> 
>  - Function: int grantpt (int FILEDES)
>      The `grantpt' function changes the ownership and access permission
>      of the slave pseudo-terminal device corresponding to the master
>      pseudo-terminal device associated with the file descriptor
>      FILEDES.  The owner is set from the real user ID of the calling
>      process (*note Process Persona::), and the group is set to a
>      special group (typically "tty") or from the real group ID of the
>      calling process.  The access permission is set such that the file
>      is both readable and writable by the owner and only writable by
>      the group.
> 
> However, if I try it in real life, here is the result:
> 
> crw-------    1 root     tty      136,   4 Dec 31  1969 /dev/pts/4
> 
> Is pt_chown not doing its thing or something? For what it's worth, I'm
> using devfs, although I see the same behavior on another system that is
> using devpts. It looks like mounting devpts with mode=620 might give the
> documented behavior, but that is not the default as far as I can tell.
> 
mode=620 is now the default mounting mode for devpts in Debian, so the
function is now working correctly. I am therefore closing the bug. Feel
free to reopen it if you don't agree.

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

--- End Message ---

Reply to: