diff -ruN xterm-119.orig/main.c xterm-119/main.c
--- xterm-119.orig/main.c	Fri Oct 15 12:19:17 1999
+++ xterm-119/main.c	Sun Oct 24 14:41:20 1999
@@ -759,6 +759,7 @@
     char *tty_modes;
     Boolean hold_screen;	/* true if we keep window open	*/
     Boolean utmpInhibit;
+    Boolean messages;
     Boolean sunFunctionKeys;	/* %%% should be widget resource? */
 #if OPT_SUNPC_KBD
     Boolean sunKeyboard;
@@ -805,6 +806,8 @@
 	offset(hold_screen), XtRString, "false"},
     {"utmpInhibit", "UtmpInhibit", XtRBoolean, sizeof (Boolean),
 	offset(utmpInhibit), XtRString, "false"},
+    {"messages", "Messages", XtRBoolean, sizeof (Boolean),
+	offset(messages), XtRString, "true"},
     {"sunFunctionKeys", "SunFunctionKeys", XtRBoolean, sizeof (Boolean),
 	offset(sunFunctionKeys), XtRString, "false"},
 #if OPT_SUNPC_KBD
@@ -913,6 +916,8 @@
 {"-mb",		"*marginBell",	XrmoptionNoArg,		(caddr_t) "on"},
 {"+mb",		"*marginBell",	XrmoptionNoArg,		(caddr_t) "off"},
 {"-mc",		"*multiClickTime", XrmoptionSepArg,	(caddr_t) NULL},
+{"-mesg",	"*messages",	XrmoptionNoArg,		(caddr_t) "off"},
+{"+mesg",	"*messages",	XrmoptionNoArg,		(caddr_t) "on"},
 {"-ms",		"*pointerColor",XrmoptionSepArg,	(caddr_t) NULL},
 {"-nb",		"*nMarginBell",	XrmoptionSepArg,	(caddr_t) NULL},
 {"-nul",	"*underLine",	XrmoptionNoArg,		(caddr_t) "off"},
@@ -1042,6 +1047,7 @@
 { "-/+ls",                 "turn on/off login shell" },
 { "-/+mb",                 "turn on/off margin bell" },
 { "-mc milliseconds",      "multiclick time in milliseconds" },
+{ "-/+mesg",		   "forbid/allow messages" },
 { "-ms color",             "pointer color" },
 { "-nb number",            "margin bell in characters from right end" },
 { "-/+nul",                "turn on/off display of underlining" },
@@ -2820,17 +2826,20 @@
 		struct group *ttygrp;
 		if ((ttygrp = getgrnam("tty")) != 0) {
 			/* change ownership of tty to real uid, "tty" gid */
-			set_owner (ttydev, screen->uid, ttygrp->gr_gid, 0620);
+			set_owner (ttydev, screen->uid, ttygrp->gr_gid,
+				   (resource.messages? 0620 : 0600));
 		}
 		else {
 			/* change ownership of tty to real group and user id */
-			set_owner (ttydev, screen->uid, screen->gid, 0622);
+			set_owner (ttydev, screen->uid, screen->gid,
+				   (resource.messages? 0622 : 0600));
 		}
 		endgrent();
 	}
 #else /* else !USE_TTY_GROUP */
 		/* change ownership of tty to real group and user id */
-		set_owner (ttydev, screen->uid, screen->gid, 0622);
+		set_owner (ttydev, screen->uid, screen->gid,
+			   (resource.messages? 0622 : 0600));
 #endif /* USE_TTY_GROUP */
 
 		/*
diff -ruN xterm-119.orig/os2main.c xterm-119/os2main.c
--- xterm-119.orig/os2main.c	Mon Sep 27 22:12:18 1999
+++ xterm-119/os2main.c	Sun Oct 24 14:37:49 1999
@@ -235,6 +235,7 @@
     char *term_name;
     char *tty_modes;
     Boolean utmpInhibit;
+    Boolean messages;
     Boolean sunFunctionKeys;	/* %%% should be widget resource? */
 #if OPT_SUNPC_KBD
     Boolean sunKeyboard;
@@ -275,6 +276,8 @@
 	offset(tty_modes), XtRString, (caddr_t) NULL},
     {"utmpInhibit", "UtmpInhibit", XtRBoolean, sizeof (Boolean),
 	offset(utmpInhibit), XtRString, "false"},
+    {"messages", "Messages", XtRBoolean, sizeof (Boolean),
+	offset(messages), XtRString, "true"},
     {"sunFunctionKeys", "SunFunctionKeys", XtRBoolean, sizeof (Boolean),
 	offset(sunFunctionKeys), XtRString, "false"},
 #if OPT_SUNPC_KBD
@@ -371,6 +374,8 @@
 {"-mb",		"*marginBell",	XrmoptionNoArg,		(caddr_t) "on"},
 {"+mb",		"*marginBell",	XrmoptionNoArg,		(caddr_t) "off"},
 {"-mc",		"*multiClickTime", XrmoptionSepArg,	(caddr_t) NULL},
+{"-mesg",	"*messages",	XrmoptionNoArg,		(caddr_t) "off"},
+{"+mesg",	"*messages",	XrmoptionNoArg,		(caddr_t) "on"},
 {"-ms",		"*pointerColor",XrmoptionSepArg,	(caddr_t) NULL},
 {"-nb",		"*nMarginBell",	XrmoptionSepArg,	(caddr_t) NULL},
 {"-nul",	"*underLine",	XrmoptionNoArg,		(caddr_t) "off"},
@@ -496,6 +501,7 @@
 { "-/+ls",                 "turn on/off login shell" },
 { "-/+mb",                 "turn on/off margin bell" },
 { "-mc milliseconds",      "multiclick time in milliseconds" },
+{ "-/+mesg",		   "forbid/allow messages" },
 { "-ms color",             "pointer color" },
 { "-nb number",            "margin bell in characters from right end" },
 { "-/+nul",                "turn on/off display of underlining" },
@@ -1517,7 +1523,7 @@
 			chown (ttydev, screen->uid, screen->gid);
 
 			/* change protection of tty */
-			chmod (ttydev, 0622);
+			chmod (ttydev, (resource.messages? 0622 : 0600));
 
 			/* for the xf86sup-pty, we set the pty to bypass: OS/2 does
 			 * not have a line discipline structure
diff -ruN xterm-119.orig/xterm.man xterm-119/xterm.man
--- xterm-119.orig/xterm.man	Fri Oct 15 11:56:55 1999
+++ xterm-119/xterm.man	Sun Oct 24 14:37:49 1999
@@ -417,6 +417,14 @@
 .B "\-mc milliseconds"
 This option specifies the maximum time between multi-click selections.
 .TP 8
+.B \-mesg
+Turn off the \fBmessages\fP resource, i.e.,
+disallow write access to the terminal.
+.TP 8
+.B \+mesg
+Turn on the \fBmessages\fP resource, i.e.,
+allow write access to the terminal.
+.TP 8
 .BI \-ms " color"
 This option specifies the color to be used for the pointer cursor.  The default
 is to use the foreground color.
@@ -737,6 +745,11 @@
 .TP 8
 .B "iconName (\fPclass\fB IconName)"
 Specifies the icon name.  The default is the application name.
+.TP 8
+.B "messages (\fPclass\fB Messages)"
+Specifies whether write access to the terminal is allowed initially.  See
+.BR mesg (1).
+The default is ``true''.
 .TP 8
 .B "ptyInitialErase (\fPclass\fB PtyInitialErase)"
 If ``true'', \fIxterm\fP will use the pseudo-terminal's sense of the stty erase
