From 2d122afaf9817cadc668b308c4f736e47c09a55f Mon Sep 17 00:00:00 2001 From: Martin Chlumsky Date: Mon, 4 Nov 2019 13:46:49 -0500 Subject: [PATCH] swift-rsyncd: don't recursively chown /srv/node at startup Instead of doing a recursive chown on /srv/node, chown only /srv/node and any immediate subdirectory under /srv/node. Change-Id: I8fd93fa77ba9fc63910360300b8783a34bd4e6d5 Closes-Bug: #1851169 --- docker/swift/swift-base/swift_sudoers | 4 ++-- docker/swift/swift-rsyncd/extend_start.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/swift/swift-base/swift_sudoers b/docker/swift/swift-base/swift_sudoers index b67c47df31..752fe0e2ee 100644 --- a/docker/swift/swift-base/swift_sudoers +++ b/docker/swift/swift-base/swift_sudoers @@ -1,3 +1,3 @@ -swift ALL=(root) NOPASSWD: /bin/chown -R swift\:swift /srv/node -swift ALL=(root) NOPASSWD: /usr/bin/chown -R swift\:swift /srv/node +swift ALL=(root) NOPASSWD: /bin/find /srv/node/ -maxdepth 1 -type d -execdir chown swift\:swift {} \\+ +swift ALL=(root) NOPASSWD: /usr/bin/find /srv/node/ -maxdepth 1 -type d -execdir chown swift\:swift {} \\+ swift ALL=(root) NOPASSWD: /var/lib/kolla/venv/bin/swift-rootwrap /etc/swift/rootwrap.conf * diff --git a/docker/swift/swift-rsyncd/extend_start.sh b/docker/swift/swift-rsyncd/extend_start.sh index 86d24724bc..33ff2bf2cf 100644 --- a/docker/swift/swift-rsyncd/extend_start.sh +++ b/docker/swift/swift-rsyncd/extend_start.sh @@ -1,4 +1,4 @@ #!/bin/bash -sudo chown -R swift:swift /srv/node +sudo find /srv/node/ -maxdepth 1 -type d -execdir chown swift:swift {} \+ mkdir -p /var/lib/swift/lock