Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 155122 - /bin/mail run from within a cronjob fails if nscd is not running and nss_ldap is used
Summary: /bin/mail run from within a cronjob fails if nscd is not running and nss_ldap...
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mailx
Version: 4.0
Hardware: i686
OS: Linux
Target Milestone: ---
: ---
Assignee: Ivana Varekova
QA Contact:
Depends On:
Blocks: 187538
TreeView+ depends on / blocked
Reported: 2005-04-16 17:24 UTC by Jay Turner
Modified: 2015-01-08 00:09 UTC (History)
7 users (show)

Fixed In Version: RHBA-2006-0317
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-05-17 20:08:02 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0317 normal SHIPPED_LIVE mailx bug fix update 2006-05-17 04:00:00 UTC

Description Jay Turner 2005-04-16 17:24:52 UTC
+++ This bug was initially created as a clone of Bug #142860 +++

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3)

Description of problem:
If crond runs a shell script (using any shell and as any user) and the
shell script calls /bin/mail while nscd is not running (ldap is used
here for auth and user lookup) /bin/mail will segfault.  Delivery by
command line is still OK (environment issue?).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Setup host to authenticate and perform user lookups via LDAP with
ssl start_tls and to cache requests using auth_config
2. setup a cron job that executes the attached script (calls /bin/mail)
3. stop nscd
4. run cron job again and /bin/mail will segfault.
5. start nscd
6. script will run properly
7. repeat steps 3 to 6 until unamused.

Actual Results:  /bin/mail segfaults.  Setting ulimit -c unlimited in
the script before the call to /bin/mail will cause a core dump.

Expected Results:  /bin/mail does not segfault but instead actually
sends mail...

Additional info:

This could be within /bin/mail but somehow I don't think that it is,
the circumstances are far too specific to be a /bin/mail problem. 
Also, you can run this from the command line and it will NOT segfault.
 This causes data that should explictly be sent to a person to not be,
then at that point data is lost.

This script is as simple as
ulimit -c unlimited
echo "This is a test" > tmp.msg
/bin/mail -s "Testing" youremail@yourdomain.tld < tmp.msg
rm -f tmp.msg

Run this script from cron with the appropriate LDAP settings as above.  

Attached are the back trace from a core dump from RHEL 2.1 AS, RHEL 3
WS, and our /etc/ldap.conf.

Comment 2 Ken Reilly 2005-06-20 20:01:31 UTC
Moved to RHEL4U2Proposed tracker, from the RHEL3U6Proposed, based on Karel's
status in Comment #1. 

Ken Reilly

Comment 17 Red Hat Bugzilla 2006-05-17 20:08:02 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

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