1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Add a new #define to disable pty_pre_init.

OS X dislikes us calling the setuid or setgid syscalls when not
privileged, even if we try to set ourselves to the _same_ uid/gid.
Since I don't anticipate this code needing to run setuid on OS X, and
since I do anticipate wanting to handle multiple ptys in a single
process so that pty_pre_init would be useless anyway, the simplest fix
seems to me to be just conditioning out the whole of pty_pre_init
completely.
This commit is contained in:
Simon Tatham 2015-08-31 12:51:25 +01:00
parent e5b266a681
commit 1ce27010dd

View File

@ -259,11 +259,13 @@ static void cleanup_utmp(void)
}
#endif
#ifndef NO_PTY_PRE_INIT
static void sigchld_handler(int signum)
{
if (write(pty_signal_pipe[1], "x", 1) <= 0)
/* not much we can do about it */;
}
#endif
#ifndef OMIT_UTMP
static void fatal_sig_handler(int signum)
@ -395,6 +397,8 @@ static void pty_open_master(Pty pty)
*/
void pty_pre_init(void)
{
#ifndef NO_PTY_PRE_INIT
Pty pty;
#ifndef OMIT_UTMP
@ -542,6 +546,9 @@ void pty_pre_init(void)
}
#endif
}
#endif /* NO_PTY_PRE_INIT */
}
int pty_real_select_result(Pty pty, int event, int status)