From 553b461bdca9858a3bacd9a17483d0f95e193c08 Mon Sep 17 00:00:00 2001 From: matthieu Date: Mon, 20 Jan 2020 21:03:35 +0000 Subject: [PATCH] Disable the print-immediate and print-on-error functions in xterm. They a causing a pledge violation when called, and we can live without them. ok millert, also discussed with deraadt@ --- app/xterm/Makefile | 4 ++-- app/xterm/charproc.c | 2 +- app/xterm/menu.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/xterm/Makefile b/app/xterm/Makefile index 03813783f..d77494973 100644 --- a/app/xterm/Makefile +++ b/app/xterm/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.33 2019/03/09 20:10:19 matthieu Exp $ +# $OpenBSD: Makefile,v 1.34 2020/01/20 21:03:35 matthieu Exp $ .include SUBDIR= icons resize @@ -14,7 +14,7 @@ CPPFLAGS+= -I. -I${.CURDIR} -I${X11BASE}/include \ -DHAVE_CONFIG_H -DCSRG_BASED \ -DFUNCPROTO=15 -DNARROWPROTO -DXFREE86_FT2 -DUTMP \ -DDEF_ALLOW_FONT=False -DDEF_ALLOW_TCAP=False \ - -DDEF_ALLOW_WINDOW=False + -DDEF_ALLOW_WINDOW=False -DOPT_PRINT_ON_EXIT=0 LDADD+= -L${X11BASE}/lib -lXaw -lXpm -lXt -lSM -lICE -lXmu \ -lXft -lXrender -lXinerama -lX11 -lxcb -lXext -lXau -lXdmcp \ -lfontconfig -lexpat -lfreetype -lutil -ltermcap -lz diff --git a/app/xterm/charproc.c b/app/xterm/charproc.c index 3ca048039..34639adc6 100644 --- a/app/xterm/charproc.c +++ b/app/xterm/charproc.c @@ -364,7 +364,7 @@ static XtActionsRec actionsList[] = { { "meta-sends-escape", HandleMetaEsc }, { "set-num-lock", HandleNumLock }, #endif -#ifdef OPT_PRINT_ON_EXIT +#if OPT_PRINT_ON_EXIT { "print-immediate", HandlePrintImmediate }, { "print-on-error", HandlePrintOnError }, #endif diff --git a/app/xterm/menu.c b/app/xterm/menu.c index 7afe5f3f6..7580c3cda 100644 --- a/app/xterm/menu.c +++ b/app/xterm/menu.c @@ -313,7 +313,7 @@ MenuEntry mainMenuEntries[] = { #ifdef ALLOWLOGGING { "logging", do_logging, NULL }, #endif -#ifdef OPT_PRINT_ON_EXIT +#if OPT_PRINT_ON_EXIT { "print-immediate", do_write_now, NULL }, { "print-on-error", do_write_error, NULL }, #endif @@ -825,7 +825,7 @@ domenu(Widget w, update_meta_esc(); update_delete_del(); update_keyboard_type(); -#ifdef OPT_PRINT_ON_EXIT +#if OPT_PRINT_ON_EXIT screen->write_error = !IsEmpty(resource.printFileOnXError); SetItemSensitivity(mainMenuEntries[mainMenu_write_now].widget, True); SetItemSensitivity(mainMenuEntries[mainMenu_write_error].widget, screen->write_error); @@ -1158,7 +1158,7 @@ do_logging(Widget gw GCC_UNUSED, } #endif -#ifdef OPT_PRINT_ON_EXIT +#if OPT_PRINT_ON_EXIT static void do_write_now(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED,