restorecond: Set GLib IO channels to binary mode
By default, GIO channels use UTF-8 as encoding, which causes issues when reading binary data such as inotify events. Signed-off-by: Fabian Vogt <fvogt@suse.de> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
6f2b689f63
commit
5131c4794d
|
@ -238,6 +238,7 @@ static int local_server(void) {
|
||||||
}
|
}
|
||||||
/* watch for stdin/terminal going away */
|
/* watch for stdin/terminal going away */
|
||||||
GIOChannel *in = g_io_channel_unix_new(0);
|
GIOChannel *in = g_io_channel_unix_new(0);
|
||||||
|
g_io_channel_set_encoding(in, NULL, NULL);
|
||||||
g_io_add_watch_full( in,
|
g_io_add_watch_full( in,
|
||||||
G_PRIORITY_HIGH,
|
G_PRIORITY_HIGH,
|
||||||
G_IO_IN|G_IO_ERR|G_IO_HUP,
|
G_IO_IN|G_IO_ERR|G_IO_HUP,
|
||||||
|
@ -282,6 +283,7 @@ int server(int master_fd, const char *watch_file) {
|
||||||
set_matchpathcon_flags(MATCHPATHCON_NOTRANS);
|
set_matchpathcon_flags(MATCHPATHCON_NOTRANS);
|
||||||
|
|
||||||
GIOChannel *c = g_io_channel_unix_new(master_fd);
|
GIOChannel *c = g_io_channel_unix_new(master_fd);
|
||||||
|
g_io_channel_set_encoding(c, NULL, NULL);
|
||||||
|
|
||||||
g_io_add_watch_full(c,
|
g_io_add_watch_full(c,
|
||||||
G_PRIORITY_HIGH,
|
G_PRIORITY_HIGH,
|
||||||
|
|
Loading…
Reference in New Issue