[systemd-commits] 2 commits - TODO src/nspawn
Lennart Poettering
lennart at kemper.freedesktop.org
Thu Jan 22 16:23:08 PST 2015
TODO | 2 --
src/nspawn/nspawn.c | 27 +++++++++++----------------
2 files changed, 11 insertions(+), 18 deletions(-)
New commits:
commit 05e7da5afa07b5620c06507a3f033334a5179d21
Author: Alban Crequy <alban at endocode.com>
Date: Thu Jan 22 16:47:07 2015 +0100
nspawn: allow bind-mounting char and block files
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index d0e4ee7..25828cf 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -913,8 +913,12 @@ static int mount_binds(const char *dest, char **l, bool ro) {
r = stat(where, &dest_st);
if (r == 0) {
- if ((source_st.st_mode & S_IFMT) != (dest_st.st_mode & S_IFMT)) {
- log_error("The file types of %s and %s do not match. Refusing bind mount", *x, where);
+ if (S_ISDIR(source_st.st_mode) && !S_ISDIR(dest_st.st_mode)) {
+ log_error("Cannot bind mount directory %s on file %s.", *x, where);
+ return -EINVAL;
+ }
+ if (!S_ISDIR(source_st.st_mode) && S_ISDIR(dest_st.st_mode)) {
+ log_error("Cannot bind mount file %s on directory %s.", *x, where);
return -EINVAL;
}
} else if (errno == ENOENT) {
@@ -926,27 +930,18 @@ static int mount_binds(const char *dest, char **l, bool ro) {
return -errno;
}
- /* Create the mount point, but be conservative -- refuse to create block
- * and char devices. */
+ /* Create the mount point. Any non-directory file can be
+ * mounted on any non-directory file (regular, fifo, socket,
+ * char, block).
+ */
if (S_ISDIR(source_st.st_mode)) {
r = mkdir_label(where, 0755);
if (r < 0 && errno != EEXIST)
return log_error_errno(r, "Failed to create mount point %s: %m", where);
- } else if (S_ISFIFO(source_st.st_mode)) {
- r = mkfifo(where, 0644);
- if (r < 0 && errno != EEXIST)
- return log_error_errno(errno, "Failed to create mount point %s: %m", where);
- } else if (S_ISSOCK(source_st.st_mode)) {
- r = mknod(where, 0644 | S_IFSOCK, 0);
- if (r < 0 && errno != EEXIST)
- return log_error_errno(errno, "Failed to create mount point %s: %m", where);
- } else if (S_ISREG(source_st.st_mode)) {
+ } else {
r = touch(where);
if (r < 0)
return log_error_errno(r, "Failed to create mount point %s: %m", where);
- } else {
- log_error("Refusing to create mountpoint for file: %s", *x);
- return -ENOTSUP;
}
if (mount(*x, where, "bind", MS_BIND, NULL) < 0)
commit 24fdceabbf97adc2fe4f5d55eb33cd5f079c44e7
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Jan 23 01:20:16 2015 +0100
update TODO
diff --git a/TODO b/TODO
index 47694a6..3d1f303 100644
--- a/TODO
+++ b/TODO
@@ -33,8 +33,6 @@ Release 219 preparations:
* rework journald sigbus stuff to use mutex
-* machinectl: show progress percentage in list
-
* nspawn: don't change superblock mount options from nspawn for cgroup hierarchies
* "systemctl kill" is broken
More information about the systemd-commits
mailing list