Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Oct 2002 17:44:58 +0200
From:      Marc Olzheim <marcolz@ilse.nl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Bram Avontuur <brama@ilse.nl>, Marc Olzheim <marcolz@ilse.nl>
Subject:   bin/43562: crontab always returns 0.
Message-ID:  <20021001154458.GA98891@ilse.nl>

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

>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




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