~ubuntu-branches/ubuntu/vivid/systemd/vivid

« back to all changes in this revision

Viewing changes to debian/patches/v204..upstream-fixes_204-5

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-04-26 17:29:00 UTC
  • mfrom: (6.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20140426172900-7eqx3dziwfe5w91c
Tags: 204-8ubuntu1
* Merge with Debian unstable. Drop the systemd-services split as we want to
  move to systemd as pid 1 (UbuntuSpec:core-1403-systemd-transition) so that
  we can start experimenting with booting Ubuntu with systemd. This does NOT
  yet change the default, with this upstart will still be used to bring up
  the system. To boot with systemd, add init=/lib/systemd/systemd to the
  grub menu (at boot or in /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT).

  Remaining Ubuntu specific changes:
  - debian/rules: Don't build the systemd-sysv package for now.
  - debian/udev.templates: Drop debconfiscation of udev, not necessary for
    Ubuntu. Drop debconf pre-dependency.
  - debian/extra/initramfs.top: Drop $ROOTDELAY, we do that in a more
    sensible way with wait-for-root. (Will get applicable to Debian once
    Debian gets wait-for-root in initramfs-tools.)
  - Drop debian/extra/{50-udev-default.rules,60-persistent-storage*.rules,
    75-cd-aliases-generator.rules,80-drivers.rules,80-networking.rules,
    91-permissions.rules}: These are the Debian specific rules, in Ubuntu we
    have always used the upstream ones.
  - Add debian/extra/rules/78-graphics-card.rules: Mark graphics devices as
    PRIMARY_DEVICE_FOR_DISPLAY so that we can wait for those in plymouth.
  - Add debian/extra/rules/73-idrac.rules: On Dell PowerEdge systems, the
    iDRAC7 and later support a USB Virtual NIC for management. Name this
    interface "idrac" to avoid confusion with "real" network interfaces.
  - Add debian/extra/udev.py: Apport hook.
  - debian/extra/udev.startup, debian/rules: Don't install/support
    /etc/udev/links.conf, that's a hack (if you want links, create udev
    rules).
  - Drop debian/source/{git-patches,options}, we use proper patches.
  - debian/rules: We continue to use the old net iface naming schema for the
    time being. Install old udev rule generator in debian/udev.install.
  - debian/rules: Don't install init.d scripts, only the upstart jobs.
  - debian/rules: Add an epoch to libgudev.
  - Drop debian/udev.dirs, not necessary.
  - Drop debian/udev.NEWS, debian/udev.maintscript: Not applicable to
    Ubuntu.
  - debian/udev.{postinst,postrm,preinst,prerm}: Keep our much simpler
    versions (all platforms must support udev, no debconf).
  - debian/rules: Drop doc dir symlinking. It creates havoc with dpkg
    upgrades, and we already have the automatic per-file symlinking.
  - Add debian/extra/rules/40-hyperv-hotadd.rules: Workaround for LP #1233466
  - Various debian/patches/*, see patch headers.

  Applicable to Debian:
  - Add libpam-systemd.systemd-logind.upstart to bring up logind at boot
    when using upstart.
  - debian/control, debian/tests/: Add autopkgtest.
  - debian/extra/initramfs.hook, debian/udev.*{pre,post}inst: Divert udevadm
    to udevadm.upgrade during upgrades while udev is unconfigured.
  - Add debian/extra/60-keyboard.hwdb: Latest upstream keymaps, for easy
    backporting.
  - debian/extra/initramfs.bottom: If LVM is installed, settle udev,
    otherwise we get missing LV symlinks. (LP #1185394)
  - Add debian/extra/README-{etc,lib}-rules.d documentation, install into
    udev.
  - debian/rules: Run tests during package build.
  - debian/udev.udev-finish.upstart: Fix path to tmp-rules,
    debian/extra/rule_generator.functions creates them in /run/udev/.
  - debian/udev-udeb.install: Add 64-btrfs.rules, 75-probe_mtd.rules, and
    80-drivers.rules, they are potentially useful in a d-i environment.
  - debian/extra/rules/75-persistent-net-generator.rules: Add new block of
    Windows Azure ethernet hardware address to ignore persistent naming
    (LP #1274348).
  - debian/extra/udev.startup: Mount devpts with the correct permissions to
    avoid needing pt_chown.
  - debian/libpam-systemd.prerm: Do proper refcounting of the PAM module
    package on prerm, so that we don't drop the module from the PAM config
    when uninstalling a foreign-arch package.  Related to LP #1295521.
  - Run dh_install with --list-missing.

  Upgrade fixes, keep until 16.04 LTS release:
  - debian/control: Conflicts/Replaces/Provides systemd-services.
* debian/tests/timedated: Get along with comments in /etc/timezone,
  cloud-init puts one there.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c
2
 
index 77d98ea..973f905 100644
3
 
--- a/src/core/dbus-socket.c
4
 
+++ b/src/core/dbus-socket.c
5
 
@@ -205,7 +205,7 @@ DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DBusMes
6
 
                 { "org.freedesktop.systemd1.Socket", bus_socket_properties,       s },
7
 
                 { "org.freedesktop.systemd1.Socket", bus_exec_context_properties, &s->exec_context },
8
 
                 { "org.freedesktop.systemd1.Socket", bus_kill_context_properties, &s->kill_context },
9
 
-                { "org.freedesktop.systemd1.Socket", bus_unit_properties,         u },
10
 
+                { "org.freedesktop.systemd1.Socket", bus_unit_cgroup_properties,  u },
11
 
                 { NULL, }
12
 
         };
13
 
 
14
 
diff --git a/src/core/manager.c b/src/core/manager.c
15
 
index c7f8f20..0508628 100644
16
 
--- a/src/core/manager.c
17
 
+++ b/src/core/manager.c
18
 
@@ -1372,7 +1372,7 @@ static int manager_process_signal_fd(Manager *m) {
19
 
 
20
 
                 case SIGINT:
21
 
                         if (m->running_as == SYSTEMD_SYSTEM) {
22
 
-                                manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE);
23
 
+                                manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE_IRREVERSIBLY);
24
 
                                 break;
25
 
                         }
26
 
 
27
 
diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c
28
 
index 735f1e1..5fbce4a 100644
29
 
--- a/src/initctl/initctl.c
30
 
+++ b/src/initctl/initctl.c
31
 
@@ -122,7 +122,7 @@ static void change_runlevel(Server *s, int runlevel) {
32
 
         if (isolate)
33
 
                 mode = "isolate";
34
 
         else
35
 
-                mode = "replace";
36
 
+                mode = "replace-irreversibly";
37
 
 
38
 
         log_debug("Running request %s/start/%s", target, mode);
39
 
 
40
 
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
41
 
index cc52b8a..01f23ce 100644
42
 
--- a/src/journal/journald-server.c
43
 
+++ b/src/journal/journald-server.c
44
 
@@ -227,9 +227,11 @@ void server_fix_perms(Server *s, JournalFile *f, uid_t uid) {
45
 
                 }
46
 
         }
47
 
 
48
 
-        /* We do not recalculate the mask here, so that the fchmod() mask above stays intact. */
49
 
