sesman: remove unnecessary fork for FreeBSD (#650)
it is not only unnecessary but causes another bug.
This commit is contained in:
parent
6257bae23f
commit
cc48345f40
@ -513,32 +513,23 @@ session_start_fork(tbus data, tui8 type, struct SCP_SESSION *s)
|
|||||||
* $OpenBSD: session.c,v 1.252 2010/03/07 11:57:13 dtucker Exp $
|
* $OpenBSD: session.c,v 1.252 2010/03/07 11:57:13 dtucker Exp $
|
||||||
* with some ideas about BSD process grouping to xrdp
|
* with some ideas about BSD process grouping to xrdp
|
||||||
*/
|
*/
|
||||||
pid_t bsdsespid = g_fork();
|
|
||||||
|
|
||||||
if (bsdsespid == -1)
|
/**
|
||||||
|
* Create a new session and process group since the 4.4BSD
|
||||||
|
* setlogin() affects the entire process group
|
||||||
|
*/
|
||||||
|
if (g_setsid() < 0)
|
||||||
{
|
{
|
||||||
}
|
log_message(LOG_LEVEL_ERROR,
|
||||||
else if (bsdsespid == 0) /* BSD session leader */
|
"setsid failed - pid %d", g_getpid());
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Create a new session and process group since the 4.4BSD
|
|
||||||
* setlogin() affects the entire process group
|
|
||||||
*/
|
|
||||||
if (g_setsid() < 0)
|
|
||||||
{
|
|
||||||
log_message(LOG_LEVEL_ERROR,
|
|
||||||
"setsid failed - pid %d", g_getpid());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_setlogin(s->username) < 0)
|
|
||||||
{
|
|
||||||
log_message(LOG_LEVEL_ERROR,
|
|
||||||
"setlogin failed for user %s - pid %d", s->username,
|
|
||||||
g_getpid());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_waitpid(bsdsespid);
|
if (g_setlogin(s->username) < 0)
|
||||||
|
{
|
||||||
|
log_message(LOG_LEVEL_ERROR,
|
||||||
|
"setlogin failed for user %s - pid %d", s->username,
|
||||||
|
g_getpid());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
wmpid = g_fork(); /* parent becomes X,
|
wmpid = g_fork(); /* parent becomes X,
|
||||||
child forks wm, and waits, todo */
|
child forks wm, and waits, todo */
|
||||||
|
Loading…
Reference in New Issue
Block a user