Bug 1483607

Summary: get-gfid has bug in sed regexp
Product: [Community] GlusterFS Reporter: Mrten <bugzilla>
Component: scriptsAssignee: bugs <bugs>
Status: CLOSED EOL QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.10CC: atumball, bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-20 18:26:44 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:

Description Mrten 2017-08-21 13:12:55 UTC
Description of problem:

get-gfid.sh, which comes with the launchpad distribution, has a bug in the sed regexp to get the path:


#!/bin/bash

ATTR_STR=`getfattr -h $1 -n glusterfs.gfid.string`
GLFS_PATH=`echo $ATTR_STR | sed -e 's/# file: \(.*\) glusterfs.gfid.string*/\1/g'`
GFID=`echo $ATTR_STR | sed -e 's/.*glusterfs.gfid.string="\(.*\)"/\1/g'`

echo "$GFID $GLFS_PATH"


Which should be


#!/bin/bash

ATTR_STR=`getfattr -h $1 -n glusterfs.gfid.string`
GLFS_PATH=`echo $ATTR_STR | sed -e 's/# file: \(.*\) glusterfs.gfid.string.*/\1/g'`
GFID=`echo $ATTR_STR | sed -e 's/.*glusterfs.gfid.string="\(.*\)"/\1/g'`

echo "$GFID $GLFS_PATH"

The difference is in the "string*" vs "string.*" in the second line. This changes the output from weird to plausible:

root@gluster-1:/mnt/gluster/gl0/acme# /usr/share/glusterfs/scripts/get-gfid.sh static.iidesk.com
fd099bd8-ee11-4456-95a4-f46597a3977e static.iidesk.com="fd099bd8-ee11-4456-95a4-f46597a3977e"

vs

root@gluster-1:/mnt/gluster/gl0/acme# /usr/share/glusterfs/scripts/get-gfid.sh static.iidesk.com
fd099bd8-ee11-4456-95a4-f46597a3977e static.iidesk.com

first is pre-fix, second example is post-fix.

Comment 1 Kaleb KEITHLEY 2018-01-30 10:59:54 UTC
Can we please get some attention on this BZ?

Debian users are now opening issues for the Debian packaging because of this.

Comment 2 Shyamsundar 2018-06-20 18:26:44 UTC
This bug reported is against a version of Gluster that is no longer maintained (or has been EOL'd). See https://www.gluster.org/release-schedule/ for the versions currently maintained.

As a result this bug is being closed.

If the bug persists on a maintained version of gluster or against the mainline gluster repository, request that it be reopened and the Version field be marked appropriately.

Comment 3 Red Hat Bugzilla 2023-09-14 04:02:42 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days