+        /* We do not recalculate the mask unconditionally here,
50
 
+         * so that the fchmod() mask above stays intact. */
51
 
         if (acl_get_permset(entry, &permset) < 0 ||
52
 
-            acl_add_perm(permset, ACL_READ) < 0) {
53
 
+            acl_add_perm(permset, ACL_READ) < 0 ||
54
 
+            calc_acl_mask_if_needed(&acl) < 0) {
55
 
                 log_warning("Failed to patch ACL on %s, ignoring: %m", f->path);
56
 
                 goto finish;
57
 
         }
58
 
diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c
59
 
index 48bb12f..fb04e49 100644
60
 
--- a/src/shared/acl-util.c
61
 
+++ b/src/shared/acl-util.c
62
 
@@ -69,6 +69,34 @@ int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) {
63
 
         return 0;
64
 
 }
65
 
 
66
 
+int calc_acl_mask_if_needed(acl_t *acl_p) {
67
 
+        acl_entry_t i;
68
 
+        int found;
69
 
+
70
 
+        assert(acl_p);
71
 
+
72
 
+        for (found = acl_get_entry(*acl_p, ACL_FIRST_ENTRY, &i);
73
 
+             found > 0;
74
 
+             found = acl_get_entry(*acl_p, ACL_NEXT_ENTRY, &i)) {
75
 
+
76
 
+                acl_tag_t tag;
77
 
+
78
 
+                if (acl_get_tag_type(i, &tag) < 0)
79
 
+                        return -errno;
80
 
+
81
 
+                if (tag == ACL_MASK)
82
 
+                        return 0;
83
 
+        }
84
 
+
85
 
+        if (found < 0)
86
 
+                return -errno;
87
 
+
88
 
+        if (acl_calc_mask(acl_p) < 0)
89
 
+                return -errno;
90
 
+
91
 
+        return 0;
92
 
+}
93
 
+
94
 
 int search_acl_groups(char*** dst, const char* path, bool* belong) {
95
 
         acl_t acl;
96
 
 
97
 
diff --git a/src/shared/acl-util.h b/src/shared/acl-util.h
98
 
index 23090d9..36ef490 100644
99
 
--- a/src/shared/acl-util.h
100
 
+++ b/src/shared/acl-util.h
101
 
@@ -24,4 +24,5 @@
102
 
 #include <stdbool.h>
103
 
 
104
 
 int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry);
