sesman: Fedora bug 821569

ulab-next
Jay Sorg 11 years ago
parent 0e9e6a2356
commit 538763e144

@ -49,6 +49,16 @@ auth_userpass(char* user, char* pass, int *errorcode);
int DEFAULT_CC
auth_start_session(long in_val, int in_display);
/**
*
* @brief FIXME
* @param in_val
* @return 0 on success, 1 on failure
*
*/
int DEFAULT_CC
auth_stop_session(long in_val);
/**
*
* @brief FIXME

@ -62,11 +62,11 @@ static int g_sync_cmd;
char *APP_CC
dumpItemsToString(struct list *self, char *outstr, int len)
{
g_memset(outstr, 0, len);
int index;
tbus item;
int totalLen = 0;
g_memset(outstr, 0, len);
if (self->count == 0)
{
g_writeln("List is empty");
@ -385,6 +385,7 @@ session_start_fork(int width, int height, int bpp, char *username,
int display = 0;
int pid = 0;
int wmpid = 0;
int pampid = 0;
int xpid = 0;
int i = 0;
char geometry[32];
@ -453,24 +454,27 @@ session_start_fork(int width, int height, int bpp, char *username,
{
g_tcp_close(g_sck);
g_tcp_close(g_thread_sck);
auth_start_session(data, display);
g_sprintf(geometry, "%dx%d", width, height);
g_sprintf(depth, "%d", bpp);
g_sprintf(screen, ":%d", display);
wmpid = g_fork();
if (wmpid == -1)
{
}
else if (wmpid == 0) /* child (child sesman) xserver */
{
wait_for_xserver(display);
auth_start_session(data, display);
pampid = g_fork();
if (pampid == -1)
{
}
else if (pampid == 0) /* child: X11/client */
{
env_set_user(username, 0, display);
if (x_server_running(display))
{
auth_set_env(data);
if (directory != 0)
{
if (directory[0] != 0)
@ -478,7 +482,6 @@ session_start_fork(int width, int height, int bpp, char *username,
g_set_current_dir(directory);
}
}
if (program != 0)
{
if (program[0] != 0)
@ -489,12 +492,10 @@ session_start_fork(int width, int height, int bpp, char *username,
program, username, g_getpid());
}
}
/* try to execute user window manager if enabled */
if (g_cfg->enable_user_wm)
{
g_sprintf(text, "%s/%s", g_getenv("HOME"), g_cfg->user_wm);
if (g_file_exist(text))
{
g_execlp3(text, g_cfg->user_wm, 0);
@ -511,7 +512,6 @@ session_start_fork(int width, int height, int bpp, char *username,
g_cfg->user_wm);
}
}
/* if we're here something happened to g_execlp3
so we try running the default window manager */
g_sprintf(text, "%s/%s", XRDP_CFG_PATH, g_cfg->default_wm);
@ -547,6 +547,13 @@ session_start_fork(int width, int height, int bpp, char *username,
log_message(LOG_LEVEL_DEBUG, "aborting connection...");
g_exit(0);
}
else
{
g_waitpid(pampid);
auth_stop_session(data);
g_exit(0);
}
}
else /* parent (child sesman) */
{
xpid = g_fork();

@ -430,6 +430,14 @@ auth_start_session(void)
return 0;
}
/******************************************************************************/
/* returns error */
int DEFAULT_CC
auth_stop_session(long in_val)
{
return 0;
}
/******************************************************************************/
int DEFAULT_CC
auth_end(void)

@ -201,6 +201,26 @@ auth_start_session(long in_val, int in_display)
return 0;
}
/******************************************************************************/
/* returns error */
int DEFAULT_CC
auth_stop_session(long in_val)
{
struct t_auth_info *auth_info;
int error;
auth_info = (struct t_auth_info *)in_val;
error = pam_close_session(auth_info->ph, 0);
if (error != PAM_SUCCESS)
{
g_printf("pam_close_session failed: %s\r\n",
pam_strerror(auth_info->ph, error));
return 1;
}
auth_info->session_opened = 0;
return 0;
}
/******************************************************************************/
/* returns error */
/* cleanup */

@ -90,6 +90,14 @@ auth_start_session(void)
return 0;
}
/******************************************************************************/
/* returns error */
int DEFAULT_CC
auth_stop_session(long in_val)
{
return 0;
}
/******************************************************************************/
int DEFAULT_CC
auth_end(void)

Loading…
Cancel
Save