1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

Merge 31cb323b5019e1182d5c27e3f8c0cbca1a1d1579 into fdab24bf6acc62d3011f9b5abdf834b4886642b2

This commit is contained in:
Helmut Grohne 2025-03-13 06:22:11 +01:00 committed by GitHub
commit 2868ee5134
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1031,6 +1031,15 @@ static int setup_credentials_internal(
return r;
}
if (workspace_mounted && !final_mounted && dir_is_empty(where, /* ignore_hidden_or_backup = */ false) > 0) {
/* We actually did not produce any credentials in a new mount. Thus, we fall back
* to the plain (empty) directory rather than leaving an empty mount behind. */
r = umount_verbose(LOG_DEBUG, workspace, MNT_DETACH|UMOUNT_NOFOLLOW);
if (r < 0)
return r;
workspace_mounted = false;
}
if (workspace_mounted) {
if (!final_mounted) {
/* Make workspace read-only now, so that any bind mount we make from it defaults to