chiark / gitweb /
dbus: complete automount and mount unit coverage
authorLennart Poettering <lennart@poettering.net>
Sun, 4 Jul 2010 02:55:33 +0000 (04:55 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 4 Jul 2010 02:55:33 +0000 (04:55 +0200)
src/dbus-automount.c
src/dbus-mount.c
src/systemctl.c

index 61732f9..ada2d22 100644 (file)
@@ -25,6 +25,7 @@
 #define BUS_AUTOMOUNT_INTERFACE                                      \
         " <interface name=\"org.freedesktop.systemd1.Automount\">\n" \
         "  <property name=\"Where\" type=\"s\" access=\"read\"/>\n"  \
 #define BUS_AUTOMOUNT_INTERFACE                                      \
         " <interface name=\"org.freedesktop.systemd1.Automount\">\n" \
         "  <property name=\"Where\" type=\"s\" access=\"read\"/>\n"  \
+        "  <property name=\"DirectoryMode\" type=\"u\" access=\"read\"/>\n" \
         " </interface>\n"
 
 #define INTROSPECTION                                                \
         " </interface>\n"
 
 #define INTROSPECTION                                                \
@@ -41,7 +42,8 @@ const char bus_automount_interface[] = BUS_AUTOMOUNT_INTERFACE;
 DBusHandlerResult bus_automount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
 DBusHandlerResult bus_automount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Automount", "Where", bus_property_append_string, "s", u->automount.where },
+                { "org.freedesktop.systemd1.Automount", "Where", bus_property_append_string,       "s", u->automount.where           },
+                { "org.freedesktop.systemd1.Automount", "DirectoryMode", bus_property_append_mode, "u", &u->automount.directory_mode },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index 0f417e7..5e17ec2 100644 (file)
@@ -35,6 +35,7 @@
         BUS_EXEC_CONTEXT_INTERFACE                                      \
         "  <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n"  \
         "  <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
         BUS_EXEC_CONTEXT_INTERFACE                                      \
         "  <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n"  \
         "  <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
+        "  <property name=\"DirectoryMode\" type=\"u\" access=\"read\"/>\n" \
         " </interface>\n"
 
 #define INTROSPECTION                                                   \
         " </interface>\n"
 
 #define INTROSPECTION                                                   \
@@ -123,15 +124,16 @@ static int bus_mount_append_type(Manager *n, DBusMessageIter *i, const char *pro
 DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
 DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Mount", "Where",       bus_property_append_string, "s", u->mount.where         },
-                { "org.freedesktop.systemd1.Mount", "What",        bus_mount_append_what,      "s", u                      },
-                { "org.freedesktop.systemd1.Mount", "Options",     bus_mount_append_options,   "s", u                      },
-                { "org.freedesktop.systemd1.Mount", "Type",        bus_mount_append_type,      "s", u                      },
-                { "org.freedesktop.systemd1.Mount", "TimeoutUSec", bus_property_append_usec,   "t", &u->mount.timeout_usec },
+                { "org.freedesktop.systemd1.Mount", "Where",         bus_property_append_string, "s", u->mount.where         },
+                { "org.freedesktop.systemd1.Mount", "What",          bus_mount_append_what,      "s", u                      },
+                { "org.freedesktop.systemd1.Mount", "Options",       bus_mount_append_options,   "s", u                      },
+                { "org.freedesktop.systemd1.Mount", "Type",          bus_mount_append_type,      "s", u                      },
+                { "org.freedesktop.systemd1.Mount", "TimeoutUSec",   bus_property_append_usec,   "t", &u->mount.timeout_usec },
                 /* ExecCommand */
                 BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Mount", u->mount.exec_context),
                 /* ExecCommand */
                 BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Mount", u->mount.exec_context),
-                { "org.freedesktop.systemd1.Mount", "KillMode",    bus_unit_append_kill_mode,  "s", &u->mount.kill_mode    },
-                { "org.freedesktop.systemd1.Mount", "ControlPID",  bus_property_append_pid,    "u", &u->mount.control_pid  },
+                { "org.freedesktop.systemd1.Mount", "KillMode",      bus_unit_append_kill_mode,  "s", &u->mount.kill_mode    },
+                { "org.freedesktop.systemd1.Mount", "ControlPID",    bus_property_append_pid,    "u", &u->mount.control_pid  },
+                { "org.freedesktop.systemd1.Mount", "DirectoryMode", bus_property_append_mode,   "u", &u->mount.directory_mode },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index dddd689..66d6ef0 100644 (file)
@@ -1039,7 +1039,7 @@ static int print_property(const char *name, DBusMessageIter *iter) {
                 uint32_t u;
                 dbus_message_iter_get_basic(iter, &u);
 
                 uint32_t u;
                 dbus_message_iter_get_basic(iter, &u);
 
-                if (strstr(name, "UMask"))
+                if (strstr(name, "UMask") || strstr(name, "Mode"))
                         printf("%s=%04o\n", name, u);
                 else
                         printf("%s=%u\n", name, (unsigned) u);
                         printf("%s=%04o\n", name, u);
                 else
                         printf("%s=%u\n", name, (unsigned) u);