summaryrefslogtreecommitdiff
path: root/src/udev/udev-node.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-03-05 04:01:34 +0900
committerLennart Poettering <lennart@poettering.net>2019-03-05 09:27:29 +0100
commit39a15c8a8dad26deda140867f03e44a535b7bd8d (patch)
tree1afd5a9d50431156b5b8e4078983fd024a8c267b /src/udev/udev-node.c
parent0dcb426328b16cb1f59b2bf3e8d6f51805442abf (diff)
downloadsystemd-39a15c8a8dad26deda140867f03e44a535b7bd8d.tar.gz
systemd-39a15c8a8dad26deda140867f03e44a535b7bd8d.tar.bz2
systemd-39a15c8a8dad26deda140867f03e44a535b7bd8d.zip
udev: run programs in the specified order
This fixes bugs introduced by 29448498c724da7ade1b5efb20d7472c1b128d2c and d838e14515c82b05a07f2bf393cce057b45b2b53. Previously, RUN and SECLABEL keys are stored in udev_list with its unique flag is false. If the flag is false, then udev_list is just a linked list and new entries are always added in the last. So, we should use OrderedHashmap instead of Hashmap. Fixes #11368.
Diffstat (limited to 'src/udev/udev-node.c')
-rw-r--r--src/udev/udev-node.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index 1c00dd1e9e..cfbbd7b283 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -272,7 +272,7 @@ int udev_node_update_old_links(sd_device *dev, sd_device *dev_old) {
static int node_permissions_apply(sd_device *dev, bool apply,
mode_t mode, uid_t uid, gid_t gid,
- Hashmap *seclabel_list) {
+ OrderedHashmap *seclabel_list) {
const char *devnode, *subsystem, *id_filename = NULL;
struct stat stats;
dev_t devnum;
@@ -318,7 +318,7 @@ static int node_permissions_apply(sd_device *dev, bool apply,
log_device_debug(dev, "Preserve permissions of %s, %#o, uid=%u, gid=%u", devnode, mode, uid, gid);
/* apply SECLABEL{$module}=$label */
- HASHMAP_FOREACH_KEY(label, name, seclabel_list, i) {
+ ORDERED_HASHMAP_FOREACH_KEY(label, name, seclabel_list, i) {
int q;
if (streq(name, "selinux")) {
@@ -386,7 +386,7 @@ static int xsprintf_dev_num_path_from_sd_device(sd_device *dev, char **ret) {
int udev_node_add(sd_device *dev, bool apply,
mode_t mode, uid_t uid, gid_t gid,
- Hashmap *seclabel_list) {
+ OrderedHashmap *seclabel_list) {
const char *devnode, *devlink;
_cleanup_free_ char *filename = NULL;
int r;