Bug 1535079

Summary: syntax error in S10selinux-label-brick.sh
Product: [Community] GlusterFS Reporter: M. Scherer <mscherer>
Component: scriptsAssignee: M. Scherer <mscherer>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: atumball, bugs, fedora2021q2, ndevos
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-6.x Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-11 11:02:27 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 M. Scherer 2018-01-16 15:48:59 UTC
Description of problem:
$ LC_ALL=C bash -n ./extras/hook-scripts/create/post/S10selinux-label-brick.sh
./extras/hook-scripts/create/post/S10selinux-label-brick.sh: line 46: syntax error near unexpected token `('
./extras/hook-scripts/create/post/S10selinux-label-brick.sh: line 46: `                semanage fcontext --add -t glusterd_brick_t -r s0 $b(/.*)?'


This prevent gluster volume from starting on latest Fedora, unless SElinux is disabled (since then, the code is not run).


Version-Release number of selected component (if applicable):
git head (7ba7a4b2)


How reproducible:
each time

Steps to Reproduce:
1. git checkout
2. run the command
3.

Actual results:

syntax error near unexpected token

Expected results:

nothing, cause the syntax would be ok.

Additional info:

I have a patch ready. I would also like to know where/how we can lint shell script to prevent that from happening in the future.

Comment 1 Worker Ant 2018-01-16 15:50:58 UTC
REVIEW: https://review.gluster.org/19205 (Fix syntax of shell script use for selinux label) posted (#1) for review on master by Michael Scherer

Comment 2 fednuc 2018-06-13 09:19:49 UTC
This is still broken 5 months later, because of (from what I can see?) a build failure and then no follow-up on the Gerrit review.

Can someone please pick this up again, since it's preventing volume starts?