Bug 112430 - RHEL3: at fails unless sh compatible shell is users default (eg csh/tcsh)
RHEL3: at fails unless sh compatible shell is users default (eg csh/tcsh)
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: at (Show other bugs)
3.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
Mike McLean
:
: 121976 (view as bug list)
Depends On:
Blocks: 107563
  Show dependency treegraph
 
Reported: 2003-12-19 11:48 EST by Need Real Name
Modified: 2007-11-30 17:06 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-05-11 23:50:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2003-12-19 11:48:25 EST
Description of problem:

 There appears to be a bug in the new handling of the shell. I am 
used to at always using sh - which has never been a problem - but now 
according to man page at uses:
"the shell set by the user's environment variable SHELL or /bin/sh."

The effect of the SHELL setting is the shebang in the script that is 
to be executed. However, the environment settings for that script 
ALWAYS use sh-style export commands. These fail on other shells such 
as csh and tcsh. As such, a csh/tcsh user cannot run ANY at jobs. A 
workaround is to set the SHELL environment variable to /bin/sh.

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

How reproducible:
100 %

Steps to Reproduce:
1.Create a user with csh as their shell
2.Run: "echo 'ls > /tmp/file' | at now + 1 minute"
  
Actual results:
due to the file redirection differences it creates a file called "2" 
with the contents:
Execution directory inaccessible

It also sends mail to the user with lines like:
HOME=/home/myuser: Command not found.
export: Command not found. 

Expected results:
A directory listing in /tmp/file

Additional info:
The user's shell appears to change only the shebang in the created 
script. No matter what the shell settings, at creates a script with 
sh-style export commands. For example, a csh user gets the following 
script that will not work:
#!/bin/csh
# atrun uid=20073 gid=20073
# mail      ajm 0
umask 2
HOME=/home/myuser; export HOME
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin; 
export PATH
MAIL=/var/mail/myuser; export MAIL
LOGNAME=myuser; export LOGNAME
HOSTTYPE=i386-linux; export HOSTTYPE
VENDOR=intel; export VENDOR
OSTYPE=linux; export OSTYPE
MACHTYPE=i386; export MACHTYPE
SHLVL=1; export SHLVL
PWD=/home/myuser; export PWD
USER=myuser; export USER
HOST=myhost; export HOST
LS_COLORS=no=00:fi=00:di=00\;34:ln=00\;36:pi=40\;33:so=00\;35:bd=40
\;33\;01:cd=40\;33\;01:or=01\;05\;37\;41:mi=01\;05\;37\;41:ex=00
\;32:\*.cmd=00\;32:\*.exe=00\;32:\*.com=00\;32:\*.btm=00\;32:\*.bat=00
\;32:\*.sh=00\;32:\*.csh=00\;32:\*.tar=00\;31:\*.tgz=00\;31:\*.arj=00
\;31:\*.taz=00\;31:\*.lzh=00\;31:\*.zip=00\;31:\*.z=00\;31:\*.Z=00
\;31:\*.gz=00\;31:\*.bz2=00\;31:\*.bz=00\;31:\*.tz=00\;31:\*.rpm=00
\;31:\*.cpio=00\;31:\*.jpg=00\;35:\*.gif=00\;35:\*.bmp=00
\;35:\*.xbm=00\;35:\*.xpm=00\;35:\*.png=00\;35:\*.tif=00\;35:; export 
LS_COLORS
G_BROKEN_FILENAMES=1; export G_BROKEN_FILENAMES
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass; export SSH_ASKPASS
LANG=en_US.UTF-8; export LANG
SUPPORTED=en_US.UTF-8:en_US:en; export SUPPORTED
LESSOPEN=\|/usr/bin/lesspipe.sh\ %s; export LESSOPEN
LANGVAR=en_US.UTF-8; export LANGVAR
QTDIR=/usr/lib/qt-3.1; export QTDIR
HOSTNAME=myhost; export HOSTNAME
cd /home/myuser || {
	 echo 'Execution directory inaccessible' >&2
	 exit 1
}
ls > /tmp/file

Note: I have access to only one WS3 machine for testing, though this 
is AFAIK an OOB installation. I have also tested on RH9 with at-3.1.8-
33 and this worked OK.
Comment 1 Jens Petersen 2004-01-12 23:10:08 EST
Btw a fix for this is currently in FC Devel.
Comment 3 Jens Petersen 2004-03-10 12:41:11 EST
at-3.1.8-47.ent (based on -51) built to address this.
Comment 4 Thomas J. Baker 2004-04-02 16:25:46 EST
Where is the at-3.1.8-47.ent version available? My systems are up to
date but at-3.1.8-46 is what's installed.
Comment 5 Jens Petersen 2004-04-02 20:36:39 EST
It isn't available yet, but will be in the next RHEL 3 update
hopefully.
Comment 6 Thomas J. Baker 2004-04-05 16:10:07 EDT
Could you make the srpm available so I can address the issue now?
Comment 7 Jens Petersen 2004-04-05 19:20:18 EDT
It is essentially what is in FC devel (rawhide) currently:

http://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/at-3.1.8-50.src.rpm

so please try that, thanks.
Comment 8 Jens Petersen 2004-04-30 00:15:52 EDT
*** Bug 121976 has been marked as a duplicate of this bug. ***
Comment 9 John Flanagan 2004-05-11 23:50:43 EDT
An errata 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.

http://rhn.redhat.com/errata/RHBA-2004-132.html
Comment 10 John Flanagan 2004-12-21 16:19:56 EST
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.

http://rhn.redhat.com/errata/RHBA-2004-593.html

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