Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 xtv (1.1-15) unstable; urgency=medium
 .
   * packaging updates, just version bumping and repo swizzling
Author: Barak A. Pearlmutter <bap@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2018-03-28

--- xtv-1.1.orig/Grab.c
+++ xtv-1.1/Grab.c
@@ -1,9 +1,9 @@
 /*
 ** Grab.c for XmtdsGrab widget in .
-** 
+**
 ** Made by MaxTheDogSays (dubray_f@epita.fr && rancur_v@epita.fr
 ** Login   <vr@epita.fr>
-** 
+**
 ** Started on  Mon May 16 22:24:08 1994 vr
 ** Last update Tue Apr  4 02:31:06 1995 mtds
 */
@@ -11,6 +11,7 @@
 #include <X11/IntrinsicP.h>
 #include <X11/StringDefs.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include "XmtdsI.h"
 #include "GrabP.h"
 
@@ -38,36 +39,36 @@ XmtdsGrabClassRec	xmtdsGrabClassRec = {
    /* core */
    (WidgetClass)&widgetClassRec,	/* superclass		*/
    "XmtdsGrab",				/* class name		*/
-   sizeof(XmtdsGrabRec),		/* size			*/   
-   NULL,				/* class initialize	*/   
-   NULL,				/* class_part_init	*/   
-   FALSE,				/* class_inited		*/   
-   Initialize,				/* initialize		*/   
-   NULL,				/* initialize_hook	*/   
-   XtInheritRealize,			/* realize		*/   
-   NULL,				/* actions		*/   
-   0,					/* num_actions		*/   
-   resources,				/* resources		*/   
-   XtNumber(resources),			/* resource_count	*/   
-   NULLQUARK,				/* xrm_class		*/   
-   TRUE,				/* compress_motion	*/   
-   TRUE,				/* compress_exposure	*/   
-   TRUE,				/* compress_enterleave	*/   
-   FALSE,				/* visible_interest	*/   
-   Destroy,				/* destroy		*/   
-   NULL,				/* resize		*/   
-   Redisplay,				/* expose		*/   
-   NULL,				/* set_values		*/   
-   NULL,				/* set_values_hook	*/   
-   XtInheritSetValuesAlmost,		/* set_values_almost	*/   
-   NULL,				/* get_values_hook	*/   
-   NULL,				/* accept_focus		*/   
-   XtVersion,				/* version		*/   
-   NULL,				/* callback_private	*/   
-   NULL,				/* tm_table		*/   
-   XtInheritQueryGeometry,		/* query_geometry	*/   
-   XtInheritDisplayAccelerator,		/* display_accelerator	*/   
-   NULL,				/* extension		*/   
+   sizeof(XmtdsGrabRec),		/* size			*/
+   NULL,				/* class initialize	*/
+   NULL,				/* class_part_init	*/
+   FALSE,				/* class_inited		*/
+   Initialize,				/* initialize		*/
+   NULL,				/* initialize_hook	*/
+   XtInheritRealize,			/* realize		*/
+   NULL,				/* actions		*/
+   0,					/* num_actions		*/
+   resources,				/* resources		*/
+   XtNumber(resources),			/* resource_count	*/
+   NULLQUARK,				/* xrm_class		*/
+   TRUE,				/* compress_motion	*/
+   TRUE,				/* compress_exposure	*/
+   TRUE,				/* compress_enterleave	*/
+   FALSE,				/* visible_interest	*/
+   Destroy,				/* destroy		*/
+   NULL,				/* resize		*/
+   Redisplay,				/* expose		*/
+   NULL,				/* set_values		*/
+   NULL,				/* set_values_hook	*/
+   XtInheritSetValuesAlmost,		/* set_values_almost	*/
+   NULL,				/* get_values_hook	*/
+   NULL,				/* accept_focus		*/
+   XtVersion,				/* version		*/
+   NULL,				/* callback_private	*/
+   NULL,				/* tm_table		*/
+   XtInheritQueryGeometry,		/* query_geometry	*/
+   XtInheritDisplayAccelerator,		/* display_accelerator	*/
+   NULL,				/* extension		*/
 },
 /* xmtds_grab */
 {
@@ -84,9 +85,9 @@ ArgList			args;
 Cardinal		*num_args;
 {
    XGCValues		xgcv;
-   
+
    if ((NEW_GRAB.display =
-	XOpenDisplay((unsigned char *)NEW_GRAB.display_name)) == NULL)
+	XOpenDisplay((char *)NEW_GRAB.display_name)) == NULL)
    {
       XtWarning("can't open display");
       exit(-1);
@@ -138,7 +139,7 @@ XtIntervalId			*id;
 {
    Dimension			width;
    Dimension			height;
-   
+
 #ifdef SYNC
    XSync(XtDisplay(w),FALSE);
 #endif /* SYNC */
@@ -146,7 +147,7 @@ XtIntervalId			*id;
 		 XtNwidth,	&width,
 		 XtNheight,	&height,
 		 NULL);
-   copy(w,ABS(CORE.x),ABS(CORE.y),width,height);		
+   copy(w,ABS(CORE.x),ABS(CORE.y),width,height);
    GRAB.xt_interval_id =
       XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)w),
 		      GRAB.interval,
