[systemd-devel] Patch for Smack labelling support in udev

Kay Sievers kay at vrfy.org
Tue Jul 9 07:03:16 PDT 2013


On Tue, Jul 9, 2013 at 3:47 PM, Reshetova, Elena
<elena.reshetova at intel.com> wrote:
> Does the attached patch look better? I have fixed the sequence of xattr
> processing (now just after uid, gid, mode and etc.) + switched to use a list
> for collecting the xattrs.
> I think it is more generic to allow many xattrs to be set for one node, since
> it is normal use case.

> @@ -252,11 +256,13 @@ void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev
>          }
> }
>
> -static int node_permissions_apply(struct udev_device *dev, bool apply, mode_t mode, uid_t uid, gid_t gid)
> +static int node_permissions_apply(struct udev_device *dev, bool apply, mode_t mode,
> +                                  uid_t uid, gid_t gid, struct udev_list xattr_list)

Guess we better pass the udev_list as a const pointer here.

> @@ -288,13 +294,28 @@ static int node_permissions_apply(struct udev_device *dev, bool apply, mode_t mo
>                  label_fix(devnode, true, false);
>          }
>
> +        udev_list_entry_foreach(xattr_entry, &xattr_list) {

Does that really work with the non-pointer, seems a bit odd that way?

> @@ -2307,6 +2323,24 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
>                                    rules_str(rules, rule->rule.filename_off),
>                                    rule->rule.filename_line);
>                          break;
> +               case TK_A_XATTR: {
> +                        struct udev_list_entry *xattr_entry;

This seems unused.

Kay


More information about the systemd-devel mailing list