Re: [systemd-devel] Failed to apply ACLs: Invalid argument

2017-07-20 Thread Matwey V. Kornilov
2017-07-20 11:05 GMT+03:00 Lennart Poettering :
> On Thu, 20.07.17 10:45, Matwey V. Kornilov (matwey.korni...@gmail.com) wrote:
>
>> > I suspect 21d6220fe0bf24fda7df9833961e022cafa439bc will fix my issue.
>> > I will check tomorrow.
>>
>> I've just found that
>>
>> sd_device_new_from_subsystem_sysname returns -22 for parport_pc
>> device, because subsys variable has no ':' and driver == NULL which
>> leads to -EINVAL in systemd v228.
>
> And did 21d6220fe0bf24fda7df9833961e022cafa439bc fix the issue for
> you? Is this still a problem on more current versions?

Yes, it helped. Seemingly, this needs to be backported to openSUSE's v228.

>
> Lennart
>
> --
> Lennart Poettering, Red Hat



-- 
With best regards,
Matwey V. Kornilov
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Failed to apply ACLs: Invalid argument

2017-07-20 Thread Lennart Poettering
On Thu, 20.07.17 10:45, Matwey V. Kornilov (matwey.korni...@gmail.com) wrote:

> > I suspect 21d6220fe0bf24fda7df9833961e022cafa439bc will fix my issue.
> > I will check tomorrow.
> 
> I've just found that
> 
> sd_device_new_from_subsystem_sysname returns -22 for parport_pc
> device, because subsys variable has no ':' and driver == NULL which
> leads to -EINVAL in systemd v228.

And did 21d6220fe0bf24fda7df9833961e022cafa439bc fix the issue for
you? Is this still a problem on more current versions?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Failed to apply ACLs: Invalid argument

2017-07-19 Thread Matwey V. Kornilov
2017-07-19 15:12 GMT+03:00 Matwey V. Kornilov :
> 2017-07-19 13:32 GMT+03:00 Matwey V. Kornilov :
>> 2017-07-19 13:10 GMT+03:00 Matwey V. Kornilov :
>>> 2017-07-19 12:47 GMT+03:00 Lennart Poettering :
 On Wed, 19.07.17 12:38, Matwey V. Kornilov (matwey.korni...@gmail.com) 
 wrote:

> This is all that is relevant to Invalid Argument errno in strace:
>
 [...]
> readlinkat(AT_FDCWD, "/sys/module/parport", 0x55d7a4d5d940, 99) = -1
> EINVAL (Invalid argument)

 realinkat() returns EINVAL when invoked on a non-symlinks. It's not a
 real error, just a way to report that mismatch.

> drwxr-xr-x 3 root root 0 июл 19 12:35 
> /sys/devices/virtual/input/input7/event7
> drwxr-xr-x 5 root root 0 июл 19 12:31 /sys/module/parport
> drwxr-xr-x 7 root root 0 июл 19 12:33 /sys/module/parport_pc
>
> It is brand-new openSUSE 42.2 installation. No selinux or something like 
> that.

 Not sure what else I can suggest then, except attaching gdb to logind
 and check what happens when you switch VTs... it should be sufficient
 to set a breakpoint onto devnode_acl_all() and wait until it gets
 triggered, and then follow the code until you see EINVAL thrown.

 Unless you know gdb well enough you shouldn't attempt that though...

>>>
>>> Ok, it is udev_enumerate_scan_devices who returns -22
>>
>> Now I see that something wrong happens inside
>>
>> enumerator_scan_devices_children
>>
>> at
>>
>> sd_device_get_syspath
>>
>
> k = sd_device_new_from_device_id(, dent->d_name);
>
> inside enumerator_scan_devices_tag() returns -22 for some entry.

I suspect 21d6220fe0bf24fda7df9833961e022cafa439bc will fix my issue.
I will check tomorrow.

>
>>
>>>
 Lennart

 --
 Lennart Poettering, Red Hat
>>>
>>>
>>>
>>> --
>>> With best regards,
>>> Matwey V. Kornilov
>>
>>
>>
>> --
>> With best regards,
>> Matwey V. Kornilov
>
>
>
> --
> With best regards,
> Matwey V. Kornilov