105
 
+int calc_acl_mask_if_needed(acl_t *acl_p);
106
 
 int search_acl_groups(char*** dst, const char* path, bool* belong);
107
 
diff --git a/src/shared/polkit.c b/src/shared/polkit.c
108
 
index cea7074..1c5e9e3 100644
109
 
--- a/src/shared/polkit.c
110
 
+++ b/src/shared/polkit.c
111
 
@@ -38,12 +38,8 @@ int verify_polkit(
112
 
 
113
 
 #ifdef ENABLE_POLKIT
114
 
         DBusMessage *m = NULL, *reply = NULL;
115
 
-        const char *unix_process = "unix-process", *pid = "pid", *starttime = "start-time", *cancel_id = "";
116
 
+        const char *system_bus_name = "system-bus-name", *name = "name", *cancel_id = "";
117
 
         uint32_t flags = interactive ? 1 : 0;
118
 
-        pid_t pid_raw;
119
 
-        uint32_t pid_u32;
120
 
-        unsigned long long starttime_raw;
121
 
-        uint64_t starttime_u64;
122
 
         DBusMessageIter iter_msg, iter_struct, iter_array, iter_dict, iter_variant;
123
 
         int r;
124
 
         dbus_bool_t authorized = FALSE, challenge = FALSE;
125
 
@@ -68,14 +64,6 @@ int verify_polkit(
126
 
 
127
 
 #ifdef ENABLE_POLKIT
128
 
 
129
 
-        pid_raw = bus_get_unix_process_id(c, sender, error);
130
 
-        if (pid_raw == 0)
131
 
-                return -EINVAL;
132
 
-
133
 
-        r = get_starttime_of_pid(pid_raw, &starttime_raw);
134
 
-        if (r < 0)
135
 
-                return r;
136
 
-
137
 
         m = dbus_message_new_method_call(
138
 
                         "org.freedesktop.PolicyKit1",
139
 
                         "/org/freedesktop/PolicyKit1/Authority",
140
 
@@ -86,22 +74,13 @@ int verify_polkit(
141
 
 
142
 
         dbus_message_iter_init_append(m, &iter_msg);
143
 
 
144
 
-        pid_u32 = (uint32_t) pid_raw;
145
 
-        starttime_u64 = (uint64_t) starttime_raw;
146
 
-
147
 
         if (!dbus_message_iter_open_container(&iter_msg, DBUS_TYPE_STRUCT, NULL, &iter_struct) ||
148
 
-            !dbus_message_iter_append_basic(&iter_struct, DBUS_TYPE_STRING, &unix_process) ||
149
 
+            !dbus_message_iter_append_basic(&iter_struct, DBUS_TYPE_STRING, &system_bus_name) ||
150
 
             !dbus_message_iter_open_container(&iter_struct, DBUS_TYPE_ARRAY, "{sv}", &iter_array) ||
151
 
             !dbus_message_iter_open_container(&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict) ||
152
 
-            !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &pid) ||
153
 
-            !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "u", &iter_variant) ||
154
 
-            !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_UINT32, &pid_u32) ||
155
 
-            !dbus_message_iter_close_container(&iter_dict, &iter_variant) ||
156
 
-            !dbus_message_iter_close_container(&iter_array, &iter_dict) ||
157
 
-            !dbus_message_iter_open_container(&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict) ||
158
 
-            !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &starttime) ||
159
 
-            !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "t", &iter_variant) ||
160
 
-            !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_UINT64, &starttime_u64) ||
161
 
+            !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &name) ||
162
 
+            !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "s", &iter_variant) ||
163
 
+            !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_STRING, &sender) ||
164
 
             !dbus_message_iter_close_container(&iter_dict, &iter_variant) ||
165
 
             !dbus_message_iter_close_container(&iter_array, &iter_dict) ||
166
 
             !dbus_message_iter_close_container(&iter_struct, &iter_array) ||
167
 
diff --git a/units/systemd-tmpfiles-setup-dev.service.in b/units/systemd-tmpfiles-setup-dev.service.in
168
 
index f029285..764da01 100644
169
 
--- a/units/systemd-tmpfiles-setup-dev.service.in
170
 
+++ b/units/systemd-tmpfiles-setup-dev.service.in
171
 
@@ -14,4 +14,5 @@ ConditionCapability=CAP_MKNOD
172
 
 
173
 
 [Service]
174
 
 Type=oneshot
175
 
+RemainAfterExit=yes
176
 
 ExecStart=@rootbindir@/systemd-tmpfiles --prefix=/dev --create