|
|
887953 |
From c807ba5a11364d8eb83b86b0e4262a32b6834267 Mon Sep 17 00:00:00 2001
|
|
|
887953 |
From: Anoop C S <anoopcs@redhat.com>
|
|
|
887953 |
Date: Thu, 13 Dec 2018 12:05:37 +0530
|
|
|
887953 |
Subject: [PATCH 483/493] Do not blindly add volume share section to smb.conf
|
|
|
887953 |
|
|
|
887953 |
With this change, by default GlusterFS volume share section will
|
|
|
887953 |
no longer be added to smb.conf for client access unless user.cifs
|
|
|
887953 |
or user.smb volume set options are enabled. This also fixes the
|
|
|
887953 |
hook script to check for presence of all configuration possibilities
|
|
|
887953 |
for those volume set options like 'enable' or 'on'.
|
|
|
887953 |
|
|
|
887953 |
upstream ref: https://review.gluster.org/c/glusterfs/+/19204
|
|
|
887953 |
|
|
|
887953 |
Change-Id: Ibecf7fffb4507d7255d963c3b1482afb0d0db984
|
|
|
887953 |
BUG: 1541568
|
|
|
887953 |
Signed-off-by: Anoop C S <anoopcs@redhat.com>
|
|
|
887953 |
Reviewed-on: https://code.engineering.redhat.com/gerrit/158497
|
|
|
887953 |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
887953 |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
887953 |
---
|
|
|
887953 |
extras/hook-scripts/set/post/S30samba-set.sh | 13 +++++++++++--
|
|
|
887953 |
extras/hook-scripts/start/post/S30samba-start.sh | 18 +++++++++++++++---
|
|
|
887953 |
2 files changed, 26 insertions(+), 5 deletions(-)
|
|
|
887953 |
|
|
|
887953 |
diff --git a/extras/hook-scripts/set/post/S30samba-set.sh b/extras/hook-scripts/set/post/S30samba-set.sh
|
|
|
887953 |
index c596db0..d2a62d3 100755
|
|
|
887953 |
--- a/extras/hook-scripts/set/post/S30samba-set.sh
|
|
|
887953 |
+++ b/extras/hook-scripts/set/post/S30samba-set.sh
|
|
|
887953 |
@@ -123,9 +123,18 @@ function get_smb () {
|
|
|
887953 |
usersmbvalue=$(grep user.smb $GLUSTERD_WORKDIR/vols/"$volname"/info |\
|
|
|
887953 |
cut -d"=" -f2)
|
|
|
887953 |
|
|
|
887953 |
- if [ $usercifsvalue = "disable" ] || [ $usersmbvalue = "disable" ]; then
|
|
|
887953 |
- uservalue="disable"
|
|
|
887953 |
+ if [ -n "$usercifsvalue" ]; then
|
|
|
887953 |
+ if [ "$usercifsvalue" = "disable" ] || [ "$usercifsvalue" = "off" ]; then
|
|
|
887953 |
+ uservalue="disable"
|
|
|
887953 |
+ fi
|
|
|
887953 |
fi
|
|
|
887953 |
+
|
|
|
887953 |
+ if [ -n "$usersmbvalue" ]; then
|
|
|
887953 |
+ if [ "$usersmbvalue" = "disable" ] || [ "$usersmbvalue" = "off" ]; then
|
|
|
887953 |
+ uservalue="disable"
|
|
|
887953 |
+ fi
|
|
|
887953 |
+ fi
|
|
|
887953 |
+
|
|
|
887953 |
echo "$uservalue"
|
|
|
887953 |
}
|
|
|
887953 |
|
|
|
887953 |
diff --git a/extras/hook-scripts/start/post/S30samba-start.sh b/extras/hook-scripts/start/post/S30samba-start.sh
|
|
|
887953 |
index dfd9c1b..2854bdd 100755
|
|
|
887953 |
--- a/extras/hook-scripts/start/post/S30samba-start.sh
|
|
|
887953 |
+++ b/extras/hook-scripts/start/post/S30samba-start.sh
|
|
|
887953 |
@@ -111,14 +111,26 @@ function get_smb () {
|
|
|
887953 |
usersmbvalue=$(grep user.smb "$GLUSTERD_WORKDIR"/vols/"$volname"/info |\
|
|
|
887953 |
cut -d"=" -f2)
|
|
|
887953 |
|
|
|
887953 |
- if [ "$usercifsvalue" = "disable" ] || [ "$usersmbvalue" = "disable" ]; then
|
|
|
887953 |
- uservalue="disable"
|
|
|
887953 |
+ if [ -n "$usercifsvalue" ]; then
|
|
|
887953 |
+ if [ "$usercifsvalue" = "enable" ] || [ "$usercifsvalue" = "on" ]; then
|
|
|
887953 |
+ uservalue="enable"
|
|
|
887953 |
+ fi
|
|
|
887953 |
fi
|
|
|
887953 |
+
|
|
|
887953 |
+ if [ -n "$usersmbvalue" ]; then
|
|
|
887953 |
+ if [ "$usersmbvalue" = "enable" ] || [ "$usersmbvalue" = "on" ]; then
|
|
|
887953 |
+ uservalue="enable"
|
|
|
887953 |
+ fi
|
|
|
887953 |
+ fi
|
|
|
887953 |
+
|
|
|
887953 |
echo "$uservalue"
|
|
|
887953 |
}
|
|
|
887953 |
|
|
|
887953 |
parse_args "$@"
|
|
|
887953 |
-if [ "$(get_smb "$VOL")" = "disable" ]; then
|
|
|
887953 |
+
|
|
|
887953 |
+value=$(get_smb "$VOL")
|
|
|
887953 |
+
|
|
|
887953 |
+if [ -z "$value" ] || [ "$value" != "enable" ]; then
|
|
|
887953 |
exit 0
|
|
|
887953 |
fi
|
|
|
887953 |
|
|
|
887953 |
--
|
|
|
887953 |
1.8.3.1
|
|
|
887953 |
|