This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 498625 - [RHEL5.3] tcsh globbing causing bad automount
[RHEL5.3] tcsh globbing causing bad automount
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: tcsh (Show other bugs)
5.3
All Linux
urgent Severity urgent
: rc
: ---
Assigned To: Vitezslav Crhonek
BaseOS QE
: ZStream
Depends On:
Blocks: 499522 526459
  Show dependency treegraph
 
Reported: 2009-05-01 10:59 EDT by Issue Tracker
Modified: 2016-03-07 09:55 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-30 03:58:45 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)
proposed patch for tcsh-6.14.00 (4.39 KB, patch)
2009-06-24 08:59 EDT, Vitezslav Crhonek
no flags Details | Diff

  None (edit)
Description Issue Tracker 2009-05-01 10:59:44 EDT
Escalated to Bugzilla from IssueTracker
Comment 1 Issue Tracker 2009-05-01 10:59:45 EDT
Description of problem:

when running tcsh globbing causes failed automounts.



How reproducible:

/bin/tcsh
cd /home

echo FAILURES *

you'll see syslog entries like:
Aug 18 09:58:24 archangel automount[19211]: failed to mount /home/FAILURE5


Steps to Reproduce:

see above

Actual results:

mount attempts that fail

Expected results:

No mount attempts

Additional info:

bash works as expected

This event sent from IssueTracker by mmatsuya  [SEG - Base OS]
 issue 291117
Comment 2 Issue Tracker 2009-05-01 10:59:47 EDT
cwyse@buffalo [:/home] % echo FAILURES *                            
[11:44:03]
FAILURES cwyse oracle
cwyse@buffalo [:/home] % grep FAILURE /var/log/messages             
[11:44:05]
Apr 29 11:44:05 buffalo automount[3174]: attempting to mount entry
/home/FAILURES
Apr 29 11:44:05 buffalo automount[3174]: >> mount:
castor:/vol/rwc07/home/FAILURES failed, reason given by server: Permission
denied
Apr 29 11:44:05 buffalo automount[3174]: mount(nfs): nfs: mount failure
castor:/vol/rwc07/home/FAILURES on /home/FAILURES
Apr 29 11:44:05 buffalo automount[3174]: failed to mount /home/FAILURES

This is what it looks like when we run the echo command in RHEL5.3. 
Please escalate to engineering.

cwyse assigned to issue for DreamWorks Animation.
Status set to: Waiting on Tech
Version set to: '2.1'

This event sent from IssueTracker by mmatsuya  [SEG - Base OS]
 issue 291117
Comment 3 Issue Tracker 2009-05-01 10:59:48 EDT
General Escalation Information
State the problem

1. Provide time and date of the problem

  N/A - Reproducible and ongoing.

2. Indicate the platform(s) (architectures) the problem is being
  reported against.

  x86_64

3. Provide clear and concise problem description as it is understood
  at the time of escalation
  * Observed behavior

    As stated by the customer, "tcsh globbing causes failed
    automounts."

    When using tcsh as a shell, running a command like "echo FAIL *"
    while the working directory the root of a wildcard automount
    directory will produce lots of invalid automount attempts.
    
    repo:
    /bin/tcsh
    cd /home

    echo FAILURES *

    you'll see syslog entries like:
    Aug 18 09:58:24 archangel automount[19211]: failed to mount
/home/FAILURE5

  * Desired behavior

    No automount attempts or failures.

4. State specific action requested of SEG

  Analyze and patch.

5. State whether or not a defect in the product is suspected

A defect is suspected.  This is happening on RHEL4 and RHEL5.
Here is the BZ for the RHEL 4 issue.
https://bugzilla.redhat.com/show_bug.cgi?id=466204

6. If there is a proposed patch, make sure it is in unified diff
  format (diff -pruN)

Not that I am aware of.  

7. Refrain from using the word "hang", as it can mean different things
  to different people in different contexts. Use a better and more
  specific description of your problem.

tcsh globbing causes failed automounts.

8. This is especially important for severity one and two issues. What
  is the impact to the customer when they experience this problem?

  DreamWorks systems use the automounter extensively, and this is
  causing additional automount traffic that just adds to the overall
  load on their systems.



Issue escalated to Support Engineering Group by: spurrier.
Internal Status set to 'Waiting on SEG'

This event sent from IssueTracker by mmatsuya  [SEG - Base OS]
 issue 291117
Comment 4 Issue Tracker 2009-05-01 10:59:49 EDT
xecho() in sh.func.c.

1180        gflag = 0, tglob(v);
1181        if (gflag) {
1182            v = globall(v);
1183            if (v == 0)
1184                stderror(ERR_NAME | ERR_NOMATCH);
1185        }
1186        else {
1187            v = gargv = saveblk(v);
1188            trim(v);
1189        }

When one of the arguments of 'echo' includes glob, 1 is set to gflag in
tglob() at line 1180.
Otherwise, 0 is set to gflag in tglob().

When gflag is 1, globall(v) is executed at line 1182. globall() calls
libglob().
libglob() calls glob() per word in arguments. glob is expanded in the
functions called from glob().

When "echo FAILURES *" is executed, 1 is set to gflag in tglob() of line
1180 in xecho(). As the result, globall() is called at line 1182. globall()
calls libglob(), and it calls glob() for 'echo', 'FAILURES' and '*'.


libglob()

493     do {
494         ptr = short2qstr(*vl);
495         switch (glob(ptr, gflgs, 0, &globv)) {


I think that 'ptr' should be checked if it includes glob char, and
glob() should be called only if there is. glob() should not be called for
'FAILURES'. I think.




This event sent from IssueTracker by mmatsuya  [SEG - Base OS]
 issue 291117
Comment 9 Vitezslav Crhonek 2009-06-24 08:59:20 EDT
Created attachment 349233 [details]
proposed patch for tcsh-6.14.00

Proposed patch. Slightly tested and worked fine.
Comment 10 Issue Tracker 2009-06-24 14:30:04 EDT
Event posted on 06-24-2009 02:30pm EDT by cwyse

Jun 24 11:39:41 batman automount[3481]: attempting to mount entry
/home/--color=tty
Jun 24 11:39:41 batman automount[3481]: failed to mount /home/--color=tty
Jun 24 11:39:41 batman automount[3481]: attempting to mount entry
/home/FAILURE
Jun 24 11:39:41 batman automount[3481]: failed to mount /home/FAILURE
Jun 24 11:39:41 batman automount[3481]: attempting to mount entry
/home/FAILURE
Jun 24 11:39:41 batman automount[3481]: failed to mount /home/FAILURE
Jun 24 11:39:41 batman automount[3481]: attempting to mount entry
/home/FAILURE
Jun 24 11:39:41 batman automount[3481]: failed to mount /home/FAILURE

This patch didn't seem to do much.  Also, tcsh --version shows some
pretty old info.  I tried to update the patchlevel.h file but that didn't
seem to help.  Not really related to this bug, just pointing it out.


This event sent from IssueTracker by cwyse 
 issue 291117
Comment 21 errata-xmlrpc 2010-03-30 03:58:45 EDT
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 therefore 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-2010-0190.html

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