Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 587345 - pam_env cannot change PATH for a cronjob
Summary: pam_env cannot change PATH for a cronjob
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: vixie-cron
Version: 5.5
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Marcela Mašláňová
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-29 16:29 UTC by Martin Poole
Modified: 2018-11-14 19:42 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-14 11:37:22 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Martin Poole 2010-04-29 16:29:42 UTC
Description of problem:

The documentation for vixie-cron is unclear on the precise order in which environment variables are accumulated for jobs, and does not mention that certain variables cannot be set from pam_env.

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

vixie-cron-4.1-77.el5_4.1.src.rpm

Comment 1 Martin Poole 2010-04-29 16:31:07 UTC
For example, from cron(5) man pages (Debian):

 On  the  Debian GNU/Linux system, cron supports the pam_env module,
 and loads the environment specified  by  /etc/security/pam_env.conf.
 How-ever, the PAM setting do NOT override the settings described
 above nor any settings in the crontab file itself. Note in particular
 that if you want a PATH other than "/usr/bin:/bin", you will need to
 set it in the crontab file.

Comment 2 Martin Poole 2010-04-29 16:33:41 UTC
For clarity the following is my analysis of the current environment generation.

For each crontab file it builds a default list of environment variables similar to the following.

SHELL=/bin/sh
HOME=/home/testuser
PATH=/usr/bin:/bin

It then overlays any environment variables declared in the source crontab file and then sets the two explicit values.

LOGNAME=testuser
USER=testuser

When it comes to running a specific job from a particular crontab file it calls the routine to read the pam environment, it then overlays the environment list built for the crontab above, and then when it finally execs the requested binary it provides this environment for the command.

Comment 6 RHEL Program Management 2010-08-09 19:09:09 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 11 RHEL Program Management 2011-05-31 13:17:55 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 12 Marcela Mašláňová 2011-09-14 11:37:22 UTC
I'm not sure if this bug is only about documentation and if it is, what should be changed there. The problem might be fixed by errata for bug #541189.
Feel free to re-open this bug report if you are not satisfied with current release.


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