[systemd-commits] 2 commits - TODO src/core src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Thu Aug 14 16:35:43 PDT 2014


 TODO              |    6 ++++--
 src/core/mount.c  |   21 +++++++++++++++++++++
 src/shared/util.c |   12 ++++++++++++
 src/shared/util.h |    2 ++
 4 files changed, 39 insertions(+), 2 deletions(-)

New commits:
commit 1dbe0a6efda7b1d35957eab7e1d56a2c69d806d9
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Aug 15 01:25:36 2014 +0200

    update TODO

diff --git a/TODO b/TODO
index d58da71..8d3c1ca 100644
--- a/TODO
+++ b/TODO
@@ -62,8 +62,12 @@ Features:
   - networkd's dhcp server should transparently pass on the DNS and
     NTP server list it got from user configuration and its dhcp client
     to clients. It should also pass on its own timezone information.
+  - provide a way to define a per-network interface default metric value
+    for all routes to it. possibly a second default for DHCP routes.
 
 * resolved:
+  - put networkd events and rtnl events at a higher priority, so that
+    we always process them before we process client requests
   - DNSSEC
         - use base64 for key presentation?
         - add display of private key types (http://tools.ietf.org/html/rfc4034#appendix-A.1.1)?
@@ -93,8 +97,6 @@ Features:
 
 * Add a new verb "systemctl top"
 
-* refuse mounting on symlinks
-
 * logind: allow users to kill or lock their own sessions
 
 * add new gpt type for btrfs volumes

commit 5261ba901845c084de5a8fd06500ed09bfb0bd80
Author: Timofey Titovets <nefelim4ag at gmail.com>
Date:   Fri Aug 15 02:05:47 2014 +0300

    core: Refuse mount on symlink

diff --git a/src/core/mount.c b/src/core/mount.c
index 39a9aaf..ec90b0a 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -827,6 +827,23 @@ void warn_if_dir_nonempty(const char *unit, const char* where) {
                    NULL);
 }
 
+static int fail_if_symlink(const char *unit, const char* where) {
+        assert(where);
+
+        if (is_symlink(where) > 0) {
+                log_struct_unit(LOG_WARNING,
+                                unit,
+                                "MESSAGE=%s: Mount on symlink %s not allowed.",
+                                unit, where,
+                                "WHERE=%s", where,
+                                MESSAGE_ID(SD_MESSAGE_OVERMOUNTING),
+                                NULL);
+
+                return -ELOOP;
+        }
+        return 0;
+}
+
 static void mount_enter_unmounting(Mount *m) {
         int r;
 
@@ -877,6 +894,10 @@ static void mount_enter_mounting(Mount *m) {
         if (p && mount_is_bind(p))
                 mkdir_p_label(p->what, m->directory_mode);
 
+        r = fail_if_symlink(m->meta.id, m->where);
+        if (r < 0)
+                goto fail;
+
         if (m->from_fragment)
                 r = exec_command_set(
                                 m->control_command,
diff --git a/src/shared/util.c b/src/shared/util.c
index 3d16cd1..0db4bd9 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -6918,3 +6918,15 @@ int take_password_lock(const char *root) {
 
         return fd;
 }
+
+int is_symlink(const char *path) {
+        struct stat info;
+
+        if (lstat(path, &info) < 0)
+                return -errno;
+
+        if (S_ISLNK(info.st_mode))
+                return 1;
+
+        return 0;
+}
\ No newline at end of file
diff --git a/src/shared/util.h b/src/shared/util.h
index 101d2df..bd8bbb2 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -966,3 +966,5 @@ char *tempfn_random(const char *p);
 bool is_localhost(const char *hostname);
 
 int take_password_lock(const char *root);
+
+int is_symlink(const char *path);
\ No newline at end of file



More information about the systemd-commits mailing list