1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Fix /back in Capsicum capability mode.

Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
This commit is contained in:
Edward Tomasz Napierala 2017-09-01 10:39:14 +01:00
parent 245a3fd4c1
commit b529e1a9df

View File

@ -28,6 +28,9 @@
#include "settings.h" #include "settings.h"
#include "irssi-version.h" #include "irssi-version.h"
#include "servers.h" #include "servers.h"
#ifdef HAVE_CAPSICUM
#include "capsicum.h"
#endif
#include "fe-windows.h" #include "fe-windows.h"
#include "printtext.h" #include "printtext.h"
@ -120,6 +123,9 @@ static void cmd_cat(const char *data)
GIOChannel *handle; GIOChannel *handle;
GString *buf; GString *buf;
gsize tpos; gsize tpos;
#ifdef HAVE_CAPSICUM
int fd;
#endif
if (!cmd_get_params(data, &free_arg, 2, &fname, &fposstr)) if (!cmd_get_params(data, &free_arg, 2, &fname, &fposstr))
return; return;
@ -128,7 +134,15 @@ static void cmd_cat(const char *data)
fpos = atoi(fposstr); fpos = atoi(fposstr);
cmd_params_free(free_arg); cmd_params_free(free_arg);
#ifdef HAVE_CAPSICUM
fd = capsicum_open_wrapper(fname, O_RDONLY, 0);
if (fd > 0)
handle = g_io_channel_unix_new(fd);
else
handle = NULL;
#else
handle = g_io_channel_new_file(fname, "r", NULL); handle = g_io_channel_new_file(fname, "r", NULL);
#endif
g_free(fname); g_free(fname);
if (handle == NULL) { if (handle == NULL) {