From 91dc576ef38d612ba872a2d47e5298c27e4318fc Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 22 May 2022 13:50:20 +0000 Subject: A few support functions can be hidden using OPT_EXEC_XTERM, because the top-level features are disabled because our xterm uses pledge without "exec" support. ok matthieu --- app/xterm/button.c | 2 ++ app/xterm/charproc.c | 2 ++ app/xterm/misc.c | 4 ++++ 3 files changed, 8 insertions(+) (limited to 'app/xterm') diff --git a/app/xterm/button.c b/app/xterm/button.c index f10092a10..1a24f177a 100644 --- a/app/xterm/button.c +++ b/app/xterm/button.c @@ -5935,6 +5935,7 @@ expandFormat(XtermWidget xw, return result; } +#if OPT_EXEC_XTERM /* execute the command after forking. The main process frees its data */ static void executeCommand(pid_t pid, char **argv) @@ -6038,6 +6039,7 @@ HandleExecSelectable(Widget w, } } } +#endif /* OPT_EXEC_XTERM */ static void reallyInsertFormatted(Widget w, char *format, char *data, CELL *start, CELL *finish) diff --git a/app/xterm/charproc.c b/app/xterm/charproc.c index 422a28b8b..07dd84902 100644 --- a/app/xterm/charproc.c +++ b/app/xterm/charproc.c @@ -384,8 +384,10 @@ static XtActionsRec actionsList[] = { { "scroll-lock", HandleScrollLock }, #endif #if OPT_SELECTION_OPS +#if OPT_EXEC_XTERM { "exec-formatted", HandleExecFormatted }, { "exec-selectable", HandleExecSelectable }, +#endif /* OPT_EXEC_XTERM */ { "insert-formatted", HandleInsertFormatted }, { "insert-selectable", HandleInsertSelectable }, #endif diff --git a/app/xterm/misc.c b/app/xterm/misc.c index 89eee4880..0369ff4a4 100644 --- a/app/xterm/misc.c +++ b/app/xterm/misc.c @@ -2140,6 +2140,7 @@ timestamp_filename(char *dst, const char *src) tstruct->tm_sec); } +#if OPT_SCREEN_DUMPS FILE * create_printfile(XtermWidget xw, const char *suffix) { @@ -2171,7 +2172,9 @@ create_printfile(XtermWidget xw, const char *suffix) fp = (fd >= 0) ? fdopen(fd, "wb") : NULL; return fp; } +#endif /* OPT_SCREEN_DUMPS */ +#if OPT_SCREEN_DUMPS || defined(ALLOWLOGGING) int open_userfile(uid_t uid, gid_t gid, char *path, Bool append) { @@ -2319,6 +2322,7 @@ creat_as(uid_t uid, gid_t gid, Bool append, char *pathname, unsigned mode) } } #endif /* !VMS */ +#endif /* OPT_SCREEN_DUMPS || defined(ALLOWLOGGING) */ int xtermResetIds(TScreen *screen) -- cgit v1.2.3