Re: [dev] [sdhcp] Part 1/3 Bugs

2018-11-14 Thread Sean MacLennan
On Wed, 14 Nov 2018 17:13:15 -0800
Michael Forney  wrote:

> On 2018-11-12, Sean MacLennan  wrote:
> > I am surprised you are getting away with binding the socket to the
> > broadcast address.  
> 
> I found in ip(7):
> 
> INADDR_BROADCAST (255.255.255.255) means any host and has the same
> effect on bind as INADDR_ANY for historical reasons.
> 
> So that explains why it worked.

Interesting. I obviously hit a case where it doesn't, but that could
be a bug on my side.

> BTW, is there going to be a part 3/3?
> 

Part 3/3 relies heavily on part 1/3 being accepted ;)

Cheers,
   Sean



Re: [dev] [sdhcp] Part 1/3 Bugs

2018-11-14 Thread Michael Forney
On 2018-11-12, Sean MacLennan  wrote:
> I am surprised you are getting away with binding the socket to the
> broadcast address.

I found in ip(7):

INADDR_BROADCAST (255.255.255.255) means any host and has the same
effect on bind as INADDR_ANY for historical reasons.

So that explains why it worked.

BTW, is there going to be a part 3/3?



Re: [dev] GPL free Linux

2018-11-14 Thread Michael Forney
On 2018-11-13, Markus Wichmann  wrote:
> On Mon, Nov 12, 2018 at 01:14:38PM -0800, Michael Forney wrote:
>> Usually how it works is either the display server itself needs to be
>> setuid to open those input devices, or some other program (commonly
>> systemd-logind) needs to open it on its behalf. I believe Xorg with
>> systemd disabled will need to be setuid because of this.
>>
>
> I lack the words to describe how broken I think it is, to make an
> application setuid because you couldn't be arsed to set file permissions
> properly. Or at least, the words to do so in a civilised manner.

Well, you usually don't want just any process to be able to open your
keyboard device and read events from it; just the display server and
only when the VT it is running on is active. This is especially true
on a multi-user system. So, you want opening input devices to be
privileged or federated in some way.

There is also a problem with DRM, since while you can become master
(required for modesetting) implicitly if no other process is master,
you need CAP_SYS_ADMIN to be able to issue the ioctls to drop/regain
master. This makes it impossible to do VT switching properly as
non-root (see https://github.com/mpv-player/mpv/issues/6184 for
example).



Re: [dev] GPL free Linux

2018-11-14 Thread Alessandro Pistocchi
This is very cool :-)

Sent from my iPhone

> On 14 Nov 2018, at 20:37, Kurt Van Dijck  
> wrote:
> 
>> On ma, 12 nov 2018 13:14:38 -0800, Michael Forney wrote:
>> 
>> Xorg seems to work similarly, and you might be able to avoid libudev
>> and retain hotplug support by writing a "netlink" config backend here:
>> https://cgit.freedesktop.org/xorg/xserver/tree/config
> 
> Long ago, I wrote such handler, to remove udev and save 5 seconds boot
> time for an embedded device.
> I'm still using that now on my laptop, never had problems.
> 
> https://github.com/kurt-vd/xorg-server/commit/a569b9972b7dfdbc1b2a53e161ec3e3bcb6195cf
> 
> It comes with a helper program just to add/remove input devices with
> options. That helper is called from any script you like, and you can
> tune options for each device.
> 
> https://gitlab.com/kvandijck/x11hotplug.git
> 
> I found such approach superior over adding direct netlink support to
> xorg, due to the ability to touch the options of each individual device
> before it enters xorg.
> I've seen the xorg syntax to modify device options using udev, what a
> beast!
> 
> Well, I can find my solution superior, I'm looking forward to your
> comments, since you also want to drop udev.
> 
> Kind regards,
> Kurt
> 



Re: [dev] GPL free Linux

2018-11-14 Thread Kurt Van Dijck
On ma, 12 nov 2018 13:14:38 -0800, Michael Forney wrote:
> 
> Xorg seems to work similarly, and you might be able to avoid libudev
> and retain hotplug support by writing a "netlink" config backend here:
> https://cgit.freedesktop.org/xorg/xserver/tree/config

Long ago, I wrote such handler, to remove udev and save 5 seconds boot
time for an embedded device.
I'm still using that now on my laptop, never had problems.

https://github.com/kurt-vd/xorg-server/commit/a569b9972b7dfdbc1b2a53e161ec3e3bcb6195cf

It comes with a helper program just to add/remove input devices with
options. That helper is called from any script you like, and you can
tune options for each device.

https://gitlab.com/kvandijck/x11hotplug.git

I found such approach superior over adding direct netlink support to
xorg, due to the ability to touch the options of each individual device
before it enters xorg.
I've seen the xorg syntax to modify device options using udev, what a
beast!

Well, I can find my solution superior, I'm looking forward to your
comments, since you also want to drop udev.

Kind regards,
Kurt