Bug 74261 - /bin/mail will segfault when attempting to send mail to an LDAP user
/bin/mail will segfault when attempting to send mail to an LDAP user
Status: CLOSED DUPLICATE of bug 134837
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: mailx (Show other bugs)
2.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jiri Ryska
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-09-18 16:10 EDT by Mike Gahagan
Modified: 2007-11-30 17:06 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 13:49:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
strace of /bin/mail from cron. (18.13 KB, text/plain)
2002-09-18 16:11 EDT, Mike Gahagan
no flags Details
dump of two straces; one from cron with user in ldap, one from cron with user in local passwd file (25.42 KB, text/plain)
2004-02-27 12:15 EST, Jeremy Smith
no flags Details
nsswitch.conf for which I see this bug (1.90 KB, text/plain)
2004-02-27 12:16 EST, Jeremy Smith
no flags Details
system-auth when I see this bug (1.06 KB, text/plain)
2004-02-27 12:17 EST, Jeremy Smith
no flags Details

  None (edit)
Description Mike Gahagan 2002-09-18 16:10:52 EDT
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):
mailx-8.1.1-22

How Reproducible:
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" ldapuser@domain.com
3. 

Actual Results:

Segfault and no mail is sent.

Expected Results:

Mail should be sent.

Additional Information:
	
see attachment, calling sendmail directory does not exhibit this problem.
Comment 1 Mike Gahagan 2002-09-18 16:11:44 EDT
Created attachment 76551 [details]
strace of /bin/mail from cron.
Comment 2 Mike Gahagan 2002-09-18 16:52:09 EDT
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" user@domain.com
Comment 3 Florian La Roche 2003-01-09 17:01:11 EST
If possible an ltrace output would help identifying where this
bug could be in the source code.

Thanks,

Florian La Roche
Comment 4 Stephen Walton 2004-01-06 13:08:32 EST
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
crontab read:

crontab -l
# 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" user@host.com

and the e-mail contained the following ltrace output:

__libc_start_main(0x08051860, 4, 0xbfeaafd4, 0x080560c8, 0x08056110
<unfinished ...>
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("stephen.walton@csun.edu")                = 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 +++
Comment 5 Jeremy Smith 2004-02-27 12:15:18 EST
Created attachment 98109 [details]
dump of two straces; one from cron with user in ldap, one from cron with user in local passwd file
Comment 6 Jeremy Smith 2004-02-27 12:16:16 EST
Created attachment 98110 [details]
nsswitch.conf for which I see this bug
Comment 7 Jeremy Smith 2004-02-27 12:17:10 EST
Created attachment 98111 [details]
system-auth when I see this bug
Comment 8 Aleksey Nogin 2004-03-09 23:24:42 EST
I also see this on RHL 8. A workaround that WFM is to make sure the
LOGNAME environment variable is set.
Comment 9 Jiri Ryska 2004-11-03 06:58:17 EST

*** This bug has been marked as a duplicate of 134837 ***
Comment 10 Red Hat Bugzilla 2006-02-21 13:49:39 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.