-- 
With best regards,
Matwey V. Kornilov
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Failed to apply ACLs: Invalid argument

2017-07-19 Thread Matwey V. Kornilov
2017-07-19 13:32 GMT+03:00 Matwey V. Kornilov :
> 2017-07-19 13:10 GMT+03:00 Matwey V. Kornilov :
>> 2017-07-19 12:47 GMT+03:00 Lennart Poettering :
>>> On Wed, 19.07.17 12:38, Matwey V. Kornilov (matwey.korni...@gmail.com) 
>>> wrote:
>>>
 This is all that is relevant to Invalid Argument errno in strace:

>>> [...]
 readlinkat(AT_FDCWD, "/sys/module/parport", 0x55d7a4d5d940, 99) = -1
 EINVAL (Invalid argument)
>>>
>>> realinkat() returns EINVAL when invoked on a non-symlinks. It's not a
>>> real error, just a way to report that mismatch.
>>>
 drwxr-xr-x 3 root root 0 июл 19 12:35 
 /sys/devices/virtual/input/input7/event7
 drwxr-xr-x 5 root root 0 июл 19 12:31 /sys/module/parport
 drwxr-xr-x 7 root root 0 июл 19 12:33 /sys/module/parport_pc

 It is brand-new openSUSE 42.2 installation. No selinux or something like 
 that.
>>>
>>> Not sure what else I can suggest then, except attaching gdb to logind
>>> and check what happens when you switch VTs... it should be sufficient
>>> to set a breakpoint onto devnode_acl_all() and wait until it gets
>>> triggered, and then follow the code until you see EINVAL thrown.
>>>
>>> Unless you know gdb well enough you shouldn't attempt that though...
>>>
>>
>> Ok, it is udev_enumerate_scan_devices who returns -22
>
> Now I see that something wrong happens inside
>
> enumerator_scan_devices_children
>
> at
>
> sd_device_get_syspath
>

k = sd_device_new_from_device_id(, dent->d_name);

inside enumerator_scan_devices_tag() returns -22 for some entry.

>
>>
>>> Lennart
>>>
>>> --
>>> Lennart Poettering, Red Hat
>>
>>
>>
>> --
>> With best regards,
>> Matwey V. Kornilov
>
>
>
> --
> With best regards,
> Matwey V. Kornilov



-- 
With best regards,
Matwey V. Kornilov
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Failed to apply ACLs: Invalid argument

2017-07-19 Thread Matwey V. Kornilov
2017-07-19 13:10 GMT+03:00 Matwey V. Kornilov :
> 2017-07-19 12:47 GMT+03:00 Lennart Poettering :
>> On Wed, 19.07.17 12:38, Matwey V. Kornilov (matwey.korni...@gmail.com) wrote:
>>
>>> This is all that is relevant to Invalid Argument errno in strace:
>>>
>> [...]
>>> readlinkat(AT_FDCWD, "/sys/module/parport", 0x55d7a4d5d940, 99) = -1
>>> EINVAL (Invalid argument)
>>
>> realinkat() returns EINVAL when invoked on a non-symlinks. It's not a
>> real error, just a way to report that mismatch.
>>
>>> drwxr-xr-x 3 root root 0 июл 19 12:35 
>>> /sys/devices/virtual/input/input7/event7
>>> drwxr-xr-x 5 root root 0 июл 19 12:31 /sys/module/parport
>>> drwxr-xr-x 7 root root 0 июл 19 12:33 /sys/module/parport_pc
>>>
>>> It is brand-new openSUSE 42.2 installation. No selinux or something like 
>>> that.
>>
>> Not sure what else I can suggest then, except attaching gdb to logind
>> and check what happens when you switch VTs... it should be sufficient
>> to set a breakpoint onto devnode_acl_all() and wait until it gets
>> triggered, and then follow the code until you see EINVAL thrown.
>>
>> Unless you know gdb well enough you shouldn't attempt that though...
>>
>
> Ok, it is udev_enumerate_scan_devices who returns -22

