Bug 1483607 - get-gfid has bug in sed regexp
Summary: get-gfid has bug in sed regexp
Keywords:
Status: CLOSED EOL
Alias: None
Product: GlusterFS
Classification: Community
Component: scripts
Version: 3.10
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-21 13:12 UTC by Mrten
Modified: 2023-09-14 04:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-20 18:26:44 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

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


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