Skip to content

Commit

Permalink
Make the call to chmod in ibus_bus_init conditional (fixes ibus#1996).
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Tilloy committed Apr 5, 2018
1 parent 75a6667 commit e647068
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ibusbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,14 +557,16 @@ 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);
}
}

g_free (path);
Expand Down

0 comments on commit e647068

Please sign in to comment.