From marcolz@serv1-mk3.ilse.net  Tue Oct  1 08:45:09 2002
Return-Path: <marcolz@serv1-mk3.ilse.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BBFE337B401
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <marcolz@ilse.nl>
Reply-To: Marc Olzheim <marcolz@ilse.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Bram Avontuur <brama@ilse.nl>, Marc Olzheim <marcolz@ilse.nl>
Subject: crontab always returns 0.
X-Send-Pr-Version: 3.113

>Number:         43562
>Category:       bin
>Synopsis:       crontab always returns 0.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 01 08:50:02 PDT 2002
>Closed-Date:    Tue Oct 01 15:59:33 PDT 2002
>Last-Modified:  Tue Oct 01 15:59:33 PDT 2002
>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:
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Tue Oct 1 15:59:18 PDT 2002 
State-Changed-Why:  
Committed, thanks.  I'll MFC this after the release. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43562 
>Unformatted:
 --J2SCkAp4GZ/dPZZf
 Content-Type: text/plain; charset=iso-8859-1
 Content-Disposition: inline
 
 