Now I see that something wrong happens inside

enumerator_scan_devices_children

at

sd_device_get_syspath


>
>> Lennart
>>
>> --
>> Lennart Poettering, Red Hat
>
>
>
> --
> With best regards,
> Matwey V. Kornilov



-- 
With best regards,
Matwey V. Kornilov
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Failed to apply ACLs: Invalid argument

2017-07-19 Thread Matwey V. Kornilov
2017-07-19 12:47 GMT+03:00 Lennart Poettering :
> On Wed, 19.07.17 12:38, Matwey V. Kornilov (matwey.korni...@gmail.com) wrote:
>
>> This is all that is relevant to Invalid Argument errno in strace:
>>
> [...]
>> readlinkat(AT_FDCWD, "/sys/module/parport", 0x55d7a4d5d940, 99) = -1
>> EINVAL (Invalid argument)
>
> realinkat() returns EINVAL when invoked on a non-symlinks. It's not a
> real error, just a way to report that mismatch.
>
>> drwxr-xr-x 3 root root 0 июл 19 12:35 
>> /sys/devices/virtual/input/input7/event7
>> drwxr-xr-x 5 root root 0 июл 19 12:31 /sys/module/parport
>> drwxr-xr-x 7 root root 0 июл 19 12:33 /sys/module/parport_pc
>>
>> It is brand-new openSUSE 42.2 installation. No selinux or something like 
>> that.
>
> Not sure what else I can suggest then, except attaching gdb to logind
> and check what happens when you switch VTs... it should be sufficient
> to set a breakpoint onto devnode_acl_all() and wait until it gets
> triggered, and then follow the code until you see EINVAL thrown.
>
> Unless you know gdb well enough you shouldn't attempt that though...
>

Ok, it is udev_enumerate_scan_devices who returns -22

> Lennart
>
> --
> Lennart Poettering, Red Hat



-- 
With best regards,
Matwey V. Kornilov
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Failed to apply ACLs: Invalid argument

2017-07-19 Thread Lennart Poettering
On Wed, 19.07.17 12:38, Matwey V. Kornilov (matwey.korni...@gmail.com) wrote:

> This is all that is relevant to Invalid Argument errno in strace:
>
[...]
> readlinkat(AT_FDCWD, "/sys/module/parport", 0x55d7a4d5d940, 99) = -1
> EINVAL (Invalid argument)

realinkat() returns EINVAL when invoked on a non-symlinks. It's not a
real error, just a way to report that mismatch.

> drwxr-xr-x 3 root root 0 июл 19 12:35 /sys/devices/virtual/input/input7/event7
> drwxr-xr-x 5 root root 0 июл 19 12:31 /sys/module/parport
> drwxr-xr-x 7 root root 0 июл 19 12:33 /sys/module/parport_pc
> 
> It is brand-new openSUSE 42.2 installation. No selinux or something like that.

Not sure what else I can suggest then, except attaching gdb to logind
and check what happens when you switch VTs... it should be sufficient
to set a breakpoint onto devnode_acl_all() and wait until it gets
triggered, and then follow the code until you see EINVAL thrown.

Unless you know gdb well enough you shouldn't attempt that though...

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Failed to apply ACLs: Invalid argument

2017-07-19 Thread Lennart Poettering
On Tue, 18.07.17 16:28, Matwey V. Kornilov (matwey.korni...@gmail.com) wrote:

> Hello,
> 
> I am running systemd 228. And one one particular system installation
> there are messages 'Failed to apply ACLs: Invalid argument' from
> systemd-logind. Moreover, ACL on /dev/dri/* are not set correctly
> after user log in. How could I figure out which argument is invalid?
> Managing ACLs on /dev filesystem using setfacl works fine. I've tried
> using debug log_level, but nothing helpful here:

No idea, but I'd recommend strace'ing logind when this happens, and
tracking looking for relevant operations on the device nodes...

logind doesn't do anything particularly magic... We just invoke
libacl, and normally libacl should validate enough what we pass
there...

do you use any MAC or so? selinux? smack? apparmor?

Do you any non-standard UIDs? i.e. 65535 or so?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel