From owner-freebsd-bugs Tue Oct 1 8:51: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ACFB637B404 for ; Tue, 1 Oct 2002 08:51:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1682B43E42 for ; Tue, 1 Oct 2002 08:51:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g91Fp2Co081334 for ; Tue, 1 Oct 2002 08:51:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g91Fp26h081333; Tue, 1 Oct 2002 08:51:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BBFE337B401 for ; Tue, 1 Oct 2002 08:45:09 -0700 (PDT) Received: from serv1-mk3.ilse.net (serv1-mk3.ilse.nl [62.69.160.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC1EC43E42 for ; Tue, 1 Oct 2002 08:45:07 -0700 (PDT) (envelope-from marcolz@serv1-mk3.ilse.net) Received: (from marcolz@localhost) by serv1-mk3.ilse.net (8.12.5/8.12.5) id g91Fiw0b098987; Tue, 1 Oct 2002 17:44:58 +0200 (CEST) (envelope-from marcolz) Message-Id: <20021001154458.GA98891@ilse.nl> Date: Tue, 1 Oct 2002 17:44:58 +0200 From: Marc Olzheim Reply-To: Marc Olzheim To: FreeBSD-gnats-submit@FreeBSD.org Cc: Bram Avontuur , Marc Olzheim X-Send-Pr-Version: 3.113 Subject: bin/43562: crontab always returns 0. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 43562 >Category: bin >Synopsis: crontab always returns 0. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 01 08:50:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Marc Olzheim >Release: FreeBSD 4.7-RC i386 >Organization: ilse technology >Environment: System: FreeBSD office-install0.ilse.net 4.7-RC FreeBSD 4.7-RC #0: Wed Sep 18 17:24:55 CEST 2002 root@office-install0.ilse.net:/usr/src/sys/compile/Office.new i386 >Description: As you van see in /usr/src/usr.sbin/cron/crontab/crontab.c:125, crontab's exit status is always zero, even if something went wrong in the case of a "replace" command. >How-To-Repeat: echo foo | crontab - >Fix: The code to catch this is already present, but not used... Patch attached. --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="crontab.patch" --- /usr/src/usr.sbin/cron/crontab/crontab.c Sat Jun 16 05:18:37 2001 +++ /usr/src/usr.sbin/cron/crontab/crontab.c Tue Oct 1 17:31:27 2002 @@ -122,7 +122,7 @@ case opt_unknown: break; } - exit(0); + exit(exitstatus); /*NOTREACHED*/ } --J2SCkAp4GZ/dPZZf-- >Release-Note: >Audit-Trail: >Unformatted: --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message