Bug 62537 - /etc/profile.d/mc.sh print the mc function when logging
Summary: /etc/profile.d/mc.sh print the mc function when logging
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: mc   
(Show other bugs)
Version: skipjack-beta1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Havoc Pennington
QA Contact: Aaron Brown
Depends On:
TreeView+ depends on / blocked
Reported: 2002-04-02 09:05 UTC by Dams
Modified: 2007-04-18 16:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-04-05 20:44:16 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Dams 2002-04-02 09:05:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020312

Description of problem:

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

How reproducible:

Steps to Reproduce:
1. useradd -s /bin/zsh user
2. ssh user@localhost


Actual Results:  [root@confiote ~]# ssh anvil@gruyere
anvil@gruyere's password:
Last login: Mon Apr  1 22:01:40 2002
mc () { 
        mkdir -p $HOME/.mc/tmp 2> /dev/null
        chmod 700 $HOME/.mc/tmp
        /usr/bin/mc -P "$@" > "$MC"
        cd "`cat $MC`"
        /bin/rm -f "$MC"
        unset MC
[anvil@gruyere ~]# 

Expected Results:  Should not see the mc function.

Additional info:

If you want to test with my zsh configuration you can download it at :

Comment 1 Anders Hermansen 2002-04-02 12:43:34 UTC
I also see this problem using zsh. My solutions was to remove the mc packages.

Comment 2 Jay Berkenbilt 2002-04-05 20:44:09 UTC
Removing the mc package is clearly not the "Right" fix here....  The problem is
that mc.sh uses export -f to export the shell function into the environment. 
zsh's export doesn't support this, even if you wrap invocation of
/etc/profile.d/*.sh in emulate bash.  Perhaps that's a zsh bug.

As it is extremely unlikely that anyone with zsh as a login shell actually uses
mc, I'd suggest the workaround of not invoking export -f mc if $SHELL is not
/bin/bash (or, alternatively, if $SHELL is /bin/zsh, but I think the former is
preferable since most users who are sophisticated enough to change their shell
won't use a file manager and just checking for /bin/zsh may still leave this
problem around for some users with other bourne-shell like shells that aren't bash).

Another possible solution would be to somehow get zsh to deal with export -f,
but as far as I can tell, zsh doesn't have any facility for exporting shell
functions into the environment.  (It has shell function autoloading, etc.)

Comment 3 Havoc Pennington 2002-04-10 15:32:54 UTC
This is fixed in latest mc 4.5.55-3

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