diff options
author | jnweiger <jnweiger> | 2005-12-16 18:26:01 +0000 |
---|---|---|
committer | jnweiger <jnweiger> | 2005-12-16 18:26:01 +0000 |
commit | 9131dd54d075ef5e6ec45e6787d083541736b1b2 (patch) | |
tree | 1e667b7237f513290804af8f1c477cb43dad62f3 /src/attacher.c | |
parent | 0e71ff2ef21998e8b999bf725b46b16e5995bf90 (diff) | |
download | screen-9131dd54d075ef5e6ec45e6787d083541736b1b2.tar.gz |
old version screen-3.9.9 May 17 2001
Diffstat (limited to 'src/attacher.c')
-rw-r--r-- | src/attacher.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/attacher.c b/src/attacher.c index 21cf30d..14e59ab 100644 --- a/src/attacher.c +++ b/src/attacher.c @@ -58,6 +58,7 @@ extern struct passwd *ppp; extern char *attach_tty, *attach_term, *LoginName, *preselect; extern int xflag, dflag, rflag, quietflag, adaptflag; extern struct mode attach_Mode; +extern struct NewWindow nwin_options; extern int MasterPid; #ifdef MULTIUSER @@ -141,8 +142,8 @@ int how; if (ret == SIG_POWER_BYE) { int ppid; - setuid(real_uid); setgid(real_gid); + setuid(real_uid); if ((ppid = getppid()) > 1) Kill(ppid, SIGHUP); exit(0); @@ -314,6 +315,7 @@ int how; m.m.attach.lines = atoi(s); if ((s = getenv("COLUMNS"))) m.m.attach.columns = atoi(s); + m.m.attach.utf8 = nwin_options.utf8 == 1; #ifdef MULTIUSER /* setup CONT signal handler to repair the terminal mode */ @@ -350,14 +352,14 @@ int how; #if defined(DEBUG) || !defined(DO_NOT_POLL_MASTER) -static int AttacherPanic; +static int AttacherPanic = 0; #endif #ifdef DEBUG static sigret_t AttacherChld SIGDEFARG { - AttacherPanic=1; + AttacherPanic = 1; SIGRETURN; } #endif @@ -437,12 +439,12 @@ AttacherFinitBye SIGDEFARG if (multiattach) exit(SIG_POWER_BYE); #endif + setgid(real_gid); #ifdef MULTIUSER setuid(own_uid); #else setuid(real_uid); #endif - setgid(real_gid); /* we don't want to disturb init (even if we were root), eh? jw */ if ((ppid = getppid()) > 1) Kill(ppid, SIGHUP); /* carefully say good bye. jw. */ @@ -618,12 +620,12 @@ static sigret_t LockHup SIGDEFARG { int ppid = getppid(); + setgid(real_gid); #ifdef MULTIUSER setuid(own_uid); #else setuid(real_uid); #endif - setgid(real_gid); if (ppid > 1) Kill(ppid, SIGHUP); exit(0); @@ -649,12 +651,12 @@ LockTerminal() if ((pid = fork()) == 0) { /* Child */ + setgid(real_gid); #ifdef MULTIUSER setuid(own_uid); #else setuid(real_uid); /* this should be done already */ #endif - setgid(real_gid); closeallfiles(0); /* important: /etc/shadow may be open */ execl(prg, "SCREEN-LOCK", NULL); exit(errno); |