Date: Thu, 23 Dec 1999 01:52:29 +1030 (CST) From: Mark Newton <newton@atdot.dotat.org> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/15628: Eterm patch for setuid operation and fixed VSTATUS handling Message-ID: <199912221522.BAA24144@atdot.dotat.org>
next in thread | raw e-mail | index | archive | help
>Number: 15628 >Category: ports >Synopsis: Eterm mis-handles ^J, and also glitches with setuid operation >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Dec 22 07:30:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Mark Newton >Release: FreeBSD 4.0-CURRENT i386 >Organization: none >Environment: Eterm-0.8.9 port >Description: Much mailing list traffic has been expended on the fact that Eterm users who hit the return key tend to see a line like "load: 0.26 cmd: cat 24061 [ttyin] 0.00u 0.00s 0% 88k" instead of having their input line actually acted on. Additionally, the eterm 0.8.9 port doesn't handle setuid operation correctly, utmp logging doesn't work and the tty device it's running on doesn't get chown'ed (so biff, mesg and friends don't work). The patch below fixes the problem. >How-To-Repeat: Install the Eterm port; Type "cat" and hit return a few times. Type "mesg n" and observe the "permission denied" messages. >Fix: See the patch below. The patch affects src/command.c. It seems that the Eterm handling of saved setuid is bogus, or perhaps Eterm's interpretation of how it should work differs from our interpretation of how it really works :-). I've dealt with this problem by pretending it doesn't exist: If you #undef the config parameter which says you support saved setuid, the Eterm source will fall-back to traditional UNIX setuid handling, which doesn't exhibit the same problems Eterm produces when it tries to used saved setuid. As such, "#undef HAVE_SAVED_UIDS" just after including config.h works-around the bug (so this isn't really a fix; it just brute-force encourages Eterm to try another way to do the thing it's trying to do). The second part of the patch adds support for the VSTATUS termios control character to the terminal setup part of command.c. The patch includes <sys/ttydefaults.h> and sets the VSTATUS character to CSTATUS like god intended. This stops the annoying kerninfo output whenever you hit the RETURN key while the terminal is in canonical mode (i.e.: whenever you're running a program which expects to consume stdin, like "su" or "cat"). According to a quick perusal of the mailing list archive, people have been complaining about this one since August, so it's probably about time it was fixed :-) *** src/command.c.old Thu Dec 23 01:39:37 1999 --- src/command.c Thu Dec 23 01:42:00 1999 *************** *** 40,45 **** --- 40,47 ---- #include "feature.h" #include "config.h" + #undef HAVE_SAVED_UIDS + /* System Headers */ #include <stdio.h> #include <stdlib.h> *************** *** 120,125 **** --- 122,128 ---- #endif #ifdef HAVE_TERMIOS_H # include <termios.h> + # include <sys/ttydefaults.h> #else # include <sgtty.h> #endif *************** *** 2100,2105 **** --- 2103,2111 ---- # endif # if VTIME != VEOL tio->c_cc[VTIME] = 0; + # endif + # ifdef VSTATUS + tio->c_cc[VSTATUS] = CSTATUS; # endif /* input modes */ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912221522.BAA24144>