@@ -164,7 +165,7 @@ Dimension		height;
    XImage		*image;
    Dimension		dpy_width;
    Dimension		dpy_height;
-   
+
    dpy_width = DisplayWidth(GRAB.display,DefaultScreen(GRAB.display));
    dpy_height = DisplayHeight(GRAB.display,DefaultScreen(GRAB.display));
    if ((x + width) > dpy_width)
@@ -189,7 +190,6 @@ Dimension		height;
 	     x,
 	     y,
 	     width,
-	     height);  
+	     height);
    XDestroyImage(image);
 }
-
--- xtv-1.1.orig/Imakefile
+++ xtv-1.1/Imakefile
@@ -1,23 +1,8 @@
-#
-# Imakefile for xtetris in .
-# 
-# Made by MaxTheDogSays (dubray_f@epita.fr && rancur_v@epita.fr
-# Login   <vr@epita.fr>
-# 
-# Started on  Sat Jun 25 15:43:45 1994 vr
-# Last update Tue Apr  4 02:11:36 1995 mtds
-#
+# Imakefile for xtv.
 
-           SRCS = xtv.c Grab.c
+SRCS = xtv.c Grab.c
+OBJS = xtv.o Grab.o
 
-           OBJS = xtv.o Grab.o
-
-    CDEBUGFLAGS = -g
-        DEPLIBS = 
-
-
-        DEFINES = 
-LOCAL_LIBRARIES = -lXaw -lXext -lXmu -lXt -lX11
+LOCAL_LIBRARIES = -lXaw -lXt -lX11
 
 ComplexProgramTarget(xtv)
-InstallAppDefaults(XTv)
--- /dev/null
+++ xtv-1.1/README
@@ -0,0 +1,41 @@
+Assuming you want to display on $DISPLAY what is on the display
+$VICTIM, then you go
+
+ xtv -d $VICTIM
+
+NOTE: you must have appropriate permissions.  You can test with
+
+ xlsclient -display $VICTIM
+
+To deal with permissions, assuming $VHOST is the host on which the
+$VICTIM display resides, and ~vic is the home directory of the victim,
+you can do this:
+
+  ssh -X -a root@$VHOST
+  export VICTIM=:0.0    # or whatever
+  xauth add `xauth -f ~vic/.Xauthority list $VICTIM`
+  xtv -d $VICTIM
+
+Other potentially less secure methods would include editing
+/etc/X11/xinit/xserverrc on $VHOST to remove "-nolisten tcp",
+restarting the X server there, and doing an "xhost + $DISPLAYHOST"
+
+One use for xtv aside from spying on people without their knowledge,
+is so students in a computer classroom can see everything on the
+instructor's screen on their own, which can be much easier on the eyes
+than a distant fuzzy projector.
+
+  WARNING: be careful with "xhost + host-evil-person-can-log-onto"
+  because you leave $VICTIM open to various attacks.  It is equivalent
+  to letting anyone who can log onto host-evil-person-can-log-onto sit
+  at the $VICTIM display and type whatever they want unobserved.  This
+  is of particular relevance in an academic setting, where a nasty
+  person could remotely log onto student-machine, so if you've done an
+  "xhost + student-machine" be aware that people other than the person
+  actually sitting at that machine can potentially do nasties through
+  it.
+
+The "right" way to let students see your display is to give each of
+them access to an account on your machine (can be shared) using a
+secure mechanism, and using xauth commands of the sort shown above to
+let people who "ssh -X" into that account access its :0.0 display.
--- xtv-1.1.orig/XmtdsI.h
+++ xtv-1.1/XmtdsI.h
@@ -1,9 +1,9 @@
 /*
 ** XmtdsI.h for Xmtds
-** 
+**
 ** Made by MaxTheDogSays (dubray_f@epita.fr && rancur_v@epita.fr)
 ** Login   <mtds@epita.fr>
-** 
+**
 ** Started on  Thu Jan 12 23:27:08 1995 mtds
 ** Last update Thu Jan 12 23:37:46 1995 mtds
 */
