udev: run programs in the specified order
This fixes bugs introduced by29448498c7andd838e14515. 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.
This commit is contained in:
committed by
Lennart Poettering
parent
0dcb426328
commit
39a15c8a8d
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user