X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmount.c;h=419cf27a889ea884b062b912e121ff4f5d53793e;hb=fea7838e7e0b2724f5e0bc028121a08b42995045;hp=2aaf78ceae91b631ac3197dcd3fa7db1f4a60143;hpb=cd2086fe6573df923dc53ef33998c9fff8c2bda5;p=elogind.git diff --git a/src/core/mount.c b/src/core/mount.c index 2aaf78cea..419cf27a8 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -329,6 +329,12 @@ static bool mount_is_bind(MountParameters *p) { if (p->fstype && streq(p->fstype, "bind")) return true; + if (mount_test_option(p->options, "rbind")) + return true; + + if (p->fstype && streq(p->fstype, "rbind")) + return true; + return false; } @@ -1440,7 +1446,7 @@ static int mount_add_one( int r; Unit *u; bool delete; - char *e, *w = NULL, *o = NULL, *s = NULL, *f = NULL; + char *e, *w = NULL, *o = NULL, *f = NULL; MountParameters *p; bool load_extras = false; @@ -1488,6 +1494,12 @@ static int mount_add_one( goto fail; } + u->source_path = strdup("/proc/self/mountinfo"); + if (!u->source_path) { + r = -ENOMEM; + goto fail; + } + unit_add_to_load_queue(u); } else { delete = false; @@ -1513,7 +1525,6 @@ static int mount_add_one( if (!(w = strdup(what)) || !(o = strdup(options)) || - !(s = strdup("/proc/self/mountinfo")) || !(f = strdup(fstype))) { r = -ENOMEM; goto fail; @@ -1527,8 +1538,6 @@ static int mount_add_one( } MOUNT(u)->from_proc_self_mountinfo = true; - free(u->source_path); - u->source_path = s; free(p->what); p->what = w; @@ -1554,7 +1563,6 @@ static int mount_add_one( fail: free(w); free(o); - free(s); free(f); if (delete && u)