Red Hat Bugzilla – Bug 74261
/bin/mail will segfault when attempting to send mail to an LDAP user
Last modified: 2007-11-30 17:06:52 EST
Description of Problem:
If a user account is defined in an LDAP directory, and you have cronjob which
calls /bin/mail to send mail to that user. mail will segfault (see strace)
user local to the machine are not affected.
Version-Release number of selected component (if applicable):
always, but only in a cronjob
Steps to Reproduce:
1. send mail to an ldap user from cron. such as:
2. */1 **** username /bin/mail -s "testing" email@example.com
Segfault and no mail is sent.
Mail should be sent.
see attachment, calling sendmail directory does not exhibit this problem.
Created attachment 76551 [details]
strace of /bin/mail from cron.
Slight mistake on my part above:
The segv occurs when sending mail as an ldap user, It makes no difference who
the mail goes to. The example cron should be:
*/1 **** ldapuser /bin/mail -s "testing" firstname.lastname@example.org
If possible an ltrace output would help identifying where this
bug could be in the source code.
Florian La Roche
This is an old bug report, but I'm trying to resurrect it because the
bug still exists in Fedora Core 1 (and may be related to the failure
of 'at' to send e-mail to an LDAP user at all). The LDAP user's
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.8320 installed on Tue Jan 6 10:04:55 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
*/1 * * * * ltrace /bin/mail -s "testing" email@example.com
and the e-mail contained the following ltrace output:
__libc_start_main(0x08051860, 4, 0xbfeaafd4, 0x080560c8, 0x08056110
getegid() = 500
getgid() = 500
setgid(500) = 0
signal(17, 0x08053370) = NULL
isatty(0) = 0
getopt(4, 0xbfeaafd4, "INT:b:c:dfins:u:v") = 115
getopt(4, 0xbfeaafd4, "INT:b:c:dfins:u:v") = -1
malloc(128) = 0x081d7008
strlen("firstname.lastname@example.org") = 23
bcopy(0xbff9ef6a, 0x081d7018, 24) = <void>
getenv("TMPDIR") = NULL
tempnam("/tmp/", "Rs") = "/tmp/Rs7WNhOV"
tempnam("/tmp/", "Rq") = "/tmp/Rq05sBfz"
tempnam("/tmp/", "Rm") = "/tmp/Rm1OxWGc"
tempnam("/tmp/", "Re") = "/tmp/ReEzTi8P"
tempnam("/tmp/", "Rx") = "/tmp/RxNWEGzt"
getenv("USER") = NULL
getuid() = 505
getpwuid(505, 0x002a4e0f, 0xbfeaae68, 0x0804f89f, 505 <unfinished ...>
fflush(0) = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
Created attachment 98109 [details]
dump of two straces; one from cron with user in ldap, one from cron with user in local passwd file
Created attachment 98110 [details]
nsswitch.conf for which I see this bug
Created attachment 98111 [details]
system-auth when I see this bug
I also see this on RHL 8. A workaround that WFM is to make sure the
LOGNAME environment variable is set.
*** This bug has been marked as a duplicate of 134837 ***
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.