--- xvt-2.1.orig/Makefile.old +++ xvt-2.1/Makefile.old @@ -0,0 +1,142 @@ +# @(#)Makefile 1.8 9/12/93 (UKC) +# +# To build xvt for one of the supported architectures: +# +# 1. Uncomment the appropriate ARCH= line below +# +# 2. Comment out the SITE=UKC line unless this is UKC +# +# 3. write out the edited Makefile and type 'make config' +# +# 4. look at the Makefile and check that the uncommented options +# seem sensible. If you want to use a different C compiler +# or different libraries or include files then edit the Makefile +# by hand. +# +# 5. Type make depend (if your system has makedepend(1) installed). +# +# 6. Type make +# +###################################################################### +# +# Supported architectures. Only one of these lines should be uncommented. +# +#ARCH=SUNOS4 +#ARCH=SUNOS5 +#ARCH=OSF1 +#ARCH=AIX3 +#ARCH=ULTRIX +#ARCH=HPUX +ARCH=LINUX +# +# +# If this line is uncommented then `Make config' will unclude several options +# that are probably only wanted at UKC. +# +#SITE=UKC +# +# +# Directories to install the binary and the manual page +# +BIN=/usr/local/X11 +MANDIR=/usr/local/man/man1 +# +###################################################################### +# +# Lines in this section are automatically commented or uncommented +# by running `make config'. Edit them by hand if the configured +# options are not appropriate. +# +# +# Enable the code that allows xvt to provide a Hex encoded Magic Cookie +# for inclusion in a .Xauthority file. +# +#MAGIC_COOKIE=-DMAGIC_COOKIE #SITE UKC +# +# +# Needed for the Magic Cookie code but not otherwise. +# +#AUTHLIB=-lXau #SITE UKC +# +# +# Enable code that can make use of the UKC locations database. This +# is almost obsolete, even at UKC, and totally useless anywhere else. +# +#UKC_LOCATIONS=-DUKC_LOCATIONS #SITE UKC +# +# +# Enable some extra debugging code +# +#DEBUG=-DDEBUG #SITE UKC +# +OPTIONS=$(MAGIC_COOKIE) $(DEBUG) #ARCH SUNOS5 OSF1 AIX3 ULTRIX LINUX +#OPTIONS=$(MAGIC_COOKIE) $(UKC_LOCATIONS) $(DEBUG) #ARCH SUNOS4 +# +# Additional architecture dependent defines +# +# add lines and columns to environment - delays startup +# +#DEFS=-DLC_ENV #ARCH HPUX +# +# Additional directories to search for include files. These may need +# modifying if you have local include directories. +# +#ANSI_INCLUDE=-I/usr/local/lib/ansi-include #SITE UKC +#INCLUDE=$(ANSI_INCLUDE) #ARCH SUNOS4 +#INCLUDE=-I/usr/openwin/include #ARCH SUNOS5 +#INCLUDE=-I/usr/include/X11R5 #ARCH HPUX +# +# +# Any architecture dependent libraries or library search paths. +# +#LIB=-lnsl $(AUTHLIB) #ARCH SUNOS5 +LIB=$(AUTHLIB) #ARCH SUNOS4 OSF1 AIX3 ULTRIX LINUX +#LDFLAGS=-i -R /usr/openwin/lib -L /usr/openwin/lib #ARCH SUNOS5 +#LDFLAGS=-L/usr/lib/X11R5 #ARCH HPUX +# +# +# The C compiler +# +#CC=gcc -g -ansi -Wall -Wmissing-prototypes #SITE UKC +#CC=cc #ARCH OSF1 AIX3 HPUX ULTRIX +# +# End of automatically configured options. +# +###################################################################### +# +OBJ=xvt.o xsetup.o command.o screen.o sbar.o ttyinit.o +SRC=xvt.c xsetup.c command.c screen.c sbar.c ttyinit.c +# +CFLAGS=-O $(INCLUDE) $(OPTIONS) $(DEFS) -D$(ARCH) +# +xvt: $(OBJ) + $(CC) $(LDFLAGS) -o xvt $(OBJ) $(LIB) -lX11 + +install: $(BIN)/xvt $(MANDIR)/xvt.1 + +$(MANDIR)/xvt.1: xvt.1 + cp xvt.1 $@ + chmod 0644 $@ + +$(BIN)/xvt: xvt + cp xvt $@.new + strip $@.new + chown root $@.new + chmod 04755 $@.new + mv $@.new $@ + +clean: + rm -f $(OBJ) xvt + +tags: $(SRC) + ctags $(SRC) + +config: + ./cmake ARCH $(ARCH) < Makefile | ./cmake SITE $(SITE) >Makefile.new + mv Makefile Makefile.old + mv Makefile.new Makefile + +depend: + makedepend -- $(CFLAGS) -- $(SRC) + +# DO NOT DELETE THIS LINE -- make depend depends on it. --- xvt-2.1.orig/debian/changelog +++ xvt-2.1/debian/changelog @@ -0,0 +1,263 @@ +xvt (2.1-20.3ubuntu2) zesty; urgency=medium + + * Use debhelper 9. + * Bump dh compat to 9. + * Add build-arch and build-indep targets. + * Use dh_prep instead of dh_clean -k. + * Update make clean to the latest stuff. + + -- Bhavani Shankar Tue, 24 Jan 2017 10:25:47 +0530 + +xvt (2.1-20.3ubuntu1) zesty; urgency=low + + * Merge from Debian unstable. Remaining changes: + - debian/rules: + Split LDFLAGS to LDFLAGS and LIB to fix linking with --as-needed. + + -- Gianfranco Costamagna Tue, 17 Jan 2017 18:18:08 +0100 + +xvt (2.1-20.3) unstable; urgency=medium + + * Non-maintainer upload. + * Apply dpkg-statoverride fix from Guillem Jover. (Closes: #770052) + + -- Adrian Bunk Fri, 13 Jan 2017 19:54:47 +0200 + +xvt (2.1-20.2ubuntu1) yakkety; urgency=medium + + * Merge from Debian. Remaining changes: + - debian/rules: + Split LDFLAGS to LDFLAGS and LIB to fix linking with --as-needed. + + -- Gianfranco Costamagna Fri, 03 Jun 2016 18:19:45 +0200 + +xvt (2.1-20.2) unstable; urgency=medium + + * Non-maintainer upload. + * Move to compatibility 5, which is the minimally available level + in the present release cycle. Closes: #817740. + * Disable menu file creation, but include a new desktop file. + + debian/rules: Updated. + + debian/xvt.desktop: New file. + + -- Mats Erik Andersson Fri, 03 Jun 2016 15:35:47 +0200 + +xvt (2.1-20.1ubuntu1) raring; urgency=low + + * Merge from Debian. Remaining changes: + - debian/rules: + Split LDFLAGS to LDFLAGS and LIB to fix linking with --as-needed. + + -- Oussama Bounaim Thu, 29 Nov 2012 07:33:05 +0100 + +xvt (2.1-20.1) unstable; urgency=low + + * Non-maintainer upload. + * Baudrate setting and controlling terminal in kfreebsd-*. + + debian/patches/065_bsd_ctty_baudrate_605679.diff: New file. + + Closes: #605679. + * Incomplete UTMP and WTMP handling. + + debian/patches/070_full_utmp_wtmp_650396.diff: New file. + + Closes: #650396. + + -- Mats Erik Andersson Wed, 07 Dec 2011 02:28:08 +0100 + +xvt (2.1-20ubuntu1) natty; urgency=low + + * debian/rules: + Split LDFLAGS to LDFLAGS and LIB to fix linking with --as-needed. + + -- Michael Bienia Sun, 05 Dec 2010 18:24:05 +0100 + +xvt (2.1-20) unstable; urgency=low + + * Moved package maintenance to Alioth. + * debian/control: + + Set policy to 3.7.2. + + Build-depend on quilt instead of dpatch. + + Added XS-Vcs-Svn header. + + -- Sam Hocevar (Debian packages) Sat, 7 Oct 2006 12:35:49 +0200 + +xvt (2.1-19) unstable; urgency=low + + * debian/control: + + Set policy to 3.6.2.1. + * debian/rules debian/postinst: + + Set sgid bit in the postinst instead of shipping a sgid binary. + * xvt.1: + + Fixed typos in manpage (Closes: #306712). + + -- Sam Hocevar (Debian packages) Tue, 1 Nov 2005 23:15:29 +0100 + +xvt (2.1-18) unstable; urgency=low + + * debian/rules: + + Switched build system to debhelper/dpatch. We no longer use yada and + its non-POSIX -E flag to echo calls (Closes: #240729). + * debian/control: + + Set policy to 3.6.1.1. + + -- Sam Hocevar (Debian packages) Sun, 11 Jul 2004 19:16:40 +0200 + +xvt (2.1-17) unstable; urgency=low + + * debian/rules: + + Do not rebuild the rules file. + + -- Sam Hocevar (Debian packages) Tue, 6 Jul 2004 17:03:28 +0200 + +xvt (2.1-16) unstable; urgency=low + + * New maintainer (Closes: #201412). + * debian/package: + + Fixed this file instead of debian/control. + + Build-depend on libx11-dev instead of xlibs-dev. + * debian/keyboard-policy.dpatch: + + Fixed the patch syntax. + + -- Sam Hocevar (Debian packages) Tue, 6 Jul 2004 14:12:58 +0200 + +xvt (2.1-15) unstable; urgency=low + + * QA upload. + * Add Build-Depends on xlibs-dev. Closes: #190629. + * Set maintainer to the QA group, since this package has been orphaned. + (See bug #201412.) + + -- Daniel Schepler Tue, 19 Aug 2003 02:55:56 -0700 + +xvt (2.1-14) unstable; urgency=low + + * Transition xvt out of /usr/X11R6/. + * x-terminal-emulator.1.gz's alternative is now accessed from + /usr/share/man/man1, not /usr/man/man1. Update accordingly. + * Fix alternatives to point to real locations. Closes:Bug#102762. + * Rebuilt against new X development packages. Closes:Bug#121958. + + -- Charles Briscoe-Smith Thu, 7 Mar 2002 23:42:02 +0000 + +xvt (2.1-13) stable unstable; urgency=HIGH + + * Fix a yada bug which prevented the package building in some + situations. Closes:Bug#102744. + + -- Charles Briscoe-Smith Fri, 29 Jun 2001 11:15:16 +0100 + +xvt (2.1-12) unstable; urgency=HIGH + + * Fix a couple of buffer overflows which could result in a local + root compromise. Thanks to Christophe Bailleux + for finding them. + + -- Charles Briscoe-Smith Thu, 28 Jun 2001 02:01:56 +0100 + +xvt (2.1-11) frozen unstable; urgency=medium + + * Change terminal type to "xterm-r6". This should make terminfo-using + programs work in xvt, but the delete and backspace keys won't be + mapped quite properly (this'll have to wait for a "xterm-r6-debian" + terminfo). (Downgrades bug 59045 from important to normal.) + + -- Charles Briscoe-Smith Sun, 26 Mar 2000 17:32:31 +0100 + +xvt (2.1-10) unstable; urgency=low + + * Provide "x-terminal-emulator". Install xvt as alternative. + (Closes: bug#45959.) + * Update to standards-version 3.0.1; use new yada. + * Hack command.c to return Keyboard Policy-compliant strings for + XK_Delete and XK_BackSpace. + + -- Charles Briscoe-Smith Tue, 7 Dec 1999 22:46:02 +0000 + +xvt (2.1-9) unstable; urgency=low + + * Upgraded to yada packaging. + * Updated standards-version to 2.5.0; no changes needed. + * Added a new openpty()-based PTY-opening method to ttyinit.c, and + arrange for it to be used when LINUX is defined. xvt can now make + use of Unix98-style ptys where these are available. + + -- Charles Briscoe-Smith Fri, 9 Jul 1999 22:46:45 +0100 + +xvt (2.1-8) unstable; urgency=low + + * Reverted xvt's default terminal type from "xterm-old" to "xterm", + as Debian's "xterm" entry is now the same as the original X11R6.3 + xterm entry. + * Don't recommend ncurses-term any more. + * Updated Standards-version to 2.4.1 (no changes required). + * Updated debian/rules. + + -- Charles Briscoe-Smith Tue, 6 Oct 1998 02:14:17 +0100 + +xvt (2.1-7) unstable; urgency=low + + * Remove dpkg-geninfo from debian directory and remove call to it + from debian/rules following debian-policy discussion on `md5sums' + and `du' files. + * Install man page under /usr/X11R6 (as pointed out by lintian). + + -- Charles Briscoe-Smith Fri, 20 Feb 1998 02:52:05 +0000 + +xvt (2.1-6) unstable; urgency=low + + * Added a -rv option, making it work as the man page describes, which + fixes: bug#17492. Also, fixed a couple of spellos in the man page. + * Made /bin/sh the default shell to run if SHELL is not specified. + All Debian systems should posess a /bin/sh, but many don't have a + /bin/csh. + + * .../bin/xvt no longer suid in the .deb filesystem archive. This + means that, on systems with suidmanager where the sysadmin made xvt + non-suid, there will no longer be a window between unpacking and + configuration where the file -is- suid. Instead, there will be a + window on other systems where it -isn't-. Far better. + + * xvt now recommends ncurses-term, because it uses the xterm-old + terminal type. + * New version of my generic debian/rules. Include dpkg-geninfo. + + * Updated to standards-version 2.4.0.0. No changes necessary. + * Update maintainer email address. + + -- Charles Briscoe-Smith Mon, 26 Jan 1998 21:42:04 +0000 + +xvt (2.1-5) unstable; urgency=low + + * Changed the default terminal type in xvt.h to "xterm-old", so that + it works with newer terminfos. + + -- Charles Briscoe-Smith Mon, 17 Nov 1997 22:36:31 +0000 + +xvt (2.1-4) unstable; urgency=low + + * Include so that xvt can set the width and height of + the pty. + + -- Charles Briscoe-Smith Tue, 11 Nov 1997 21:12:51 +0000 + +xvt (2.1-3) unstable; urgency=low + + * Updated for libc6. (Actually, nothing in the source changed, but + utmp updating magically works with libc6.) + * Register xvt with suidmanager. + + -- Charles Briscoe-Smith Tue, 11 Nov 1997 01:17:16 +0000 + +xvt (2.1-2) unstable; urgency=low + + * Fix bug 13673: previously, xvt tried to allocate read/write colormap + cells for a coloured cursor if a cursor colour was specified and + the display was not of depth 1. Now we check that a cursor colour + was specified and the default visual is not StaticGray, StaticColor + or TrueColor. + + -- Charles Briscoe-Smith Tue, 28 Oct 1997 02:02:54 +0000 + +xvt (2.1-1) unstable; urgency=low + + * First Debian release. + + -- Charles Briscoe-Smith Sat, 20 Sep 1997 00:25:21 +0100 --- xvt-2.1.orig/debian/compat +++ xvt-2.1/debian/compat @@ -0,0 +1 @@ +9 --- xvt-2.1.orig/debian/control +++ xvt-2.1/debian/control @@ -0,0 +1,48 @@ +Source: xvt +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Sam Hocevar (Debian packages) +Section: x11 +Priority: optional +Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9), quilt, libx11-dev +XS-Vcs-Svn: svn://svn.debian.org/svn/sam-hocevar/pkg-misc/unstable/xvt/ + +Package: xvt +Architecture: any +Section: x11 +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: menu +Provides: x-terminal-emulator +Conflicts: suidmanager (<< 0.50) +Description: X terminal-emulator similar to xterm, but smaller + xvt is an X terminal-emulator that is designed to be more or less + compatible with xterm while using much less swap space. It is mainly + intended for use at sites which use large numbers of X terminals but + may also be useful on single workstations that are short of memory. + The main way that xvt achieves its small size is by avoiding the use + of the X toolkit. + . + If you are looking for a more featureful terminal-emulator than xvt, + but one which still uses less swap space than xterm, consider rxvt. + . + Features of xterm which xvt does not support include: + . + - Tektronix 4014 emulation + - Session logging + - Pop-up menus. The only one of xterm's popup menu commands that + is provided in xvt is displaying and hiding of the scrollbar + and this is done simply by pressing any mouse key in the window + with the CONTROL key held down. + - Toolkit style configurability. In particular, xvt does not + allow the user to remap the mouse or keyboard keys. + . + Features which are supported include: + . + - VT100 emulation. Most of the main escape sequences are supported -- + certainly all those used by the standard screen based UNIX + applications. + - Lines that scroll off the top of the window are saved and can be + scrolled back with a scrollbar. + - Text selection and insertion including double and triple click for + words and lines. --- xvt-2.1.orig/debian/copyright +++ xvt-2.1/debian/copyright @@ -0,0 +1,34 @@ +This is the Debian prepackaged version of xvt. It was Debianised by +Sam Hocevar (Debian packages) , using files obtained +from . + +No major changes were made. + +Copyright and licence notice: + + xvt 2.1 + Copyright 1992-94, 1997 John Bovey, University of Kent at Canterbury. + + Redistribution and use in source code and/or executable forms, with + or without modification, are permitted provided that the following + condition is met: + + Any redistribution must retain the above copyright notice, this + condition and the following disclaimer, either as part of the + program source code included in the redistribution or in human- + readable materials provided with the redistribution. + + THIS SOFTWARE IS PROVIDED "AS IS". Any express or implied + warranties concerning this software are disclaimed by the copyright + holder to the fullest extent permitted by applicable law. In no + event shall the copyright-holder be liable for any damages of any + kind, however caused and on any theory of liability, arising in any + way out of the use of, or inability to use, this software. + + ------------------------------------------------------------------- + + In other words, do not misrepresent my work as your own work, and + do not sue me if it causes problems. Feel free to do anything else + you wish with it. + +. --- xvt-2.1.orig/debian/menu +++ xvt-2.1/debian/menu @@ -0,0 +1,2 @@ +?package(xvt):needs="x11" section="XShells" title="Xvt" \ + command="/usr/bin/xvt -ls" --- xvt-2.1.orig/debian/patches/010_buffer_overflows.diff +++ xvt-2.1/debian/patches/010_buffer_overflows.diff @@ -0,0 +1,50 @@ +diff -urNad /home/sam/debian/official/xvt/xvt-2.1/xsetup.c xvt-2.1/xsetup.c +--- /home/sam/debian/official/xvt/xvt-2.1/xsetup.c 1997-09-17 18:23:17.000000000 +0200 ++++ xvt-2.1/xsetup.c 2004-07-27 17:54:18.000000000 +0200 +@@ -303,7 +303,7 @@ + com_env[j++] = environ[i]; + } + com_env[j++] = scopy(TERM_ENV); +- sprintf(buf,"DISPLAY=%s",DisplayString(display)); ++ sprintf(buf,"DISPLAY=%.400s",DisplayString(display)); + com_env[j++] = scopy(buf); + sprintf(buf,"WINDOWID=%d",(int)main_win); + com_env[j++] = scopy(buf); +@@ -391,8 +391,8 @@ + + /* See if there was a display named in the command line + */ +- sprintf(str1,"%s.display",res_name); +- sprintf(str2,"%s.Display",XVT_CLASS); ++ sprintf(str1,"%.100s.display",res_name); ++ sprintf(str2,"%.100s.Display",XVT_CLASS); + if (XrmGetResource(commandlineDB,str1,str2,&str_type,&value) == True) { + strncpy(str1,value.addr,(int)value.size); + display_name = str1; +@@ -529,18 +529,22 @@ + XrmValue value; + char *str_type; + +- sprintf((char *)str1,"%s.%s",res_name,name); +- sprintf((char *)str2,"%s.%s",XVT_CLASS,class); ++ sprintf((char *)str1,"%.100s.%.100s",res_name,name); ++ sprintf((char *)str2,"%.100s.%.100s",XVT_CLASS,class); + if (XrmGetResource(rDB,str1,str2,&str_type,&value) == True) { ++ if (value.size > 255) ++ value.size = 255; + strncpy((char *)resource,value.addr,(int)value.size); + return(resource); + } + + /* The following is added for compatibility with xterm. + */ +- sprintf((char *)str1,"%s.vt100.%s",res_name,name); +- sprintf((char *)str2,"%s.VT100.%s",XVT_CLASS,class); ++ sprintf((char *)str1,"%.100s.vt100.%.100s",res_name,name); ++ sprintf((char *)str2,"%.100s.VT100.%.100s",XVT_CLASS,class); + if (XrmGetResource(rDB,str1,str2,&str_type,&value) == True) { ++ if (value.size > 255) ++ value.size = 255; + strncpy((char *)resource,value.addr,(int)value.size); + return(resource); + } --- xvt-2.1.orig/debian/patches/015_keyboard_policy.diff +++ xvt-2.1/debian/patches/015_keyboard_policy.diff @@ -0,0 +1,42 @@ +diff -urNad /home/sam/debian/official/xvt/xvt-2.1/command.c xvt-2.1/command.c +--- /home/sam/debian/official/xvt/xvt-2.1/command.c 1997-09-17 18:20:34.000000000 +0200 ++++ xvt-2.1/command.c 2004-07-27 17:54:50.000000000 +0200 +@@ -146,6 +146,8 @@ + #define KS_TYPE_SUN (char)3 /* as printf("\033[%dz",ks_value) */ + #define KS_TYPE_APPKEY (char)4 /* as printf("\033O%c",ks_value) */ + #define KS_TYPE_NONAPP (char)5 /* as printf("\033[%c",ks_value) */ ++/* Added by cpbs for Debian, 1999/12/7: this is only used for the Delete key */ ++#define KS_TYPE_VT220 (char)6 /* as printf("\033[%d~",ks_value) */ + + /* Structure used to map a keysym to a string. + */ +@@ -195,7 +197,8 @@ + {XK_F35, {KS_TYPE_NONE,0}, {KS_TYPE_SUN,222}}, + {XK_Find, {KS_TYPE_XTERM,1}, {KS_TYPE_SUN,1}}, + {XK_Insert, {KS_TYPE_XTERM,2}, {KS_TYPE_SUN,2}}, +- {XK_Delete, {KS_TYPE_XTERM,3}, {KS_TYPE_SUN,3}}, ++ {XK_Delete, {KS_TYPE_VT220,3}, {KS_TYPE_SUN,3}}, ++ {XK_BackSpace, {KS_TYPE_CHAR,127}, {KS_TYPE_SUN,3}}, + {XK_Select, {KS_TYPE_XTERM,4}, {KS_TYPE_SUN,4}}, + {XK_Prior, {KS_TYPE_XTERM,5}, {KS_TYPE_SUN,5}}, + {XK_Next, {KS_TYPE_XTERM,6}, {KS_TYPE_SUN,6}}, +@@ -382,6 +385,9 @@ + case KS_TYPE_NONAPP: + sprintf((char *)buf,"\033[%c",ks->ks_value); + return buf; ++ case KS_TYPE_VT220: ++ sprintf((char *)buf,"\033[%d~",ks->ks_value); ++ return buf; + } + } + } +@@ -405,7 +411,8 @@ + s = NULL; + + if (IsFunctionKey(keysym) || IsMiscFunctionKey(keysym) +- || keysym == XK_Next || keysym == XK_Prior) ++ || keysym == XK_Next || keysym == XK_Prior ++ || keysym == XK_Delete || keysym == XK_BackSpace) + s = get_keycode_value(func_key_table,keysym,kbuf,sun_function_keys); + else if (IsCursorKey(keysym) || IsPFKey(keysym)) + s = get_keycode_value(other_key_table,keysym,kbuf,app_cur_keys); --- xvt-2.1.orig/debian/patches/020_linux.diff +++ xvt-2.1/debian/patches/020_linux.diff @@ -0,0 +1,23 @@ +diff -urNad /home/sam/debian/official/xvt/xvt-2.1/ttyinit.c xvt-2.1/ttyinit.c +--- /home/sam/debian/official/xvt/xvt-2.1/ttyinit.c 1997-09-18 16:14:18.000000000 +0200 ++++ xvt-2.1/ttyinit.c 2004-07-27 17:55:30.000000000 +0200 +@@ -154,6 +154,7 @@ + #endif /* HPUX */ + + #ifdef LINUX ++#include + #define BSD_PTY + #define SVR4_UTMP + #endif +diff -urNad /home/sam/debian/official/xvt/xvt-2.1/xvt.h xvt-2.1/xvt.h +--- /home/sam/debian/official/xvt/xvt-2.1/xvt.h 1997-09-18 16:39:54.000000000 +0200 ++++ xvt-2.1/xvt.h 2004-07-27 17:55:30.000000000 +0200 +@@ -35,7 +35,7 @@ + #define FIXED_FONT "fixed" /* last resort font */ + #define DEF_SAVED_LINES 64 /* number of saved lines that have scrolled of the top */ + #define TERM_ENV "TERM=xterm" +-#define COMMAND "/bin/csh" /* default command to run */ ++#define COMMAND "/bin/sh" /* default command to run */ + + /* arguments to set and reset functions. + */ --- xvt-2.1.orig/debian/patches/025_main.diff +++ xvt-2.1/debian/patches/025_main.diff @@ -0,0 +1,30 @@ +diff -urNad /home/sam/debian/official/xvt/xvt-2.1/xvt.c xvt-2.1/xvt.c +--- /home/sam/debian/official/xvt/xvt-2.1/xvt.c 1997-09-17 18:23:36.000000000 +0200 ++++ xvt-2.1/xvt.c 2004-07-27 17:55:53.000000000 +0200 +@@ -41,9 +41,9 @@ + #endif /* UKC_LOCATIONS */ + + #ifdef __STDC__ +-void main(int,char **); ++int main(int,char **); + #else +-void main(); ++int main(); + #endif + + extern int debugging; +@@ -67,7 +67,7 @@ + * master end of the pseudo-teletype pair with the command talking to + * the slave. + */ +-void ++int + main(argc,argv) + int argc; + char **argv; +@@ -473,4 +473,5 @@ + show_token(&token); + #endif /* DEBUG */ + } ++ return 0; + } --- xvt-2.1.orig/debian/patches/030_make.diff +++ xvt-2.1/debian/patches/030_make.diff @@ -0,0 +1,39 @@ +diff -urNad /home/sam/debian/official/xvt/xvt-2.1/Makefile xvt-2.1/Makefile +--- /home/sam/debian/official/xvt/xvt-2.1/Makefile 1997-09-18 15:18:09.000000000 +0200 ++++ xvt-2.1/Makefile 2004-07-27 17:56:19.000000000 +0200 +@@ -21,13 +21,13 @@ + # + # Supported architectures. Only one of these lines should be uncommented. + # +-ARCH=SUNOS4 ++#ARCH=SUNOS4 + #ARCH=SUNOS5 + #ARCH=OSF1 + #ARCH=AIX3 + #ARCH=ULTRIX + #ARCH=HPUX +-#ARCH=LINUX ++ARCH=LINUX + # + # + # If this line is uncommented then `Make config' will unclude several options +@@ -69,8 +69,8 @@ + # + #DEBUG=-DDEBUG #SITE UKC + # +-#OPTIONS=$(MAGIC_COOKIE) $(DEBUG) #ARCH SUNOS5 OSF1 AIX3 ULTRIX LINUX +-OPTIONS=$(MAGIC_COOKIE) $(UKC_LOCATIONS) $(DEBUG) #ARCH SUNOS4 ++OPTIONS=$(MAGIC_COOKIE) $(DEBUG) #ARCH SUNOS5 OSF1 AIX3 ULTRIX LINUX ++#OPTIONS=$(MAGIC_COOKIE) $(UKC_LOCATIONS) $(DEBUG) #ARCH SUNOS4 + # + # Additional architecture dependent defines + # +@@ -82,7 +82,7 @@ + # modifying if you have local include directories. + # + #ANSI_INCLUDE=-I/usr/local/lib/ansi-include #SITE UKC +-INCLUDE=$(ANSI_INCLUDE) #ARCH SUNOS4 ++#INCLUDE=$(ANSI_INCLUDE) #ARCH SUNOS4 + #INCLUDE=-I/usr/openwin/include #ARCH SUNOS5 + #INCLUDE=-I/usr/include/X11R5 #ARCH HPUX + # --- xvt-2.1.orig/debian/patches/035_man.diff +++ xvt-2.1/debian/patches/035_man.diff @@ -0,0 +1,23 @@ +diff -urNad /home/sam/debian/official/xvt/xvt-2.1/xvt.1 xvt-2.1/xvt.1 +--- /home/sam/debian/official/xvt/xvt-2.1/xvt.1 1993-11-16 17:04:58.000000000 +0100 ++++ xvt-2.1/xvt.1 2004-07-27 17:56:44.000000000 +0200 +@@ -24,7 +24,7 @@ + window. If this option is used, it must be the last on the command + line. If there is no \fB-e\fP option then the default is to run the + program specified by the SHELL environment variable or, failing that, +-\fIcsh\fP(1). This option also causes the window title and icon name ++\fIsh\fP(1). This option also causes the window title and icon name + to be set to the name of the program being executed if the are not + overwritten by a more specific option. + .IP "\fB-display\fP \fIdisplay-name\fP" +@@ -118,8 +118,8 @@ + compatible function codes. + .IP \fB-rv\fP + Run in reverse video \- that is, exchange the foreground and background +-colors. This option has no effect if either the foreground ar background +-color is set explicitely. ++colors. This option has no effect if either the foreground or background ++color is set explicitly. + .IP \fB-C\fP + Connect this terminal to the system console. This option is only implemented + for SunOS 4 and for a user who has read and write access to /dev/console. --- xvt-2.1.orig/debian/patches/040_openpty.diff +++ xvt-2.1/debian/patches/040_openpty.diff @@ -0,0 +1,42 @@ +diff -urNad /home/sam/debian/official/xvt/xvt-2.1/ttyinit.c xvt-2.1/ttyinit.c +--- /home/sam/debian/official/xvt/xvt-2.1/ttyinit.c 2004-07-27 17:57:07.000000000 +0200 ++++ xvt-2.1/ttyinit.c 2004-07-27 17:57:11.000000000 +0200 +@@ -74,7 +74,9 @@ + * and then use a sequence of system calls to request and initialise the + * pty pair. Either of the two approaches are selected by defining one of + * BSD_PTY and SVR4_PTY, but the only system I have found which supports +- * SVR4_PTY is SunOS 5. ++ * SVR4_PTY is SunOS 5. Some systems have a function called openpty() ++ * which "does the right thing" for that system. Defining LIBC_OPENPTY ++ * selects this approach. This is the case for glibc2-based systems. + * + * Creation of a controlling teletype + * ---------------------------------- +@@ -155,7 +157,7 @@ + + #ifdef LINUX + #include +-#define BSD_PTY ++#define LIBC_OPENPTY + #define SVR4_UTMP + #endif + +@@ -467,6 +469,18 @@ + ioctl(sfd,I_PUSH,"ldterm"); + #endif /* SVR4_PTY */ + ++#ifdef LIBC_OPENPTY ++ char *ttynam; ++ int mfd, sfd; ++ ++ if (openpty(&mfd, &sfd, NULL, NULL, NULL)) { ++ error("Cannot allocate a pseudo teletype"); ++ perror(""); ++ return(NULL); ++ } ++ ttynam = ttyname(sfd); ++#endif /* LIBC_OPENPTY */ ++ + *pslave = sfd; + *pmaster = mfd; + return(ttynam); --- xvt-2.1.orig/debian/patches/045_reverse_video.diff +++ xvt-2.1/debian/patches/045_reverse_video.diff @@ -0,0 +1,87 @@ +diff -urNad /home/sam/debian/official/xvt/xvt-2.1/xsetup.c xvt-2.1/xsetup.c +--- /home/sam/debian/official/xvt/xvt-2.1/xsetup.c 2004-07-27 17:57:34.000000000 +0200 ++++ xvt-2.1/xsetup.c 2004-07-27 17:57:39.000000000 +0200 +@@ -110,6 +110,7 @@ + unsigned long foreground; /* foreground pixel value */ + unsigned long background; /* background pixel value */ + int reverse_wrap = 0; /* enable reverse wrapround */ ++int reverse_video = 0; /* select reverse video */ + int debugging = 0; /* enable debugging output */ + int messages = 0; /* flag to enable messages */ + +@@ -157,6 +158,7 @@ + {"-cr", "*cursorColor", XrmoptionSepArg, (caddr_t)NULL}, + {"-sb", "*scrollBar", XrmoptionNoArg, "on"}, + {"-rw", "*reverseWrap", XrmoptionNoArg, "on"}, ++ {"-rv", "*reverseVideo",XrmoptionNoArg, "on"}, + {"-msg", "*messages", XrmoptionNoArg, "on"}, + {"-iconic", "*iconic", XrmoptionNoArg, "on"}, + {"-8", "*eightBitInput",XrmoptionNoArg, "on"}, +@@ -188,6 +190,7 @@ + "-cr text cursor colour", + "-sb provide an initial scrollbar", + "-rw enable reverse wrap", ++"-rv run in reverse video", + "-msg allow messages", + "-iconic start up already iconized", + "-8 process eight-bit characters", +@@ -426,21 +429,28 @@ + + /* Get colormap entries and create the graphics contexts. + */ +- if (cursorclr == 0 || DefaultDepth(display,screen) == 1) { ++ if (foreground == 0) ++ XParseColor(display,colormap,"black",&foreground_color); ++ if (background == 0) ++ XParseColor(display,colormap,"white",&background_color); ++ if (reverse_video == 1 && foreground == 0 && background == 0) { ++ XColor temp_color; ++ temp_color = background_color; ++ background_color = foreground_color; ++ foreground_color = temp_color; ++ } ++ if (cursorclr == 0 || visual->class == StaticGray ++ || visual->class == StaticColor || visual->class == TrueColor) { + + /* We are not using a colored text cursor so we can use + * read only shared colormap entries for foreground and background. + */ +- if (foreground == 0) +- XParseColor(display,colormap,"black",&foreground_color); + if (XAllocColor(display,colormap,&foreground_color) != 0) + foreground = foreground_color.pixel; + else { + error("can't allocate foreground color %s - using black",s); + foreground = BlackPixel(display,screen); + } +- if (background == 0) +- XParseColor(display,colormap,"white",&background_color); + if (XAllocColor(display,colormap,&background_color) != 0) + background = background_color.pixel; + else { +@@ -469,13 +479,9 @@ + background = background_color.pixel; + cursorclr = foreground; + } else { +- if (foreground == 0) +- XParseColor(display,colormap,"black",&foreground_color); + foreground_color.pixel = foreground = pixels[0]; + foreground_color.flags = DoRed | DoBlue | DoGreen; + XStoreColor(display,colormap,&foreground_color); +- if (background == 0) +- XParseColor(display,colormap,"white",&background_color); + background_color.pixel = background = pixels[0] | plane_masks[0]; + background_color.flags = DoRed | DoBlue | DoGreen; + XStoreColor(display,colormap,&background_color); +@@ -714,6 +720,11 @@ + if ((s = get_resource("reverseWrap","ReverseWrap")) != NULL) + reverse_wrap = affirmative(s); + ++ /* Get the reverse video flag. ++ */ ++ if ((s = get_resource("reverseVideo","ReverseVideo")) != NULL) ++ reverse_video = affirmative(s); ++ + /* Get the eight bit flag. + */ + if ((s = get_resource("eightBitInput","EightBitInput")) != NULL) --- xvt-2.1.orig/debian/patches/050_termtype.diff +++ xvt-2.1/debian/patches/050_termtype.diff @@ -0,0 +1,12 @@ +diff -urNad /home/sam/debian/official/xvt/xvt-2.1/xvt.h xvt-2.1/xvt.h +--- /home/sam/debian/official/xvt/xvt-2.1/xvt.h 2004-07-27 17:58:01.000000000 +0200 ++++ xvt-2.1/xvt.h 2004-07-27 17:58:29.000000000 +0200 +@@ -34,7 +34,7 @@ + #define DEF_FONT "8x13" + #define FIXED_FONT "fixed" /* last resort font */ + #define DEF_SAVED_LINES 64 /* number of saved lines that have scrolled of the top */ +-#define TERM_ENV "TERM=xterm" ++#define TERM_ENV "TERM=xterm-r6" + #define COMMAND "/bin/sh" /* default command to run */ + + /* arguments to set and reset functions. --- xvt-2.1.orig/debian/patches/060_manpage.diff +++ xvt-2.1/debian/patches/060_manpage.diff @@ -0,0 +1,29 @@ +--- xvt-2.1.orig/xvt.1 ++++ xvt-2.1/xvt.1 +@@ -63,7 +63,7 @@ + .IP "\fB-name\fP \fIname\fP" + Set the name that is used when looking up X resource values for this + instance of \fIxvt\fP. This option also sets the icon name and window +-title unless they are set explicitely. ++title unless they are set explicitly. + .IP "\fB-title\fP \fItext\fP + Set the string that is displayed in the window's title bar if it has one. + .IP "\fB-T\fP \fItext\fP +@@ -71,7 +71,7 @@ + .IP "\fB-n\fP \fItext\fP + Set the name that will be used to label the window's icon or displayed in + an icon manager window. This option also sets the window's title unless +-it is set expicitely. ++it is set explicitly. + .IP "\fB-sl\fP \fInumber\fP + Set an upper bound for the number of lines that will be saved when they + have scrolled off the top of the window. +@@ -107,7 +107,7 @@ + Treat characters as having seven bits. In this mode, each character + is stripped to seven bits before it is displayed and pressing a keybaord + key with the \fIMeta\fP key held down causes the normal character to be +-preceeded by the Escape character. ++preceded by the Escape character. + .IP \fB-ls\fP + Run a login shell. This option causes \fIxvt\fP to execute its shell + with a name beginning with `-'. In the case of \fIcsh\fP(1) this results --- xvt-2.1.orig/debian/patches/065_bsd_ctty_baudrate_605679.diff +++ xvt-2.1/debian/patches/065_bsd_ctty_baudrate_605679.diff @@ -0,0 +1,43 @@ +Description: Portability to BSD systems. + On BSD system the correct manner of acquiring + a controlling terminal is via the TIOCGCTTY + ioctl-call. This is easily achieved in the + code by activation of the macro SCTTY_IOCTL. + . + The setting of terminal baudrate using 'c_flag' + is a Linux specific habit. The portable method + is via cfsetispeed(3) and cfsetospeed(3). +Author: Mats Erik Andersson +Bud-Debian: http://bugs.debian.org/605679 +Forwarded: no +Last-Update: 2011-12-07 + +diff -Naurp xvt-2.1.debian/ttyinit.c xvt-2.1/ttyinit.c +--- xvt-2.1.debian/ttyinit.c ++++ xvt-2.1/ttyinit.c +@@ -159,6 +159,10 @@ char xvt_ttyinit_c_sccsid[] = "@(#)ttyin + #include + #define LIBC_OPENPTY + #define SVR4_UTMP ++# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \ ++ || defined(__OpenBSD__) ++# define SCTTY_IOCTL ++# endif + #endif + + #ifdef UKC_LOCATIONS +@@ -507,11 +511,13 @@ set_ttymodes() + if (!is_eightbit()) + term.c_iflag |= ISTRIP; + term.c_oflag = OPOST | ONLCR; +- term.c_cflag = B9600 | CREAD; ++ term.c_cflag = CREAD; + if (!is_eightbit()) + term.c_cflag |= PARENB | CS7; + else + term.c_cflag |= CS8; ++ cfsetispeed(&term, B9600); ++ cfsetospeed(&term, B9600); + term.c_lflag = ISIG | IEXTEN | ICANON | ECHO | ECHOE | ECHOK; + #ifdef ECHOCTL + term.c_lflag |= ECHOCTL; --- xvt-2.1.orig/debian/patches/070_full_utmp_wtmp_650396.diff +++ xvt-2.1/debian/patches/070_full_utmp_wtmp_650396.diff @@ -0,0 +1,58 @@ +Description: Outdate UTMP coding. + This package uses a severely outdated code, + as regards how Glibc handles updating and + what content to include in UTMP structures. + . + Although 'struct utmp' has been abondoned + in favour of 'struct utmpx' in present Glibc, + only minor changes are needed to get correct + and valid reports from who(1). + . + This defect is equally valid for GNU/Linux, + as for GNU/kFreeBSD, and can be identically + mended. Inserting an entry for 'ut_pid' and + the setup using setutent(3) suffice for UTMP. + . + Since the code completely ignores the WTMP + logging, the insertion of updwtmp(3) and + logwtmp(3) are necessary and sufficient + for this to happen, thereby entrusting + Glibc to do the right thing instead of + manual actions! +Author: Mats Erik Andersson +Bug-Debian: http://bugs.debian.org/650396 +Forwarded: no +Last-Update: 2011-12-07 + +diff -Naurp xvt-2.1.debian/ttyinit.c xvt-2.1/ttyinit.c +--- xvt-2.1.debian/ttyinit.c ++++ xvt-2.1/ttyinit.c +@@ -239,10 +239,12 @@ write_utmp() + struct passwd *pw; + + #ifdef SVR4_UTMP ++ setutent(); + memset(&utent,0,sizeof(utent)); + utent.ut_type = USER_PROCESS; + strncpy(utent.ut_id,tty_name + 8,sizeof(utent.ut_id)); + strncpy(utent.ut_line,tty_name + 5,sizeof(utent.ut_line)); ++ utent.ut_pid = comm_pid; + pw = getpwuid(getuid()); + if (pw != NULL) + strncpy(utent.ut_name,pw->pw_name,sizeof(utent.ut_name)); +@@ -250,6 +252,7 @@ write_utmp() + time(&utent.ut_time); + pututline(&utent); + endutent(); ++ updwtmp(WTMP_FILE, &utent); + #endif /* SVR4_UTMP */ + + #ifdef SVR4_UTMPX +@@ -342,6 +345,7 @@ tidy_utmp() + utent.ut_type = DEAD_PROCESS; + time(&utent.ut_time); + pututline(&utent); ++ logwtmp(utent.ut_line, "", ""); + #endif /* SVR4_UTMP || SVR4_UTMPX */ + #ifdef SVR4_UTMPX + updwtmp(WTMP_FILE,&utent); --- xvt-2.1.orig/debian/patches/series +++ xvt-2.1/debian/patches/series @@ -0,0 +1,12 @@ +010_buffer_overflows.diff -p1 +015_keyboard_policy.diff -p1 +020_linux.diff -p1 +025_main.diff -p1 +030_make.diff -p1 +035_man.diff -p1 +040_openpty.diff -p1 +045_reverse_video.diff -p1 +050_termtype.diff -p1 +060_manpage.diff -p1 +065_bsd_ctty_baudrate_605679.diff +070_full_utmp_wtmp_650396.diff --- xvt-2.1.orig/debian/postinst +++ xvt-2.1/debian/postinst @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +#DEBHELPER# + +action="$1" +oldversion="$2" + +update-alternatives --install /usr/bin/x-terminal-emulator \ + x-terminal-emulator /usr/bin/xvt 10 \ + --slave /usr/share/man/man1/x-terminal-emulator.1.gz \ + x-terminal-emulator.1.gz \ + /usr/share/man/man1/xvt.1.gz + +setgid() { + if ! dpkg-statoverride --list "$1" >/dev/null ; then + chown root:utmp "$1" + chmod 2755 "$1" + fi +} + +if [ "$action" = "configure" ]; then + setgid /usr/bin/xvt +fi + --- xvt-2.1.orig/debian/prerm +++ xvt-2.1/debian/prerm @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +#DEBHELPER# + +if [ "$1" = remove ] || [ "$1" = deconfigure ]; then + update-alternatives --remove x-terminal-emulator /usr/bin/xvt +fi + --- xvt-2.1.orig/debian/rules +++ xvt-2.1/debian/rules @@ -0,0 +1,83 @@ +#!/usr/bin/make -f + +#export DH_VERBOSE=1 + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2 + $(MAKE) config + touch configure-stamp + +build: build-stamp +build-arch: build-stamp +build-indep: build-stamp + +build-stamp: configure-stamp + dh_testdir + $(MAKE) LDFLAGS="-L/usr/X11R6/lib" LIB="-lutil" + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + [ ! -f Makefile ] || $(MAKE) clean + QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2 + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs usr/bin + dh_install xvt usr/bin + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs README + dh_installexamples + dh_install debian/xvt.desktop usr/share/applications +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman xvt.1 + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- xvt-2.1.orig/debian/xvt.desktop +++ xvt-2.1/debian/xvt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Xvt +GenericName=Terminal +Comment=Run a command line shell +TryExec=xvt +Exec=xvt +Type=Application +Terminal=false +Icon=xterm-color +Categories=System;TerminalEmulator; +Keywords=shell;command;commandline;