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

Reshetova, Elena elena.reshetova at intel.com
Tue Jul 9 07:34:32 PDT 2013


> -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.

Ups, sorry, missed this one, of course it won't even work this way (I haven't 
tried to run it yet - I am setting the environment right now since I don't 
have systemd-powered machine as a host).
Here is the fixed patch with the unused part removed also.

Best Regards,
Elena.



-----Original Message-----
From: Kay Sievers [mailto:kay at vrfy.org]
Sent: Tuesday, July 09, 2013 5:03 PM
To: Reshetova, Elena
Cc: Lennart Poettering; systemd-devel at lists.freedesktop.org; Ware, Ryan R; 
Schaufler, Casey; walyong.cho at samsung.com
Subject: Re: [systemd-devel] Patch for Smack labelling support in udev

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Adding-extended-attribute-support-for-udev-nodes-lab.patch
Type: application/octet-stream
Size: 10164 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130709/0567981c/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7220 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130709/0567981c/attachment-0001.bin>


More information about the systemd-devel mailing list