entrance: let the greeter user be configurable

master
Marcel Hollerbach 7 years ago
parent 4486d92901
commit babe4d9807
  1. 3
      data/entrance.conf.in
  2. 17
      src/daemon/entrance.c
  3. 1
      src/daemon/entrance_config.c
  4. 1
      src/daemon/entrance_config.h

@ -69,4 +69,7 @@ group "Entrance_Config" struct {
/* Use a virtual keyboard */
value "virtual_keyboard" uchar: 0;
/* the user to log in with */
value "start_user" string: "entrance";
}

@ -192,17 +192,30 @@ _entrance_main(const char *dname)
if (!_entrance_client)
{
char buf[PATH_MAX];
const char *user = NULL;
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
_entrance_client_del, NULL);
ecore_event_handler_add(ECORE_EXE_EVENT_ERROR,
_entrance_client_error, NULL);
ecore_event_handler_add(ECORE_EXE_EVENT_DATA,
(Ecore_Event_Handler_Cb)_entrance_client_data, NULL);
if (entrance_config->start_user && entrance_config->start_user[0])
{
if (getpwnam(entrance_config->start_user))
user = entrance_config->start_user;
}
if (!user)
{
PT("The given user %s, is not not valid. Falling back to nobody user, possible that this wont work, set up a correct start_user in entrance.conf", entrance_config->start_user);
user = "nobody";
}
snprintf(buf, sizeof(buf),
SUDO" -u nobody "
SUDO" -u %s "
"LD_LIBRARY_PATH="PACKAGE_LIB_DIR" "
PACKAGE_BIN_DIR"/entrance_client -d %s -t %s",
dname, entrance_config->theme);
user, dname, entrance_config->theme);
PT("Exec entrance_client: %s", buf);
_entrance_client = ecore_exe_pipe_run(buf, ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_ERROR, NULL);

@ -170,6 +170,7 @@ entrance_config_init()
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "elementary_profile", elm_profile, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "virtual_keyboard", vkbd_enabled, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "custom_conf", custom_conf, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_Config, "start_user", start_user, EET_T_STRING);
_entrance_config_descriptor = edd;
if (stat( "/var/cache/"PACKAGE"/"ENTRANCE_CONFIG_FILE, &cache) == -1)

@ -37,6 +37,7 @@ struct _Entrance_Config
Eina_Bool autologin;
Eina_Bool custom_conf;
Eina_Bool vkbd_enabled;
const char *start_user;
};
void entrance_config_init(void);

Loading…
Cancel
Save