Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Feb 1997 19:22:48 -0800 (PST)
From:      mark thompson <thompson@tgsoft.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/2747: at cannot be run in an atjob
Message-ID:  <199702160322.TAA15126@squirrel.tgsoft.com>
Resent-Message-ID: <199702160330.TAA09340@freefall.freebsd.org>

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

>Number:         2747
>Category:       bin
>Synopsis:       cannot submit at jobs from within an at job
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 15 19:30:02 PST 1997
>Last-Modified:
>Originator:     mark thompson
>Organization:
T & G Software <tgsoft>
>Release:        FreeBSD 2.2
>Environment:
2.1.x and 2.2
>Description:

You cannot submit an at job from within an at job, since the submitted
job will have the wrong mail address, and atrun will reject it. The
comments suggest that the code in question (see below) is a hangover
from an earlier day, and no longer appropriate.

>How-To-Repeat:

Have an at job that submits itself. Run the at job as someone other
than root. The submitted job will not run.

>Fix:
	
--- at.c	Mon Oct 23 22:09:54 1995
+++ at.c.new	Sat Feb 15 19:15:28 1997
@@ -298,12 +298,9 @@
     if((fp = fdopen(fdes, "w")) == NULL)
 	panic("Cannot reopen atjob file");
 
-    /* Get the userid to mail to, first by trying getlogin(), which reads
-     * /etc/utmp, then from LOGNAME, finally from getpwuid().
+    /* Get the userid to mail to, first by LOGNAME, then from getpwuid().
      */
-    mailname = getlogin();
-    if (mailname == NULL)
-	mailname = getenv("LOGNAME");
+    mailname = getenv("LOGNAME");
 
     if ((mailname == NULL) || (mailname[0] == '\0') 
 	|| (strlen(mailname) > 8) || (getpwnam(mailname)==NULL))
>Audit-Trail:
>Unformatted:



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