1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 22:12:47 -05:00

Fix utmp and pty handling so that GTK never complains about running

set[ug]id. All privs-requiring pty operations are done at the very
start of the run, then privs are dropped before initialising GTK.
Utmp is handled by forking a still-privileged subprocess at this
point, and later asking it (through a pipe) to stamp utmp. The
subprocess cleans up utmp on exit, which has the additional
advantage that if the main pterm process suffers some sort of
unexpected termination (up to and including SIGKILL) the subprocess
can still mop up utmp.

[originally from svn r2082]
This commit is contained in:
Simon Tatham
2002-10-16 12:17:51 +00:00
parent a24d9d3029
commit 1aed45b4e1
2 changed files with 210 additions and 102 deletions

View File

@ -1585,8 +1585,11 @@ int main(int argc, char **argv)
{
extern int pty_master_fd; /* declared in pty.c */
extern char **pty_argv; /* declared in pty.c */
extern void pty_pre_init(void); /* declared in pty.c */
int err = 0;
pty_pre_init();
gtk_init(&argc, &argv);
do_defaults(NULL, &cfg);