Bug 1360888

Summary: gluster bash completion leaks TOP=0 into the environment
Product: [Community] GlusterFS Reporter: Richard W.M. Jones <rjones>
Component: cliAssignee: bugs <bugs>
Status: CLOSED EOL QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.8CC: anoopcs, bugs, humble.devassy, joe, jonathansteffan, lmohanty, ndevos, ramkrsna, rjones
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1425325 (view as bug list) Environment:
Last Closed: 2017-11-07 11:36:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1425325    
Bug Blocks:    

Description Richard W.M. Jones 2016-07-27 17:40:46 UTC
Description of problem:

On my machine I have a bash shell variable called "TOP" defined:

$ echo $TOP
0

(Note this is not an environment variable).  This breaks
various things, in this case the lowRISC initialization script.

The variable comes from gluster bash completion script
/etc/bash_completion.d/gluster

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

glusterfs-cli-3.8.0-0.2.rc2.fc24.x86_64

How reproducible:

100%

Steps to Reproduce:
1. echo $TOP

Comment 1 Niels de Vos 2016-09-12 05:37:16 UTC
All 3.8.x bugs are now reported against version 3.8 (without .x). For more information, see http://www.gluster.org/pipermail/gluster-devel/2016-September/050859.html

Comment 2 Anoop C S 2017-02-21 06:16:52 UTC
(In reply to Richard W.M. Jones from comment #0)
> Description of problem:
> 
> On my machine I have a bash shell variable called "TOP" defined:
> 
> $ echo $TOP
> 0
> 
> (Note this is not an environment variable).  This breaks
> various things, in this case the lowRISC initialization script.
> 

Can you please direct towards this initialization script?

And how severe is the issue?

> The variable comes from gluster bash completion script
> /etc/bash_completion.d/gluster
> 
> Version-Release number of selected component (if applicable):
> 
> glusterfs-cli-3.8.0-0.2.rc2.fc24.x86_64
> 
> How reproducible:
> 
> 100%
> 
> Steps to Reproduce:
> 1. echo $TOP

Comment 3 Richard W.M. Jones 2017-02-21 08:26:22 UTC
(In reply to Anoop C S from comment #2)
> Can you please direct towards this initialization script?

As stated in the original description:

  /etc/bash_completion.d/gluster

from the package glusterfs-cli.  In the source, this file is
called extras/command-completion/gluster.bash

> And how severe is the issue?

Annoying more than severe.  However it prevents building all
the RISC-V upstream software.

Comment 4 Niels de Vos 2017-02-21 08:37:39 UTC
It looks like "TOP" is not the only variable that leaks:

From <glusterfs.git>/extras/command-completion/gluster.bash:
285 declare FINAL_LIST=''
286 declare LIST=''
287 declare -i TOP=0

Comment 5 Niels de Vos 2017-11-07 10:36:36 UTC
This bug is getting closed because the 3.8 version is marked End-Of-Life. There will be no further updates to this version. Please open a new bug against a version that still receives bugfixes if you are still facing this issue in a more current release.

Comment 6 Richard W.M. Jones 2017-11-07 11:07:17 UTC
WTF?  Please fix your bugs.

Comment 7 Niels de Vos 2017-11-07 11:36:25 UTC
(In reply to Richard W.M. Jones from comment #6)
> WTF?  Please fix your bugs.

There will not be any updates to the 3.8 version. Bug 1425325 has already been opened to get the fix in other maintained versions. Sorry for the confusion, maybe the comment should mention to check or look at bugs that are marked in the 'depends on' field.