diff -ru xterm-112.orig/main.c xterm-112/main.c
--- xterm-112.orig/main.c	Sun Jul 18 02:29:42 1999
+++ xterm-112/main.c	Sun Oct 24 14:23:44 1999
@@ -772,6 +772,7 @@
     char *term_name;
     char *tty_modes;
     Boolean utmpInhibit;
+    Boolean messages;
     Boolean sunFunctionKeys;	/* %%% should be widget resource? */
 #if OPT_SUNPC_KBD
     Boolean sunKeyboard;
@@ -816,6 +817,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
@@ -922,6 +925,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"},
@@ -1050,6 +1055,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" },
@@ -2826,12 +2832,12 @@
 		if ((ttygrp = getgrnam("tty")) != 0) {
 			/* change ownership of tty to real uid, "tty" gid */
 			chown (ttydev, screen->uid, ttygrp->gr_gid);
-			chmod (ttydev, 0620);
+			chmod (ttydev, (resource.messages? 0620 : 0600));
 		}
 		else {
 			/* change ownership of tty to real group and user id */
 			chown (ttydev, screen->uid, screen->gid);
-			chmod (ttydev, 0622);
+			chmod (ttydev, (resource.messages? 0622 : 0600));
 		}
 		endgrent();
 	}
@@ -2840,7 +2846,7 @@
 		chown (ttydev, screen->uid, screen->gid);
 
 		/* change protection of tty */
-		chmod (ttydev, 0622);
+		chmod (ttydev, (resource.messages? 0622 : 0600));
 #endif /* USE_TTY_GROUP */
 
 		/*
diff -ru xterm-112.orig/os2main.c xterm-112/os2main.c
--- xterm-112.orig/os2main.c	Mon Jul 12 19:43:45 1999
+++ xterm-112/os2main.c	Sun Oct 24 14:24:05 1999
@@ -236,6 +236,7 @@
     char *term_name;
     char *tty_modes;
     Boolean utmpInhibit;
+    Boolean messages;
     Boolean sunFunctionKeys;	/* %%% should be widget resource? */
 #if OPT_SUNPC_KBD
     Boolean sunKeyboard;
@@ -276,6 +277,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
@@ -372,6 +375,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"},
@@ -497,6 +502,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" },
@@ -1547,7 +1553,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 -ru xterm-112.orig/xterm.man xterm-112/xterm.man
--- xterm-112.orig/xterm.man	Sun Jul 18 00:08:33 1999
+++ xterm-112/xterm.man	Sun Oct 24 14:25:52 1999
@@ -407,6 +407,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.
@@ -718,6 +726,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
