nspawn: when readjusting UID/GID ownership of OS trees, skip read-only subtrees

This should allow tools like rkt to pre-mount read-only subtrees in the OS
tree, without breaking the patching code.

Note that the code will still fail, if the top-level directory is already
read-only.
This commit is contained in:
Lennart Poettering
2016-04-25 12:50:13 +02:00
parent 88cd066e11
commit 4aeb20f5aa
3 changed files with 27 additions and 3 deletions
+2
View File
@@ -72,6 +72,8 @@ void cmsg_close_all(struct msghdr *mh);
bool fdname_is_valid(const char *s);
int fd_get_path(int fd, char **ret);
/* Hint: ENETUNREACH happens if we try to connect to "non-existing" special IP addresses, such as ::5 */
#define ERRNO_IS_DISCONNECT(r) \
IN_SET(r, ENOTCONN, ECONNRESET, ECONNREFUSED, ECONNABORTED, EPIPE, ENETUNREACH)