From: Sam Hartman Date: Mon, 15 Apr 1996 07:13:29 +0000 (+0000) Subject: Remove setpgrp() call from krlogind X-Git-Tag: krb5-1.0-beta6~206 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=979c2a05adac56aaf0c19b34337e745795a52d97;p=krb5.git Remove setpgrp() call from krlogind as libpty deals. Use setsid() instead of setpgrp() in krshd if possible. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7812 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index bb3b6d392..2a94ea0f2 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,16 @@ +Sun Apr 14 03:41:49 1996 Sam Hartman + + * krlogind.c (fatalperror): Only declar sys_errlist if needed. + + +Sat Apr 13 17:47:36 1996 Sam Hartman + + * krshd.c (doit): Use setsid instead of setpgrp if you have it. + Note this doesn't work for Ultrix. + + * krlogind.c (doit): Don't call setpgrp or setsid; let pty library do + that for us. + Fri Apr 12 23:38:25 1996 Richard Basch * krlogind.c (cleanup): Destroy any forwarded credentials at the diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c index 6551192a3..0615151eb 100644 --- a/src/appl/bsd/krlogind.c +++ b/src/appl/bsd/krlogind.c @@ -181,9 +181,6 @@ char copyright[] = #include #endif -#ifndef SETPGRP_TWOARG -#define setpgrp(a,b) setpgrp() -#endif #ifndef HAVE_KILLPG #define killpg(pid, sig) kill(-(pid), (sig)) @@ -789,11 +786,6 @@ int syncpipe[2]; signal(SIGTSTP, SIG_IGN); #endif -#ifdef hpux - setpgrp2(0, 0); -#else - setpgrp(0, 0); -#endif #ifdef DO_NOT_USE_K_LOGIN /* Pass down rusername and lusername to login. */ @@ -1046,9 +1038,10 @@ void fatalperror(f, msg) char *msg; { char buf[512]; +#ifdef NEED_SYS_ERRLIST extern int sys_nerr; extern char *sys_errlist[]; - +#endif if ((unsigned)errno < sys_nerr) (void) sprintf(buf, "%s: %s", msg, sys_errlist[errno]); else diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c index e4073bfdd..36223c640 100644 --- a/src/appl/bsd/krshd.c +++ b/src/appl/bsd/krshd.c @@ -1230,11 +1230,15 @@ if (ccache) exit(0); } +#if defined(HAVE_SETSID)&&(!defined(ULTRIX)) + setsid(); +#else #ifdef SETPGRP_TWOARG setpgrp(0, getpid()); #else setpgrp(); -#endif +#endif /*setpgrp_twoarg*/ +#endif /*HAVE_SETSID*/ (void) close(s); (void) close(f); (void) close(pw[0]);