Bug 74261

Summary: /bin/mail will segfault when attempting to send mail to an LDAP user
Product: Red Hat Enterprise Linux 2.1 Reporter: Mike Gahagan <mgahagan>
Component: mailxAssignee: Jiri Ryska <jryska>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1CC: aleksey, stephen.walton, tao
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 18:49:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
strace of /bin/mail from cron.
none
dump of two straces; one from cron with user in ldap, one from cron with user in local passwd file
none
nsswitch.conf for which I see this bug
none
system-auth when I see this bug none

Description Mike Gahagan 2002-09-18 20:10:52 UTC
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
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 20:11:44 UTC
Created attachment 76551 [details]
strace of /bin/mail from cron.

Comment 2 Mike Gahagan 2002-09-18 20:52:09 UTC
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

Comment 3 Florian La Roche 2003-01-09 22:01:11 UTC
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 18:08:32 UTC
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

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")                = 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 17:15:18 UTC
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 17:16:16 UTC
Created attachment 98110 [details]
nsswitch.conf for which I see this bug

Comment 7 Jeremy Smith 2004-02-27 17:17:10 UTC
Created attachment 98111 [details]
system-auth when I see this bug

Comment 8 Aleksey Nogin 2004-03-10 04:24:42 UTC
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 11:58:17 UTC

*** This bug has been marked as a duplicate of 134837 ***

Comment 10 Red Hat Bugzilla 2006-02-21 18:49:39 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.