Bug 1535079 - syntax error in S10selinux-label-brick.sh
Summary: syntax error in S10selinux-label-brick.sh
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: scripts
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: M. Scherer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-16 15:48 UTC by M. Scherer
Modified: 2019-05-11 11:02 UTC (History)
4 users (show)

Fixed In Version: glusterfs-6.x
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-11 11:02:27 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

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?


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