summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorTimothy Redaelli <tredaelli@redhat.com>2017-06-19 16:50:21 +0200
committerBen Pfaff <blp@ovn.org>2017-07-10 11:25:45 -0700
commit03736a6726cb1faf2584ad2536625471ab6d17c5 (patch)
treec5c51cfbd48e54806ef1a976e53df180de6a405f /utilities
parentb34cd6119aa1ce50d910252202e5eaa13b5fce5e (diff)
downloadopenvswitch-03736a6726cb1faf2584ad2536625471ab6d17c5.tar.gz
make logs not readable by other
The Open vSwitch log directory and files are currently set world readable. However, since only Open vSwitch users and processes need to access this directory and these files there is no need to allow the world to access them, since it can result in the exposure of sensitive information. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'utilities')
-rw-r--r--utilities/ovs-lib.in5
-rwxr-xr-xutilities/ovs-pki.in2
2 files changed, 4 insertions, 3 deletions
diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
index 93085ca58..8665698bb 100644
--- a/utilities/ovs-lib.in
+++ b/utilities/ovs-lib.in
@@ -150,13 +150,14 @@ version_geq() {
install_dir () {
DIR="$1"
+ INSTALL_MODE="${2:-755}"
INSTALL_USER="root"
INSTALL_GROUP="root"
[ "$OVS_USER" != "" ] && INSTALL_USER="${OVS_USER%:*}"
[ "${OVS_USER##*:}" != "" ] && INSTALL_GROUP="${OVS_USER##*:}"
if test ! -d "$DIR"; then
- install -d -m 755 -o "$INSTALL_USER" -g "$INSTALL_GROUP" "$DIR"
+ install -d -m "$INSTALL_MODE" -o "$INSTALL_USER" -g "$INSTALL_GROUP" "$DIR"
restorecon "$DIR" >/dev/null 2>&1
fi
}
@@ -174,7 +175,7 @@ start_daemon () {
cd "$DAEMON_CWD"
# log file
- install_dir "$logdir"
+ install_dir "$logdir" "750"
set "$@" --log-file="$logdir/$daemon.log"
# pidfile and monitoring
diff --git a/utilities/ovs-pki.in b/utilities/ovs-pki.in
index d5ce1dccf..4f6941865 100755
--- a/utilities/ovs-pki.in
+++ b/utilities/ovs-pki.in
@@ -206,7 +206,7 @@ esac
logdir=$(dirname "$log")
if test ! -d "$logdir"; then
- mkdir -p -m755 "$logdir" 2>/dev/null || true
+ mkdir -p -m750 "$logdir" 2>/dev/null || true
if test ! -d "$logdir"; then
echo "$0: log directory $logdir does not exist and cannot be created" >&2
exit 1