# ------------------------------------------------------------------------------
# MANIFEST | 2
# Tekproc.c | 110 ++++++++++-------------------------------------------
# charproc.c | 28 +++++++------
# input.c | 43 +++++++++++++++++---
# main.c | 18 +++++---
# menu.c | 5 +-
# menu.h | 2
# misc.c | 114 +++++++++++++++++++++++++++++++++++++++++++------------
# os2main.c | 2
# ptyx.h | 1
# resize.c | 3 +
# util.c | 8 +++
# version.h | 2
# xterm.h | 11 +++--
# xterm.log.html | 38 ++++++++++++++++++
# 15 files changed, 239 insertions, 148 deletions
# ------------------------------------------------------------------------------
Index: MANIFEST
--- xterm-130/MANIFEST Thu Feb 17 17:33:19 2000
+++ xterm-131/MANIFEST Fri Mar 3 05:45:55 2000
@@ -1,4 +1,4 @@
-MANIFEST for xterm-128, version xterm-128
+MANIFEST for xterm-131, version xterm-131
--------------------------------------------------------------------------------
MANIFEST this file
256colres.h resource-definitions for 256-color mode
Index: Tekproc.c
--- xterm-130/Tekproc.c Wed Feb 9 17:47:18 2000
+++ xterm-131/Tekproc.c Thu Mar 2 22:36:25 2000
@@ -79,9 +79,7 @@
#include <error.h>
#include <menu.h>
-#ifdef X_NOT_STDC_ENV
-extern time_t time ();
-#else
+#ifndef X_NOT_STDC_ENV
#include <time.h>
#endif
@@ -1732,11 +1730,9 @@
if (!tekWidget)
return;
if (reset) {
-/* bzero ((char *)&curmodes, sizeof(Tmodes)); */
bzero ((char *) &screen->cur, sizeof screen->cur);
}
TekRefresh = (TekLink *)0;
-/* screen->cur = curmodes; */
TekPage ();
screen->cur_X = 0;
screen->cur_Y = TEKHOME;
@@ -1747,40 +1743,28 @@
void
TekCopy(void)
{
- register TScreen *screen = &term->screen;
- register struct tm *tp;
- time_t l;
- char buf[32];
- int pid;
-#ifndef HAVE_WAITPID
- int waited;
- SIGNAL_T (*chldfunc) (int);
+ TScreen *screen = &term->screen;
- chldfunc = signal(SIGCHLD, SIG_DFL);
-#endif
-#ifdef VMS
- register int tekcopyfd;
- register TekLink *Tp;
- char initbuf[5];
-#endif /* VMS */
+ TekLink *Tp;
+ char buf[32];
+ char initbuf[5];
+ int tekcopyfd;
+
+ timestamp_filename(buf, "COPY");
+ if (access(buf, F_OK) >= 0
+ && access(buf, W_OK) < 0) {
+ Bell(XkbBI_MinorError,0);
+ return;
+ }
- time(&l);
- tp = localtime(&l);
- /* VMS needs alternate format??? DRM */
- sprintf(buf, "COPY%d-%02d-%02d.%02d:%02d:%02d", tp->tm_year + 1900,
- tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min, tp->tm_sec);
- if(access(buf, F_OK) >= 0) { /* file exists */
- if(access(buf, W_OK) < 0) {
- Bell(XkbBI_MinorError,0);
- return;
- }
-#ifdef VMS
+#ifndef VMS
+ if(access(".", W_OK) < 0) { /* can't write in directory */
+ Bell(XkbBI_MinorError,0);
+ return;
+ }
+#endif
- if((tekcopyfd = open(buf, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) {
- Bell(XkbBI_MinorError,0);
- return;
- }
- chown(buf, screen->uid, screen->gid);
+ if ((tekcopyfd = open_userfile(screen->uid, screen->gid, buf, False)) >= 0) {
sprintf(initbuf, "%c%c%c%c",
ESC, screen->page.fontsize + '8',
ESC, screen->page.linetype + '`');
@@ -1791,57 +1775,5 @@
Tp = Tp->next;
} while(Tp);
close(tekcopyfd);
-#else /* VMS */
- } else if(access(".", W_OK) < 0) { /* can't write in directory */
- Bell(XkbBI_MinorError,0);
- return;
- }
-
- /* Write the file in an unprivileged child process because
- using access before the open still leaves a small window
- of opportunity. */
- pid = fork();
-
- if (pid == 0) { /* child */
- register int tekcopyfd;
- char initbuf[5];
- register TekLink *Tp;
-
- setgid(screen->gid);
- setuid(screen->uid);
- tekcopyfd = open(buf, O_WRONLY | O_CREAT | O_TRUNC, 0666);
- if (tekcopyfd < 0)
- _exit(1);
- sprintf(initbuf, "%c%c%c%c",
- ESC, screen->page.fontsize + '8',
- ESC, screen->page.linetype + '`');
- write(tekcopyfd, initbuf, 4);
- Tp = &Tek0;
- do {
- write(tekcopyfd, (char *)Tp->data, Tp->count);
- Tp = Tp->next;
- } while(Tp);
- close(tekcopyfd);
- _exit(0);
- } else if (pid < 0) { /* error */
- Bell(XkbBI_MinorError,0);
- return;
- } else { /* parent */
-#ifdef HAVE_WAITPID
- waitpid(pid, NULL, 0);
-#else
- waited = wait(NULL);
- signal(SIGCHLD, chldfunc);
- /*
- Since we had the signal handler uninstalled for a while,
- we might have missed the termination of our screen child.
- If we can check for this possibility without hanging, do so.
- */
- do
- if (waited == term->screen.pid)
- Cleanup(0);
- while ( (waited=nonblocking_wait()) > 0);
-#endif
-#endif /* VMS */
- }
+ }
}
Index: charproc.c
--- xterm-130/charproc.c Wed Mar 1 02:22:43 2000
+++ xterm-131/charproc.c Thu Mar 2 22:53:46 2000
@@ -251,16 +251,16 @@
! @Num_Lock Ctrl <Btn3Down>:popup-menu(fontMenu) \n\
~Ctrl ~Meta <Btn3Down>:start-extend() \n\
~Meta <Btn3Motion>:select-extend() \n\
- Ctrl <Btn4Down>:scroll-back(1,halfpage) \n\
- Lock Ctrl <Btn4Down>:scroll-back(1,halfpage) \n\
- Lock @Num_Lock Ctrl <Btn4Down>:scroll-back(1,halfpage) \n\
- @Num_Lock Ctrl <Btn4Down>:scroll-back(1,halfpage) \n\
- <Btn4Down>:scroll-back(5,line) \n\
- Ctrl <Btn5Down>:scroll-forw(1,halfpage) \n\
- Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage) \n\
- Lock @Num_Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage) \n\
- @Num_Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage) \n\
- <Btn5Down>:scroll-forw(5,line) \n\
+ Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
+ Lock Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
+ Lock @Num_Lock Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
+ @Num_Lock Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
+ <Btn4Down>:scroll-back(5,line,m) \n\
+ Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
+ Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
+ Lock @Num_Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
+ @Num_Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
+ <Btn5Down>:scroll-forw(5,line,m) \n\
<BtnUp>:select-end(PRIMARY, CUT_BUFFER0) \n\
<BtnDown>:bell(0) \
"; /* PROCURA added "Meta <Btn2Down>:clear-saved-lines()" */
@@ -328,6 +328,9 @@
#if OPT_BLINK_CURS
{ "set-cursorblink", HandleCursorBlink },
#endif
+#if OPT_BOX_CHARS
+ { "set-font-linedrawing", HandleFontBoxChars },
+#endif
#if OPT_DEC_CHRSET
{ "set-font-doublesize", HandleFontDoublesize },
#endif
@@ -470,7 +473,7 @@
{XtNoldXtermFKeys, XtCOldXtermFKeys, XtRBoolean, sizeof(Boolean),
XtOffsetOf(XtermWidgetRec, screen.old_fkeys),
XtRBoolean, (XtPointer) &defaultFALSE},
-Bres(XtNdeleteIsDEL, XtCDeleteIsDEL, screen.delete_is_del, FALSE),
+Bres(XtNdeleteIsDEL, XtCDeleteIsDEL, screen.delete_is_del, 2),
#ifdef ALLOWLOGGING
{XtNlogFile, XtCLogfile, XtRString, sizeof(char *),
XtOffsetOf(XtermWidgetRec, screen.logfile),
@@ -3291,7 +3294,7 @@
#endif
#if OPT_SCO_FUNC_KEYS
case 1053:
- set_keyboard_type(keyboardIsHP, func == bitset);
+ set_keyboard_type(keyboardIsSCO, func == bitset);
break;
#endif
case 1060:
@@ -4307,6 +4310,7 @@
wnew->screen.Acolors[i] = request->screen.Acolors[i];
#if OPT_COLOR_RES
TRACE(("Acolors[%d] = %s\n", i, request->screen.Acolors[i].resource));
+ wnew->screen.Acolors[i].mode = False;
if (strcmp(wnew->screen.Acolors[i].resource, XtDefaultForeground))
color_ok = True;
#else
Index: input.c
--- xterm-130/input.c Tue Feb 29 21:32:48 2000
+++ xterm-131/input.c Fri Mar 3 05:35:00 2000
@@ -202,6 +202,7 @@
for (n = 0; n < sizeof(table)/sizeof(table[0]); n++) {
if (table[n].before == keysym) {
+ TRACE(("...Input keypad before was %#04lx\n", keysym));
keysym = table[n].after;
TRACE(("...Input keypad changed to %#04lx\n", keysym));
break;
@@ -278,6 +279,37 @@
}
#endif /* OPT_WIDE_CHARS */
+/*
+ * Determine if we use the \E[3~ sequence for Delete, or the legacy ^?. We
+ * maintain the delete_is_del value as 3 states: unspecified(2), true and
+ * false. If unspecified, it is handled differently according to whether the
+ * legacy keybord support is enabled, or if xterm emulates a VT220.
+ *
+ * Once the user (or application) has specified delete_is_del via resource
+ * settting, popup menu or escape sequence, it overrides the keyboard type
+ * rather than the reverse.
+ */
+Boolean
+xtermDeleteIsDEL(void)
+{
+ TScreen *screen = &term->screen;
+ Boolean result = True;
+
+ if (term->keyboard.type == keyboardIsDefault
+ || term->keyboard.type == keyboardIsVT220)
+ result = (screen->delete_is_del == True);
+
+ if (term->keyboard.type == keyboardIsLegacy)
+ result = (screen->delete_is_del != False);
+
+ TRACE(("xtermDeleteIsDEL(%d/%d) = %d\n",
+ term->keyboard.type,
+ screen->delete_is_del,
+ result));
+
+ return result;
+}
+
void
Input (
register TKeyboard *keyboard,
@@ -472,13 +504,15 @@
#if OPT_SUNPC_KBD
/* make an DEC editing-keypad from a Sun or PC editing-keypad */
- if (term->keyboard.type == keyboardIsVT220)
+ if (term->keyboard.type == keyboardIsVT220
+ && (keysym != XK_Delete || !xtermDeleteIsDEL()))
keysym = TranslateFromSUNPC(keysym);
else
#endif
{
#ifdef XK_KP_Home
if (keysym >= XK_KP_Home && keysym <= XK_KP_Begin) {
+ TRACE(("...Input keypad before was %#04lx\n", keysym));
keysym += XK_Home - XK_KP_Home;
TRACE(("...Input keypad changed to %#04lx\n", keysym));
}
@@ -535,12 +569,7 @@
|| IsEditFunctionKey(keysym)
|| (keysym == XK_Delete
&& ((modify_parm > 1)
-#if OPT_SUNPC_KBD
- || ( !screen->delete_is_del
- && term->keyboard.type == keyboardIsDefault)
- || term->keyboard.type == keyboardIsVT220
-#endif
- ))) {
+ || !xtermDeleteIsDEL()))) {
#if OPT_SUNPC_KBD
if (term->keyboard.type == keyboardIsVT220) {
if ((event->state & ControlMask)
Index: main.c
--- xterm-130/main.c Tue Feb 29 20:50:42 2000
+++ xterm-131/main.c Thu Mar 2 21:42:30 2000
@@ -121,7 +121,11 @@
#define BSDLY 0
#define VTDLY 0
#define FFDLY 0
+#else /* MINIX */
+#ifdef DEBUG
+#include <time.h>
#endif
+#endif /* MINIX */
#ifdef att
#define ATT
@@ -175,6 +179,7 @@
#ifdef __GLIBC__
#if (__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1))
#include <pty.h>
+#include <stdlib.h> /* getpt() */
#endif
#endif
#endif
@@ -1801,10 +1806,13 @@
/* Set up stderr properly. Opening this log file cannot be
done securely by a privileged xterm process (although we try),
so the debug feature is disabled by default. */
+ char dbglogfile[45];
int i = -1;
if(debug) {
- creat_as (getuid(), getgid(), "xterm.debug.log", 0666);
- i = open ("xterm.debug.log", O_WRONLY | O_TRUNC, 0666);
+ timestamp_filename(dbglogfile, "xterm.debug.log.");
+ if(creat_as (getuid(), getgid(), False, dbglogfile, 0666)) {
+ i = open (dbglogfile, O_WRONLY | O_TRUNC, 0666);
+ }
}
if(i >= 0) {
#if defined(USE_SYSV_TERMIO) && !defined(SVR4) && !defined(linux)
@@ -1822,11 +1830,7 @@
#endif
_bufend(stderr) = old_bufend;
#else /* USE_SYSV_TERMIO */
-#ifndef linux
- stderr->_file = i;
-#else
- setfileno(stderr, i);
-#endif
+ freopen(dbglogfile, "w", stderr);
#endif /* USE_SYSV_TERMIO */
/* mark this file as close on exec */
Index: menu.c
--- xterm-130/menu.c Wed Mar 1 20:57:29 2000
+++ xterm-131/menu.c Thu Mar 2 23:33:16 2000
@@ -765,7 +765,10 @@
XtPointer closure GCC_UNUSED,
XtPointer data GCC_UNUSED)
{
- term->screen.delete_is_del = ! term->screen.delete_is_del;
+ if (xtermDeleteIsDEL())
+ term->screen.delete_is_del = False;
+ else
+ term->screen.delete_is_del = True;
update_delete_del();
}
Index: menu.h
--- xterm-130/menu.h Wed Mar 1 20:55:51 2000
+++ xterm-131/menu.h Thu Mar 2 23:33:45 2000
@@ -337,7 +337,7 @@
#define update_delete_del() \
update_menu_item (term->screen.mainMenu, \
mainMenuEntries[mainMenu_delete_del].widget, \
- term->screen.delete_is_del)
+ xtermDeleteIsDEL())
#if OPT_SUNPC_KBD
#define update_sun_kbd() \
Index: misc.c
--- xterm-130/misc.c Wed Mar 1 02:22:43 2000
+++ xterm-131/misc.c Thu Mar 2 22:39:08 2000
@@ -59,11 +59,16 @@
#include <xterm.h>
#include <X11/Xos.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <stdio.h>
#include <signal.h>
#include <ctype.h>
#include <pwd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
@@ -72,6 +77,12 @@
#include <X11/Xmu/SysUtil.h>
#include <X11/Xmu/WinUtil.h>
+#ifdef X_NOT_STDC_ENV
+extern time_t time ();
+#else
+#include <time.h>
+#endif
+
#include <data.h>
#include <error.h>
#include <menu.h>
@@ -760,24 +771,88 @@
#endif
}
-#if (defined(ALLOWLOGGING) || defined(DEBUG)) && !defined(VMS)
+#ifdef VMS
+#define TIMESTAMP_FMT "%s%d-%02d-%02d-%02d-%02d-%02d"
+#else
+#define TIMESTAMP_FMT "%s%d-%02d-%02d.%02d:%02d:%02d"
+#endif
+
+void
+timestamp_filename(char *dst, const char *src)
+{
+ time_t tstamp;
+ struct tm *tstruct;
+
+ time(&tstamp);
+ tstruct = localtime(&tstamp);
+ sprintf(dst, TIMESTAMP_FMT,
+ src,
+ tstruct->tm_year + 1900,
+ tstruct->tm_mon + 1,
+ tstruct->tm_mday,
+ tstruct->tm_hour,
+ tstruct->tm_min,
+ tstruct->tm_sec);
+}
+
+int
+open_userfile(int uid, int gid, char *path, Boolean append)
+{
+ int fd;
+ struct stat sb;
+
+#ifdef VMS
+ if((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) {
+ fprintf(stderr, "%s: cannot open %s\n", xterm_name, path);
+ return -1;
+ }
+ chown(path, uid, gid);
+#else
+ if ((access(path, F_OK) != 0 && (errno != ENOENT))
+ || (!(creat_as(uid, gid, append, path, 0644)))
+ || ((fd = open(path, O_WRONLY | O_APPEND, 0644)) < 0)) {
+ fprintf(stderr, "%s: cannot open %s\n", xterm_name, path);
+ return -1;
+ }
+#endif
+
+ /*
+ * Doublecheck that the user really owns the file that we've opened before
+ * we do any damage.
+ */
+ if (fstat(fd, &sb) < 0
+ || (int) sb.st_uid != uid
+ || (int) sb.st_gid != gid
+ || (sb.st_mode & 022) != 0) {
+ fprintf(stderr, "%s: you do not own %s\n", xterm_name, path);
+ close(fd);
+ return -1;
+ }
+ return fd;
+}
+#ifndef VMS
/*
- * create a file only if we could with the permissions of the real user id.
+ * Create a file only if we could with the permissions of the real user id.
* We could emulate this with careful use of access() and following
* symbolic links, but that is messy and has race conditions.
* Forking is messy, too, but we can't count on setreuid() or saved set-uids
* being available.
*
- * Note: when called for user logging, we have ensured that the real and
+ * Note: When called for user logging, we have ensured that the real and
* effective user ids are the same, so this remains as a convenience function
* for the debug logs.
+ *
+ * Returns 1 if we can proceed to open the file in relative safety, 0
+ * otherwise.
*/
-void
-creat_as(int uid, int gid, char *pathname, int mode)
+int
+creat_as(int uid, int gid, Boolean append, char *pathname, int mode)
{
int fd;
int pid;
+ int retval = 0;
+ int childstat;
#ifndef HAVE_WAITPID
int waited;
SIGNAL_T (*chldfunc) (int);
@@ -791,7 +866,7 @@
case 0: /* child */
setgid(gid);
setuid(uid);
- fd = open(pathname, O_WRONLY|O_CREAT|O_APPEND, mode);
+ fd = open(pathname, O_WRONLY|O_CREAT|(append ? O_APPEND : O_EXCL), mode);
if (fd >= 0) {
close(fd);
_exit(0);
@@ -799,12 +874,12 @@
_exit(1);
/* NOTREACHED */
case -1: /* error */
- return;
+ return retval;
default: /* parent */
#ifdef HAVE_WAITPID
- waitpid(pid, NULL, 0);
+ waitpid(pid, &childstat, 0);
#else /* HAVE_WAITPID */
- waited = wait(NULL);
+ waited = wait(&childstat);
signal(SIGCHLD, chldfunc);
/*
Since we had the signal handler uninstalled for a while,
@@ -816,9 +891,14 @@
Cleanup(0);
while ( (waited=nonblocking_wait()) > 0);
#endif /* HAVE_WAITPID */
+#ifndef WIFEXITED
+#define WIFEXITED(status) ((status & 0xff) != 0)
+#endif
+ if (WIFEXITED(childstat)) retval = 1;
+ return retval;
}
}
-#endif /* defined(ALLOWLOGGING) || defined(DEBUG) */
+#endif /* !VMS */
#ifdef ALLOWLOGGING
@@ -934,20 +1014,8 @@
return;
#endif
} else {
- if(access(screen->logfile, F_OK) != 0) {
- if (errno == ENOENT)
- creat_as(screen->uid, screen->gid,
- screen->logfile, 0644);
- else
- return;
- }
-
- if(access(screen->logfile, F_OK) != 0
- || access(screen->logfile, W_OK) != 0)
+ if ((screen->logfd = open_userfile(screen->uid, screen->gid, screen->logfile, (log_default != 0))) < 0)
return;
- if((screen->logfd = open(screen->logfile, O_WRONLY | O_APPEND,
- 0644)) < 0)
- return;
}
#endif /*VMS*/
screen->logstart = CURRENT_EMU_VAL(screen, Tbuffer->ptr, VTbuffer.ptr);
Index: os2main.c
--- xterm-130/os2main.c Wed Feb 9 17:47:18 2000
+++ xterm-131/os2main.c Thu Mar 2 21:11:26 2000
@@ -1062,7 +1062,7 @@
so the debug feature is disabled by default. */
int i = -1;
if(debug) {
- creat_as (getuid(), getgid(), "xterm.debug.log", 0666);
+ creat_as (getuid(), getgid(), True, "xterm.debug.log", 0666);
i = open ("xterm.debug.log", O_WRONLY | O_TRUNC, 0666);
}
if(i >= 0) {
Index: ptyx.h
--- xterm-130/ptyx.h Wed Mar 1 02:22:43 2000
+++ xterm-131/ptyx.h Wed Mar 1 20:55:51 2000
@@ -974,6 +974,7 @@
Boolean fnt_prop; /* true if proportional fonts */
Boolean fnt_boxes; /* true if font has box-chars */
+ Boolean force_box_chars; /* true if we assume that */
Dimension fnt_wide;
Dimension fnt_high;
XFontStruct *fnt_norm; /* normal font of terminal */
Index: resize.c
--- xterm-130/resize.c Fri Oct 15 06:18:02 1999
+++ xterm-131/resize.c Thu Mar 2 20:40:13 2000
@@ -277,6 +277,9 @@
#endif
#else
#include <curses.h>
+#ifdef NCURSES_VERSION
+#include <term.h> /* tgetent() */
+#endif
#endif /* HAVE_TERMCAP_H */
#endif
Index: util.c
--- xterm-130/util.c Wed Mar 1 02:22:43 2000
+++ xterm-131/util.c Thu Mar 2 23:14:38 2000
@@ -1554,7 +1554,7 @@
}
/* If the font is complete, draw it as-is */
- if (screen->fnt_boxes) {
+ if (screen->fnt_boxes && !screen->force_box_chars) {
TRACE(("drawtext%c[%4d,%4d] (%d) %d:%s\n",
screen->cursor_state == OFF ? ' ' : '*',
y, x, chrset, len,
@@ -1624,6 +1624,7 @@
? screen->fnt_bold
: screen->fnt_norm;
Cardinal last, first = 0;
+ Boolean save_force = screen->force_box_chars;
screen->fnt_boxes = True;
for (last = 0; last < len; last++) {
@@ -1634,16 +1635,20 @@
#endif
if (xtermMissingChar(ch, font)) {
if (last > first) {
+ screen->force_box_chars = False;
DrawSegment(first,last);
+ screen->force_box_chars = save_force;
}
xtermDrawBoxChar(screen, ch, flags, gc, DrawX(last), y);
first = last + 1;
}
}
if (last > first) {
+ screen->force_box_chars = False;
DrawSegment(first,last);
}
screen->fnt_boxes = False;
+ screen->force_box_chars = save_force;
#endif
}
@@ -1890,6 +1895,7 @@
void update_keyboard_type(void)
{
+ update_delete_del();
update_old_fkeys();
update_hp_fkeys();
update_sco_fkeys();
Index: version.h
--- xterm-130/version.h Wed Mar 1 02:22:43 2000
+++ xterm-131/version.h Thu Mar 2 23:07:23 2000
@@ -6,5 +6,5 @@
* XFree86 to which this version of xterm has been built. The number in
* parentheses is my patch number (T.Dickey).
*/
-#define XTERM_PATCH 129
+#define XTERM_PATCH 131
#define XFREE86_VERSION "XFree86 4.0"
Index: xterm.h
--- xterm-130/xterm.h Wed Mar 1 02:22:43 2000
+++ xterm-131/xterm.h Thu Mar 2 23:24:30 2000
@@ -502,6 +502,7 @@
#endif
/* input.c */
+extern Boolean xtermDeleteIsDEL (void);
extern void Input (TKeyboard *keyboard, TScreen *screen, XKeyEvent *event, Bool eightbit);
extern void StringInput (TScreen *screen, char *string, size_t nbytes);
@@ -539,6 +540,8 @@
extern char *strindex (char *s1, char *s2);
extern char *udk_lookup (int keycode, int *len);
extern int XStrCmp (char *s1, char *s2);
+extern int creat_as (int uid, int gid, Boolean append, char *pathname, int mode);
+extern int open_userfile (int uid, int gid, char *path, Boolean append);
extern int xerror (Display *d, XErrorEvent *ev);
extern int xioerror (Display *dpy);
extern void Bell (int which, int percent);
@@ -558,7 +561,8 @@
extern void Panic (char *s, int a);
extern void Redraw (void);
extern void ReverseOldColors (void);
-extern void creat_as (int uid, int gid, char *pathname, int mode);
+extern void SysError (int i);
+extern void VisualBell (void);
extern void do_dcs (Char *buf, size_t len);
extern void do_osc (Char *buf, int len, int final);
extern void do_xevents (void);
@@ -570,11 +574,10 @@
extern void set_tek_visibility (Boolean on);
extern void set_vt_visibility (Boolean on);
extern void switch_modes (Bool tovt);
-extern void SysError (int i);
-extern void VisualBell (void);
+extern void timestamp_filename(char *dst, const char *src);
extern void xevents (void);
-extern void xtermSetenv (char *var, char *value);
extern void xt_error (String message);
+extern void xtermSetenv (char *var, char *value);
#if OPT_MAXIMIZE
extern int QueryMaximize (TScreen *screen, unsigned *width, unsigned *height);
Index: xterm.log.html
--- xterm-130/xterm.log.html Wed Mar 1 21:34:24 2000
+++ xterm-131/xterm.log.html Fri Mar 3 05:43:33 2000
@@ -41,6 +41,7 @@
xc/programs/Xserver/hw/xfree86).
<UL>
+<LI><A HREF="#xterm_131">Patch #131 - 2000/3/3 - XFree86 3.9.18b</A>
<LI><A HREF="#xterm_130">Patch #130 - 2000/3/1 - XFree86 3.9.18a</A>
<LI><A HREF="#xterm_129">Patch #129 - 2000/2/26 - XFree86 3.9.18a</A>
<LI><A HREF="#xterm_128">Patch #128 - 2000/2/17 - XFree86 3.9.18</A>
@@ -173,6 +174,43 @@
<LI><A HREF="#xterm_02">Patch #2 - 1996/1/7</A>
<LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
</UL>
+
+<H1><A NAME="xterm_131">Patch #131 - 2000/3/3 - XFree86 3.9.18b</A></H1>
+<ul>
+ <li>integrate patch by Branden Robinson for improving logfile
+ security:
+ <ul>
+ <li>make the <code>creat_as()</code> function more strict by using
+ O_EXCL rather than O_APPEND.
+ <li>fixes to make DEBUG ifdef's compile/run, including making the
+ debug logfile more unique by appending a timestamp to its name.
+ <li>include <term.h> in resize.c, to fix a missing-prototype
+ warning.
+ </ul>
+
+ <li>modified <code>creat_as()</code> a little more, retaining the
+ ability to append to a logfile If the user specifies the name.
+ Also, check if the opened file (which patch #130 ensures is
+ owned by the effective user) is not writable by other users.
+
+ <li>use <code>creat_as()</code> logic to make tek4014 screen-copy
+ more secure (noted by Branden Robinson).
+
+ <li>ifdef'd some of Branden's changes to build/work on older machines.
+
+ <li>correct missing initialization of the <code>.mode</code> flag in
+ <code>ColorRes</code> struct, from patch #129. This worked on Linux
+ because <code>malloc()</code> zeroes memory on that platform
+ (reported by Christian Weisgerber).
+
+ <li>modify logic for <code>deleteIsDEL</code> resource so it has
+ internally 3 states: unspecified, true and false. If unspecified,
+ the keyboard type determines whether the Delete key transmits
+ <code><esc>[3~</code> or <code>\177</code>, and the popup menu
+ entry reflects the internal state. Otherwise, the popup menu entry
+ overrides the keyboard type (suggested by Dr Werner Fink, to make it
+ simpler to set resources that imitate the legacy X11R6 xterm).
+</ul>
<H1><A NAME="xterm_130">Patch #130 - 2000/3/1 - XFree86 3.9.18a</A></H1>
<ul>