Commit Diff


commit - 1deaf3979efdb3e27a57aeb2d7c93c0b7550639d
commit + b1d4d01bdcdee5ab691717b751facbaee1870baa
blob - 14bb96c2488332b3434a08b2a92b5abc987bb181
blob + 550c6d1f6a2c846270a261c5c863b4f119ca6fcf
--- sandbox.c
+++ sandbox.c
@@ -16,7 +16,6 @@
 
 #include "compat.h"
 
-
 #ifdef __OpenBSD__
 
 # include <err.h>
@@ -30,6 +29,13 @@ sandbox_network_process(void)
 		err(1, "pledge");
 }
 
+void
+sandbox_ui_process(void)
+{
+	if (pledge("stdio tty", NULL))
+		err(1, "pledge");
+}
+
 #else
 
 #warning "No sandbox for this OS"
blob - c988b657fc27872b89876faefae0da1b1c6ffcd1
blob + 9044a5f66221c0e8dafa303ace681e87d1de1a89
--- telescope.c
+++ telescope.c
@@ -373,6 +373,8 @@ main(void)
 		imsg_init(&network_ibuf, imsg_fds[1]);
 		exit(client_main(&network_ibuf));
 	}
+
+	setproctitle("ui");
 
 	close(imsg_fds[1]);
 	imsg_init(&main_ibuf, imsg_fds[0]);
@@ -387,6 +389,8 @@ main(void)
 
 	ui_init();
 
+	sandbox_ui_process();
+
 	event_dispatch();
 
 	imsg_compose(netibuf, IMSG_QUIT, 0, 0, -1, NULL, 0);
blob - 8feb4c5a1a23363dfdec4de402b93406a725ffef
blob + 382a95116c89beb11b4d9a2975dbe37d594463e4
--- telescope.h
+++ telescope.h
@@ -193,6 +193,7 @@ int		 parser_set_buf(struct parser*, const char*, size
 
 /* sandbox.c */
 void		 sandbox_network_process(void);
+void		 sandbox_ui_process(void);
 
 /* telescope.c */
 void		 load_about_url(struct tab*, const char*);