Re: Email sent from "at" command going to the wrong account

Previous thread: panic: semexit - semid not allocated in FreeBSD 6.3 by Ibrahim Harrani on Monday, December 14, 2009 - 1:02 am. (1 message)

Next thread: 8.0-RELEASE-p1 Panic "panic: sbdrop" by Linda Messerschmidt on Tuesday, December 15, 2009 - 12:40 pm. (4 messages)
From: Holger Kunst
Date: Monday, December 14, 2009 - 8:47 am

Hi,

The "at" command sends an email with the output of the scheduled job. 
I've experienced inconsistent results when running jobs, receiving 
emails in accounts not associated with the user currently logged in.

To reproduce in FreeBSD 7.2-RELEASE-p2

Case #1
login as user a (new shell through ssh)
echo "echo 1" | at now
--> user a will receive an email containing "1" - this is as expected

Case #2
login as user a (new shell through ssh)
login as user b
exit
echo "echo 1" | at now
--> user b will receive an email containing "1" - this is not as 
expected, since I am user a again

A look at the source for "at" reveals that "at" is getting the mailname 
from getlogin(). Running a small test program that outputs getlogin(), 
confirms the above behavior: A log-in and out of another account makes 
getlogin() return that account's name, even though the shell has been 
closed and we are back to the original shell and the original user a.

Is this the intended behavior? Any hints would be appreciated.

Best regards,

Holger Kunst




_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
From: Nate Eldredge
Date: Monday, December 14, 2009 - 10:20 am

-- 

Nate Eldredge
nate@thatsmathematics.com
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
From: Holger Kunst
Date: Tuesday, December 15, 2009 - 2:20 pm

Nate,

Thank you for your reply,

login command from the shell: "login b", enter password

Best regards,

Holger
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
From: Eugene Grosbein
Date: Tuesday, December 15, 2009 - 11:13 pm

This is known long-standing bug. FreeBSD-4.9 was affected (may be earlier)
and all versions after it:

http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/61355

The PR has some kind of patch in the Audit-Trail.

Eugene Grosbein
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Previous thread: panic: semexit - semid not allocated in FreeBSD 6.3 by Ibrahim Harrani on Monday, December 14, 2009 - 1:02 am. (1 message)

Next thread: 8.0-RELEASE-p1 Panic "panic: sbdrop" by Linda Messerschmidt on Tuesday, December 15, 2009 - 12:40 pm. (4 messages)