diff -Nru ibus-1.5.14/debian/changelog ibus-1.5.14/debian/changelog --- ibus-1.5.14/debian/changelog 2016-12-12 14:26:38.000000000 +0000 +++ ibus-1.5.14/debian/changelog 2018-05-08 14:07:31.000000000 +0000 @@ -1,3 +1,11 @@ +ibus (1.5.14-2ubuntu2) xenial; urgency=medium + + * debian/patches/ubuntu-conditional-chmod.patch: backport an upstream commit + to make a call to chmod conditional, to avoid apparmor denials for confined + apps (e.g. snaps) that use libibus (LP: #1761585) + + -- Olivier Tilloy Tue, 08 May 2018 16:07:31 +0200 + ibus (1.5.14-2ubuntu1) zesty; urgency=medium * Merge with Debian, remaining changes: diff -Nru ibus-1.5.14/debian/patches/series ibus-1.5.14/debian/patches/series --- ibus-1.5.14/debian/patches/series 2016-12-12 14:24:16.000000000 +0000 +++ ibus-1.5.14/debian/patches/series 2018-05-08 14:07:31.000000000 +0000 @@ -17,3 +17,4 @@ ubuntu-no-notification.patch ubuntu-disable-trigger.patch ubuntu-forward-panel-properties.patch +ubuntu-conditional-chmod.patch diff -Nru ibus-1.5.14/debian/patches/ubuntu-conditional-chmod.patch ibus-1.5.14/debian/patches/ubuntu-conditional-chmod.patch --- ibus-1.5.14/debian/patches/ubuntu-conditional-chmod.patch 1970-01-01 00:00:00.000000000 +0000 +++ ibus-1.5.14/debian/patches/ubuntu-conditional-chmod.patch 2018-05-08 14:07:31.000000000 +0000 @@ -0,0 +1,27 @@ +Description: Make the call to chmod in ibus_bus_init conditional +Author: Olivier Tilloy +Origin: https://github.com/ibus/ibus/commit/28d0c1d4bc47beb38995d84cc4bb1d539c08a070 +Bug: https://github.com/ibus/ibus/issues/1996 +Bug-Ubuntu: https://launchpad.net/bugs/1761585 + +Index: ibus-1.5.14/src/ibusbus.c +=================================================================== +--- ibus-1.5.14.orig/src/ibusbus.c ++++ ibus-1.5.14/src/ibusbus.c +@@ -449,13 +449,15 @@ ibus_bus_init (IBusBus *bus) + path = g_path_get_dirname (ibus_get_socket_path ()); + + g_mkdir_with_parents (path, 0700); +- g_chmod (path, 0700); + + if (stat (path, &buf) == 0) { + if (buf.st_uid != getuid ()) { + g_warning ("The owner of %s is not %s!", path, ibus_get_user_name ()); + return; + } ++ if (buf.st_mode != (S_IFDIR | S_IRWXU)) { ++ g_chmod (path, 0700); ++ } + } + + file = g_file_new_for_path (ibus_get_socket_path ());