Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1701818

Summary: Syntactical errors in hook scripts for managing SELinux context on bricks #2 (S10selinux-label-brick.sh + S10selinux-del-fcontext.sh)
Product: [Community] GlusterFS Reporter: Anoop C S <anoopcs>
Component: scriptsAssignee: bugs <bugs>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6CC: bugs, mzink
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1542072 Environment:
Last Closed: 2019-05-08 13:56:51 UTC Type: ---
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: 1542072    
Bug Blocks:    

Description Anoop C S 2019-04-22 05:29:11 UTC
+++ This bug was initially created as a clone of Bug #1542072 +++

Description of problem:
* Syntax errors similar as in Bug 1533342 - post/S10selinux-label-brick.sh
* Fix globbing problem when using grep for brick info files in both scripts 

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


How reproducible:
Run scripts from commandline

Steps to Reproduce:
1. /var/lib/glusterd/hooks/1/delete/pre/S10selinux-del-fcontext.sh --volname vol050-vg10

2. /var/lib/glusterd/hooks/1/create/post/S10selinux-label-brick.sh --volname vol050-vg10


Actual results:
1. ValueError: File context for /rhgs/vol050-vg10/brick01/fs(/.*)? is not defined

2. grep: /var/lib/glusterd/vols/vol050-vg10/bricks/*: No such file or directory


Expected results:

#  /var/lib/glusterd/hooks/1/create/post/S10selinux-label-brick.sh --volname vol050-vg10

# semanage fcontext --list | grep rhgs
/rhgs(/.*)?                                        all files          system_u:object_r:glusterd_brick_t:s0 
/rhgs/vol050-vg10/brick01/fs\(/.*\)?               all files          system_u:object_r:glusterd_brick_t:s0 

# /var/lib/glusterd/hooks/1/delete/pre/S10selinux-del-fcontext.sh --volname vol050-vg10

# semanage fcontext --list | grep rhgs
/rhgs(/.*)?                                        all files          system_u:object_r:glusterd_brick_t:s0

--- Additional comment from Worker Ant on 2018-02-05 19:36:36 IST ---

REVIEW: https://review.gluster.org/19502 (Bug 1542072 - syntactical errors in SELinux hooks) posted (#1) for review on master by

--- Additional comment from Worker Ant on 2018-08-23 15:01:40 IST ---

REVIEW: https://review.gluster.org/19502 (extras/hooks: syntactical errors in SELinux hooks, scipt logic improved) posted (#6) for review on master by Anoop C S

--- Additional comment from Worker Ant on 2019-04-18 18:20:29 IST ---

REVIEW: https://review.gluster.org/19502 (extras/hooks: syntactical errors in SELinux hooks, scipt logic improved) merged (#13) on master by Amar Tumballi

Comment 1 Worker Ant 2019-04-22 05:32:11 UTC
REVIEW: https://review.gluster.org/22594 (extras/hooks: syntactical errors in SELinux hooks, scipt logic improved) posted (#1) for review on release-6 by Anoop C S

Comment 2 Worker Ant 2019-05-08 13:56:51 UTC
REVIEW: https://review.gluster.org/22594 (extras/hooks: syntactical errors in SELinux hooks, scipt logic improved) merged (#2) on release-6 by Shyamsundar Ranganathan