ports/154967: x11/mrvt-devel can't parse tty name "pts"

Zhihao Yuan lichray at gmail.com
Wed Feb 23 04:50:09 UTC 2011


>Number:         154967
>Category:       ports
>Synopsis:       x11/mrvt-devel can't parse tty name "pts"
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 23 04:50:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Zhihao Yuan
>Release:        FreeBSD 8.2-PRERELEASE
>Organization:
Northern Illinois University
>Environment:
FreeBSD compaq.yuetime 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Tue Feb 22 00:45:24 CST 2011     root at compaq.yuetime:/usr/obj/usr/src/sys/HOUKAGO  amd64
>Description:
At compile time, mrxvt detects SysV style tty by checking whether struct 
utmp has ut_pid. FreeBSD >= 7 uses the SysV style TTY naming, but not 
ut_pid.
So basically, mrxvt is possible to be able to parse the tty name but it 
refuses to do so since it made the above assumption.
>How-To-Repeat:
run a compiled mrxvt on FreeBSD RELENG_8, then the tty of mrxvt says
can't parse tty name "pts/N"
The N corresponds to the pts number.
>Fix:
Delete the compilation time HAVE_UTMP_PID checking in the code which
parses the TTY names. This makes no side-effect to other parts of the
program, just enables the correct pts/N name, so the lastlog works.

Patch attached with submission follows:

--- src/logging.c.orig	2008-02-17 16:04:50.000000000 -0600
+++ src/logging.c	2011-01-12 05:44:00.695303906 -0600
@@ -89,9 +89,7 @@ rxvt_makeutent(rxvt_t *r, int page, cons
 #if defined(HAVE_STRUCT_UTMPX) && !defined(HAVE_STRUCT_UTMP)
     struct utmpx   *utx = &(PVTS(r, page)->utx);
 #endif
-#ifdef HAVE_UTMP_PID
     int             i;
-#endif
     char            ut_id[5];
     struct passwd  *pwent = getpwuid(getuid());
 
@@ -101,10 +99,8 @@ rxvt_makeutent(rxvt_t *r, int page, cons
     if (!STRNCMP(pty, "pty", 3) || !STRNCMP(pty, "tty", 3)) {
 	STRNCPY(ut_id, (pty + 3), sizeof(ut_id));
     }
-#ifdef HAVE_UTMP_PID
     else if (sscanf(pty, "pts/%d", &i) == 1)
 	sprintf(ut_id, "vt%02x", (i & 0xff));	/* sysv naming */
-#endif
     else if (STRNCMP(pty, "pty", 3) && STRNCMP(pty, "tty", 3)) {
 	rxvt_msg (DBG_ERROR, DBG_LOGGING, "can't parse tty name \"%s\"", pty);
 	return;


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list