From owner-freebsd-bugs Thu Sep 28 00:50:03 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id AAA06721 for bugs-outgoing; Thu, 28 Sep 1995 00:50:03 -0700 Received: (from gnats@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id AAA06711 ; Thu, 28 Sep 1995 00:50:02 -0700 Resent-Date: Thu, 28 Sep 1995 00:50:02 -0700 Resent-Message-Id: <199509280750.AAA06711@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, candy@fct.kgc.co.jp Received: from mail0.iij.ad.jp (root@mail0.iij.ad.jp [192.244.176.61]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id AAA06680 for ; Thu, 28 Sep 1995 00:45:30 -0700 Received: from uucp0.iij.ad.jp (uucp0.iij.ad.jp [192.244.176.51]) by mail0.iij.ad.jp (8.6.12+2.4W/3.3W9-MAIL) with ESMTP id QAA22213 for ; Thu, 28 Sep 1995 16:45:18 +0900 Received: (from uucp@localhost) by uucp0.iij.ad.jp (8.6.12+2.4W/3.3W9-UUCP) with UUCP id QAA12883 for FreeBSD-gnats-submit@freebsd.org; Thu, 28 Sep 1995 16:45:17 +0900 Received: from xxx.fct.kgc.co.jp by fender.fct.kgc.co.jp (8.6.12+2.4W/3.4W:95071117) id QAA23568; Thu, 28 Sep 1995 16:31:32 +0900 Received: by xxx.fct.kgc.co.jp (8.6.11/3.3W8:95062916) id QAA03741; Thu, 28 Sep 1995 16:31:30 +0900 Message-Id: <199509280731.QAA03741@xxx.fct.kgc.co.jp> Date: Thu, 28 Sep 1995 16:31:30 +0900 From: Toshihiro Kanda Reply-To: candy@fct.kgc.co.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/751: crontab(1): `crontab -e' exits on SIGINT Sender: owner-bugs@freebsd.org Precedence: bulk >Number: 751 >Category: bin >Synopsis: crontab(1): `crontab -e' exits on SIGINT >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Sep 28 00:50:01 PDT 1995 >Last-Modified: >Originator: Toshihiro Kanda >Organization: candy@fct.kgc.co.jp (Toshihiro Kanda) >Release: FreeBSD 2.0.5-RELEASE i386 >Environment: $ uname -rms FreeBSD 2.0.5-RELEASE i386 >Description: When `crontab -e' invokes vi, ctl-C kills crontab but vi. Then vi is left alone and things go strange. >How-To-Repeat: Assuming /bin/sh syntax oriented shell... $ EDITOR=/usr/bin/vi crontab -e then type ctl-C. >Fix: Crontab exec's ``/bin/sh -c /usr/bin/vi tmp'', and sh seems exit by SIGINT. I wonder if crontab exec's vi directly. At least it seems to fix this problem. *** crontab.c.orig Tue May 30 12:47:04 1995 --- crontab.c Thu Sep 28 16:08:25 1995 *************** *** 404,411 **** --- 404,414 ---- ProgramName); exit(ERROR_EXIT); } + /* sprintf(q, "%s %s", editor, Filename); execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", q, NULL); + */ + execlp(editor, editor, Filename, NULL); perror(editor); exit(ERROR_EXIT); /*NOTREACHED*/ *************** *** 415,421 **** --- 418,433 ---- } /* parent */ + { + void (*f[4])(); + f[0] = signal(SIGHUP, SIG_IGN); + f[1] = signal(SIGINT, SIG_IGN); + f[2] = signal(SIGTERM, SIG_IGN); xpid = wait(&waiter); + signal(SIGHUP, f[0]); + signal(SIGINT, f[1]); + signal(SIGTERM, f[2]); + } if (xpid != pid) { fprintf(stderr, "%s: wrong PID (%d != %d) from \"%s\"\n", ProgramName, xpid, pid, editor); >Audit-Trail: >Unformatted: