~ubuntu-branches/debian/jessie/systemd/jessie

« back to all changes in this revision

Viewing changes to src/dbus-mount.c

  • Committer: Package Import Robot
  • Author(s): Tollef Fog Heen, Tollef Fog Heen, Michael Biebl
  • Date: 2012-04-03 19:59:17 UTC
  • mfrom: (1.1.10) (6.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20120403195917-l532urrbg4pkreas
Tags: 44-1
[ Tollef Fog Heen ]
* New upstream version.
  - Backport 3492207: journal: PAGE_SIZE is not known on ppc and other
    archs
  - Backport 5a2a2a1: journal: react with immediate rotation to a couple
    of more errors
  - Backport 693ce21: util: never follow symlinks in rm_rf_children()
    Fixes CVE-2012-1174, closes: #664364
* Drop output message from init-functions hook, it's pointless.
* Only rmdir /lib/init/rw if it exists.
* Explicitly order debian-fixup before sysinit.target to prevent a
  possible race condition with the creation of sockets.  Thanks to
  Michael Biebl for debugging this.
* Always restart the initctl socket on upgrades, to mask sysvinit
  removing it.

[ Michael Biebl ]
* Remove workaround for non-interactive sessions from pam config again.
* Create compat /dev/initctl symlink in case we are upgrading from a system
  running a newer version of sysvinit (using /run/initctl) and sysvinit is
  replaced with systemd-sysv during the upgrade. Closes: #663219
* Install new man pages.
* Build-Depend on valac (>= 0.12) instead of valac-0.12. Closes: #663323

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        BUS_EXEC_CONTEXT_INTERFACE                                      \
40
40
        "  <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
41
41
        "  <property name=\"DirectoryMode\" type=\"u\" access=\"read\"/>\n" \
 
42
        "  <property name=\"Result\" type=\"s\" access=\"read\"/>\n"    \
42
43
        " </interface>\n"
43
44
 
44
45
#define INTROSPECTION                                                   \
64
65
        "ExecMount\0"
65
66
        "ExecUnmount\0"
66
67
        "ExecRemount\0"
67
 
        "ControlPID\0";
 
68
        "ControlPID\0"
 
69
        "Result\0";
68
70
 
69
71
static int bus_mount_append_what(DBusMessageIter *i, const char *property, void *data) {
70
72
        Mount *m = data;
135
137
        return 0;
136
138
}
137
139
 
 
140
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_mount_append_mount_result, mount_result, MountResult);
 
141
 
 
142
static const BusProperty bus_mount_properties[] = {
 
143
        { "Where",         bus_property_append_string, "s", offsetof(Mount, where),    true },
 
144
        { "What",          bus_mount_append_what,      "s", 0 },
 
145
        { "Options",       bus_mount_append_options,   "s", 0 },
 
146
        { "Type",          bus_mount_append_type,      "s", 0 },
 
147
        { "TimeoutUSec",   bus_property_append_usec,   "t", offsetof(Mount, timeout_usec)   },
 
148
        BUS_EXEC_COMMAND_PROPERTY("ExecMount",   offsetof(Mount, exec_command[MOUNT_EXEC_MOUNT]),   false),
 
149
        BUS_EXEC_COMMAND_PROPERTY("ExecUnmount", offsetof(Mount, exec_command[MOUNT_EXEC_UNMOUNT]), false),
 
150
        BUS_EXEC_COMMAND_PROPERTY("ExecRemount", offsetof(Mount, exec_command[MOUNT_EXEC_REMOUNT]), false),
 
151
        { "ControlPID",    bus_property_append_pid,    "u", offsetof(Mount, control_pid)    },
 
152
        { "DirectoryMode", bus_property_append_mode,   "u", offsetof(Mount, directory_mode) },
 
153
        { "Result",        bus_mount_append_mount_result, "s", offsetof(Mount, result)      },
 
154
        { NULL, }
 
155
};
 
156
 
138
157
DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
 
158
        Mount *m = MOUNT(u);
139
159
 
140
 
        const BusProperty properties[] = {
141
 
                BUS_UNIT_PROPERTIES,
142
 
                { "org.freedesktop.systemd1.Mount", "Where",         bus_property_append_string, "s", u->mount.where           },
143
 
                { "org.freedesktop.systemd1.Mount", "What",          bus_mount_append_what,      "s", u                        },
144
 
                { "org.freedesktop.systemd1.Mount", "Options",       bus_mount_append_options,   "s", u                        },
145
 
                { "org.freedesktop.systemd1.Mount", "Type",          bus_mount_append_type,      "s", u                        },
146
 
                { "org.freedesktop.systemd1.Mount", "TimeoutUSec",   bus_property_append_usec,   "t", &u->mount.timeout_usec   },
147
 
                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", u->mount.exec_command+MOUNT_EXEC_MOUNT,   "ExecMount"),
148
 
                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", u->mount.exec_command+MOUNT_EXEC_UNMOUNT, "ExecUnmount"),
149
 
                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", u->mount.exec_command+MOUNT_EXEC_REMOUNT, "ExecRemount"),
150
 
                BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Mount", u->mount.exec_context),
151
 
                { "org.freedesktop.systemd1.Mount", "ControlPID",    bus_property_append_pid,    "u", &u->mount.control_pid    },
152
 
                { "org.freedesktop.systemd1.Mount", "DirectoryMode", bus_property_append_mode,   "u", &u->mount.directory_mode },
153
 
                { NULL, NULL, NULL, NULL, NULL }
 
160
        const BusBoundProperties bps[] = {
 
161
                { "org.freedesktop.systemd1.Unit",  bus_unit_properties,         u },
 
162
                { "org.freedesktop.systemd1.Mount", bus_mount_properties,        m },
 
163
                { "org.freedesktop.systemd1.Mount", bus_exec_context_properties, &m->exec_context },
 
164
                { NULL, }
154
165
        };
155
166
 
156
 
        return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, properties);
 
167
        return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, bps );
157
168
}