From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH] xfs_scrub: don't set WorkingDirectory= in systemd job
Date: Tue, 14 Apr 2020 08:43:59 -0700 [thread overview]
Message-ID: <20200414154359.GE6742@magnolia> (raw)
From: Darrick J. Wong <darrick.wong@oracle.com>
Somewhere between systemd 237 and 245, they changed the order in which a
job has its uid/gid set; capabilities applied; and working directory
set. Whereas before they did it in an order such that you could set the
working directory to a path inaccessible to 'nobody' (either because
they did it before changing the uid or after adding capabilities), now
they don't and users instead get a service failure:
xfs_scrub@-boot.service: Changing to the requested working directory failed: Permission denied
xfs_scrub@-boot.service: Failed at step CHDIR spawning /usr/sbin/xfs_scrub: Permission denied
xfs_scrub@-boot.service: Main process exited, code=exited, status=200/CHDIR
Regardless, xfs_scrub works just fine with PWD set to /, so remove that
directive.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
scrub/xfs_scrub@.service.in | 1 -
1 file changed, 1 deletion(-)
diff --git a/scrub/xfs_scrub@.service.in b/scrub/xfs_scrub@.service.in
index 56acea67..6fb3f6ea 100644
--- a/scrub/xfs_scrub@.service.in
+++ b/scrub/xfs_scrub@.service.in
@@ -5,7 +5,6 @@ Documentation=man:xfs_scrub(8)
[Service]
Type=oneshot
-WorkingDirectory=%I
PrivateNetwork=true
ProtectSystem=full
ProtectHome=read-only
next reply other threads:[~2020-04-14 15:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 15:43 Darrick J. Wong [this message]
2020-04-14 16:40 ` [PATCH] xfs_scrub: don't set WorkingDirectory= in systemd job Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200414154359.GE6742@magnolia \
--to=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox