1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-30 06:45:25 +00: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 "irssi-version.h"
#include "servers.h"
#ifdef HAVE_CAPSICUM
#include "capsicum.h"
#endif
#include "fe-windows.h"
#include "printtext.h"
@ -120,6 +123,9 @@ static void cmd_cat(const char *data)
GIOChannel *handle;
GString *buf;
gsize tpos;
#ifdef HAVE_CAPSICUM
int fd;
#endif
if (!cmd_get_params(data, &free_arg, 2, &fname, &fposstr))
return;
@ -128,7 +134,15 @@ static void cmd_cat(const char *data)
fpos = atoi(fposstr);
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);
#endif
g_free(fname);
if (handle == NULL) {