value "powersave.min" int: 0;
value "powersave.max" int: 5;
value "wm_win_rotation" uchar: 0;
+ value "wayland_socket_owner" string: "root";
+ value "wayland_socket_group" string: "root";
+ value "wayland_socket_permissions" int: 511; // decimal for 0777
}
value "exe_always_single_instance" uchar: 1;
value "use_desktop_window_profile" int: 0;
value "wm_win_rotation" uchar: 0;
+ value "wayland_socket_owner" string: "root";
+ value "wayland_socket_group" string: "root";
+ value "wayland_socket_permissions" int: 511; // decimal for 0777
}
value "exe_always_single_instance" uchar: 0;
value "use_desktop_window_profile" int: 0;
value "wm_win_rotation" uchar: 0;
+ value "wayland_socket_owner" string: "root";
+ value "wayland_socket_group" string: "root";
+ value "wayland_socket_permissions" int: 511; // decimal for 0777
}
value "exe_always_single_instance" uchar: 0;
value "use_desktop_window_profile" int: 0;
value "wm_win_rotation" uchar: 0;
+ value "wayland_socket_owner" string: "root";
+ value "wayland_socket_group" string: "root";
+ value "wayland_socket_permissions" int: 511; // decimal for 0777
}
const char *name;
int fd = 0;
E_Module *_mod;
+ const char *runtime_dir;
/* create new compositor data */
if (!(cdata = E_NEW(E_Comp_Wl_Data, 1)))
goto sock_err;
}
+ runtime_dir = getenv("XDG_RUNTIME_DIR");
+ if (runtime_dir &&
+ e_config->wayland_socket_owner &&
+ e_config->wayland_socket_group) {
+ struct group *g;
+ struct passwd *u;
+ uid_t uid;
+ gid_t gid;
+
+ char socket_path[108]; // sun_path is 108 bytes see <sys/un.h>
+ snprintf(socket_path, sizeof(socket_path), "%s/%s", runtime_dir, name);
+
+ u = getpwnam(e_config->wayland_socket_owner);
+ uid = (u !=NULL) ? u->pw_uid : 0;
+
+ g = getgrnam(e_config->wayland_socket_group);
+ gid = (g != NULL) ? g->gr_gid : 0;
+
+ DBG("socket path: %s owner: %s (%d) group: %s (%d) permissions: %o",
+ e_config->wayland_socket_owner, uid,
+ e_config->wayland_socket_group, gid,
+ e_config->wayland_socket_permissions);
+
+ chmod(socket_path, e_config->wayland_socket_permissions);
+ chown(socket_path, uid, gid);
+ }
/* set wayland display environment variable */
e_env_set("WAYLAND_DISPLAY", name);
E_CONFIG_VAL(D, T, cursor_timer_interval, INT);
E_CONFIG_LIST(D, T, client_types, _e_config_client_type_edd);
E_CONFIG_VAL(D, T, comp_shadow_file, STR);
+ E_CONFIG_VAL(D, T, wayland_socket_owner, STR);
+ E_CONFIG_VAL(D, T, wayland_socket_group, STR);
+ E_CONFIG_VAL(D, T, wayland_socket_permissions, INT);
}
/* externally accessible functions */
int cursor_timer_interval;
Eina_List *client_types;
const char *comp_shadow_file;
+ const char* wayland_socket_owner;
+ const char* wayland_socket_group;
+ unsigned int wayland_socket_permissions;
};
struct _E_Config_Desklock_Background