You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2017/05/15 14:12:11 UTC

lucene-solr:branch_6_6: SOLR-10644: Make solr.in.sh owned by root, readable to solr (group) but not world-readable

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6_6 13395a6fc -> a5597a98b


SOLR-10644: Make solr.in.sh owned by root, readable to solr (group) but not world-readable

(cherry picked from commit 50a0804)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a5597a98
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a5597a98
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a5597a98

Branch: refs/heads/branch_6_6
Commit: a5597a98b5ea5f52c45b7fc55e31ec7e8633b907
Parents: 13395a6
Author: Jan Høydahl <ja...@apache.org>
Authored: Mon May 15 16:05:32 2017 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Mon May 15 16:12:02 2017 +0200

----------------------------------------------------------------------
 solr/bin/install_solr_service.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a5597a98/solr/bin/install_solr_service.sh
----------------------------------------------------------------------
diff --git a/solr/bin/install_solr_service.sh b/solr/bin/install_solr_service.sh
index 54b62e5..b829571 100755
--- a/solr/bin/install_solr_service.sh
+++ b/solr/bin/install_solr_service.sh
@@ -251,9 +251,9 @@ solr_uid="`id -u "$SOLR_USER"`"
 if [ $? -ne 0 ]; then
   echo "Creating new user: $SOLR_USER"
   if [ "$distro" == "RedHat" ] || [ "$distro" == "CentOS" ] ; then
-    adduser "$SOLR_USER"
+    adduser --system -U -m --home-dir "$SOLR_VAR_DIR" "$SOLR_USER"
   elif [ "$distro" == "SUSE" ]; then
-    useradd -m "$SOLR_USER"
+    useradd --system -U -m --home-dir "$SOLR_VAR_DIR" "$SOLR_USER"
   else
     adduser --system --shell /bin/bash --group --disabled-password --home "$SOLR_VAR_DIR" "$SOLR_USER"
   fi
@@ -331,8 +331,8 @@ SOLR_LOGS_DIR=\"$SOLR_VAR_DIR/logs\"
 SOLR_PORT=\"$SOLR_PORT\"
 " >> "/etc/default/$SOLR_SERVICE.in.sh"
 fi
-chown ${SOLR_USER}: "/etc/default/$SOLR_SERVICE.in.sh"
-chmod 0660 "/etc/default/$SOLR_SERVICE.in.sh"
+chown root:${SOLR_USER} "/etc/default/$SOLR_SERVICE.in.sh"
+chmod 0640 "/etc/default/$SOLR_SERVICE.in.sh"
 
 # install data directories and files
 mkdir -p "$SOLR_VAR_DIR/data"