Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jun 2002 17:01:30 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Alexander Kabaev <kabaev@bellatlantic.net>, Dag-Erling Smorgrav <des@ifi.uio.no>
Cc:        current@FreeBSD.ORG
Subject:   Re: su gets SIGHUP randomly on startup with latest current
Message-ID:  <200206260001.g5Q01U3s002621@apollo.backplane.com>
References:  <20020625071455.GA42940@calvin.in.ibm.com> <20020625081225.GC21301@CPE0030ab0ef2bb.cpe.net.cable.rogers.com> <3D18CE39.CC63442E@mindspring.com> <200206252327.g5PNR05U051967@apollo.backplane.com> <20020625195243.6a655c8a.kabaev@bellatlantic.net>

next in thread | previous in thread | raw e-mail | index | archive | help

:Matt,
:
:the problem is not new. Dag-Erling committed su.c rev 1.51 to fix the
:problem with su taking signals instead of its children and his fix has
:this unfortunate side effect you are seeing.
:
:I proposed a different patch, which does not have unwanted side-effects
:and which I am using for at leat one year now. Please see
:current@freebsd.org archives for a thread 
:"zsh exits upon ^C after su'ing to root with zsh as its shell". It took
:place somewhen at the end of the May.

    I'm afraid whatever DES did it aggravated the problem.  When I #if 0
    out his last commit 'su' stops doing the HUP thing.  So there's
    obviously a race there that the commit didn't fix (or maybe it fixed
    one race and aggravated another?)  DES?

						-Matt

Index: su.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/su/su.c,v
retrieving revision 1.51
diff -u -r1.51 su.c
--- su.c	29 May 2002 03:32:17 -0000	1.51
+++ su.c	25 Jun 2002 23:58:45 -0000
@@ -319,8 +319,10 @@
 	child_pid = fork();
 	switch (child_pid) {
 	default:
+#if 0
 		setpgid(child_pid, child_pid);
 		tcsetpgrp(1, child_pid);
+#endif
 		while ((ret_pid = waitpid(child_pid, &statusp, WUNTRACED)) != -1) {
 			if (WIFSTOPPED(statusp)) {
 				child_pgrp = tcgetpgrp(1);

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206260001.g5Q01U3s002621>