Subject: bin/3025: cron can't stat tab directory
To: None <gnats-bugs@gnats.netbsd.org>
From: Tatoku Ogaito <tacha@tera.fukui-med.ac.jp>
List: netbsd-bugs
Date: 12/12/1996 10:27:58
>Number:         3025
>Category:       bin
>Synopsis:       cron can't stat tab directory
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 13 17:20:01 1996
>Last-Modified:
>Originator:     Tatoku Ogaito
>Organization:
-----            : Tatoku Ogaito
   / _  _ _/ _   : Dept. Phys, Fukui Medical School
  / (_|(_ /)(_|  : E-mail: tacha@tera.fukui-med.ac.jp
>Release:        Current as of Dec. 10, 1996
>Environment:
	
System: NetBSD tera.fukui-med.ac.jp 1.2B NetBSD 1.2B (TERA) #34: Mon Dec 2 18:59:56 JST 1996 root@tera.fukui-med.ac.jp:/usr/current/src/sys/arch/i386/compile/TERA i386


>Description:
	daemon function with first argment equal to 0 makes
to change working directory to /, so cron can't read its spool directory.

>How-To-Repeat:
	run cron and see /var/cron/log.
>Fix:
*** ./usr.sbin/cron/cron.c.orig	Mon Dec  9 21:23:40 1996
--- ./usr.sbin/cron/cron.c	Thu Dec 12 10:24:47 1996
***************
*** 91,97 ****
  # endif
  		(void) fprintf(stderr, "[%d] cron started\n", getpid());
  	} else {
! 		if (daemon(0, 0)) {
  			log_it("CRON",getpid(),"DEATH","can't fork");
  			exit(1);
  		}
--- 91,97 ----
  # endif
  		(void) fprintf(stderr, "[%d] cron started\n", getpid());
  	} else {
! 		if (daemon(1, 0)) {
  			log_it("CRON",getpid(),"DEATH","can't fork");
  			exit(1);
  		}
	
>Audit-Trail:
>Unformatted: