<br><br>On Friday, February 6, 2015, Alexander Sack <<a href="mailto:asac@canonical.com">asac@canonical.com</a>> wrote:<br>> On Thu, Feb 5, 2015 at 7:40 AM, Martin Pitt <<a href="mailto:martin.pitt@ubuntu.com">martin.pitt@ubuntu.com</a>> wrote:<br>>> Hey Jamie,<br>>><br>>> Jamie Strandboge [2015-02-04 12:54 -0600]:<br>>>> On 02/02/2015 04:34 AM, Martin Pitt wrote:<br>>>> >  * Often you don't want the exposed program to have said capability,<br>>>> >    but a daemon. E. g. you have a daemon which talks to the hardware<br>>>> >    and thus needs the privileges, but there is no reason to expose<br>>>> >    that as "public" binary; you only do that for a possible CLI<br>>>> >    control program (which doesn't need the hw access), or possibly<br>>>> >    you don't even have such a CLI program in the first place. And I<br>>>> >    suppose we don't want to force snaps to have to declare their<br>>>> >    internal daemons as binaries, as these should be "services:"?<br>>>> ><br>>>> I'm not sure what you were thinking here, but I'm not sure that matters (see<br>>>> below where I agree with your point). That said, I'll say a few things so we are<br>>>> on the same page.<br>>>><br>>>> A snap need not specify different 'services:' or 'binaries:' for all the<br>>>> binaries it ships. This means that if there is a service that starts on boot, it<br>>>> may call out to any programs in the snap's install dir and inherit the policy of<br>>>> the service.<br>>><br>>> Exactly my point -- I thought we explicitly don't want a .snap to<br>>> explicitly declare "internal" binaries such as daemons or helpers,<br>>> only the user-facing ones. But then something like "add hw access to<br>>> myapp/myprogram" doesn't work if "myprogram" isn't declared in<br>>> binaries: or services: in the first place. Also, we shouldn't care<br>>> which internal binary actually does the hw access, as it should be an<br>>> implementation detail. From the OS' POV the thing that matters is that<br>>> the snap as a whole can access the hardware or not, isn't it?<br>>><br>>>> In this manner, specifying <name>/<service> achieves the goals of<br>>>> giving these helper binaries access.<br>>><br>>> Oh, so you intended this to work even for internal binaries which<br>>> weren't declared in the yaml? (past tense as I think we already agree<br>>> and you also want to make this per-snap now, not per-binary.)<br>><br>> So even if this is temporary, I full agree that we shouldn't go down<br>> to per binary nor per service; just per snap. Ultimately, if an app is<br>> stepping on its own toes and does concurrent access to a device node<br>> that only can have one client at a time, then that's a buggy app. Yes,<br>> maybe giving apps means to protect itself frm its own buggyness and<br>> evilness might make sense, but let's first keep the security and<br>> access contract simple and something focussed to model the system -<br>> app and app - app rules rather than going inside the app itself.<br>><br><br>I think this is what will drive people to do frameworks (or rely on them) in the future.<br><br>> Not sure what the conclusion was, but for assigning a device to an app<br>> would allow all processes that are launched inside the app space<br>> access to it. (e.g. internal, binaries, services doesnt matter). But<br>> let me know if I am missing something.<br><br>That's the general agreement.<br><br>> On general command line XP, I feel hw-add is just the wrong word. In<br>> the end the hw gets either added by the user or the appliance builder<br>> and not by this command, but what this op is doing is really assigning<br>> or granting (exclusive) access:<br>><br>> With both, how about:<br>><br>> $ snappy hw-assign foo /dev/ttyUSB0<br>> $ snappy hw-unassign foo /dev/ttyUSB0<br><br>How about?<br><br>snappy allow foo [resource]<br>snappy disallow foo [resource]<br><br>Feels like simple words even if not one syllable.<br><br>><br>> btw, while we suspect that the above might be a temporary thing and I<br>> sense our real CLI xp will be quite different soon it is not really<br>> true that the above would have to cause problem with repluggin. This<br>> is only a problem if we would safe the devnode path in the acl engine,<br>> while i can fully see this op just being a short hand that under the<br>> hood saves the real identifier of the device class we found and uses<br>> that for set up and potentially reeval the apparmor rules on hotplug<br>> to just do the right thing (TM).<br>><br>>><br>>> Thanks,<br>>><br>>> Martin<br>>><br>>> --<br>>> Martin Pitt                        | <a href="http://www.piware.de">http://www.piware.de</a><br>>> Ubuntu Developer (<a href="http://www.ubuntu.com">www.ubuntu.com</a>)  | Debian Developer  (<a href="http://www.debian.org">www.debian.org</a>)<br>>><br>>> --<br>>> snappy-devel mailing list<br>>> <a href="mailto:snappy-devel@lists.ubuntu.com">snappy-devel@lists.ubuntu.com</a><br>>> Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snappy-devel">https://lists.ubuntu.com/mailman/listinfo/snappy-devel</a><br>>><br>><br>> --<br>> snappy-devel mailing list<br>> <a href="mailto:snappy-devel@lists.ubuntu.com">snappy-devel@lists.ubuntu.com</a><br>> Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snappy-devel">https://lists.ubuntu.com/mailman/listinfo/snappy-devel</a><br>>