@@ -17,26 +17,26 @@
 void	*malloc();
 void	*realloc();
 
-#define EXIT_FAILURE		exit(255)
+#define EXIT_FAIL		exit(255)
 #define EXIT_SUCCEED		exit(0)
 
 #define BUF_SIZE		512
 
 #define SYSCALL_ERROR(syscall)	{perror(syscall);fprintf(stderr,"%s %d\n",\
 							 __FILE__,__LINE__);\
-				    EXIT_FAILURE;}		
+				    EXIT_FAIL;}
 
 #define MALLOC(ptr,size,comm)	{if (((ptr) = malloc(size)) == NULL)\
 				 {perror("malloc");\
 				     printf("File %s Line %d : %s\n",\
 					    __FILE__,__LINE__,comm);\
-				     EXIT_FAILURE;}}
+				     EXIT_FAIL;}}
 
 #define REALLOC(ptr,size,comm)	{if (((ptr) = realloc((ptr),(size))) == NULL)\
 				 {perror("realloc");\
 				     printf("File %s Line %d : %s\n",\
 					    __FILE__,__LINE__,comm);\
-				     EXIT_FAILURE;}}
+				     EXIT_FAIL;}}
 /* Xlib */
 
 #define LOOKUP_STRING_BUFSIZ	512
--- xtv-1.1.orig/xtv.c
+++ xtv-1.1/xtv.c
@@ -1,14 +1,16 @@
 /*
 ** xtv.c for Mtds in .
 ** 
-** Made by MaxTheDogSays (dubray_f@epita.fr && rancur_v@epita.fr
+** Made by MaxTheDogSays (dubray_f@epita.fr && rancur_v@epita.fr)
 ** Login   <mtds@epita.fr>
 ** 
 ** Started on  Tue May  3 23:29:35 1994 mtds
-** Last update Tue Apr  4 02:19:53 1995 mtds
+** Updated on  Tue Apr  4 02:19:53 1995 mtds
+** Minor mods  Sun Oct  7 13:42:49 MDT 2001 bap@cs.unm.edu
 */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
 #include <X11/Xaw/Viewport.h>
@@ -29,9 +31,13 @@ static XrmOptionDescRec options[] =
     XrmoptionSepArg,	NULL}
 };
 
-int		main(argc,argv)
-int		argc;
-char		**argv;
+void usage()
+{
+   fprintf(stderr,"usage: xtv [-s refresh_timeout] [-d display]\n");
+   exit(255);
+}
+
+int main(int argc, char **argv)
 {
    appl		app;
    Widget	viewport;
@@ -64,10 +70,5 @@ char		**argv;
    XtManageChild(viewport);
    XtRealizeWidget(app.toplevel);
    XtAppMainLoop(app.app_context);
-}
-
-int	usage()
-{
-   fprintf(stderr,"usage: xtv [-s refresh_timeout] [-d display]\n");
-   exit(255);
+   return 0;
 }
