Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 458114 - sys-apps/gradm - Change udev actions in patches and ebuild
Summary: sys-apps/gradm - Change udev actions in patches and ebuild
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-18 12:56 UTC by Marvin Vek
Modified: 2013-03-24 13:07 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
[PATCH] Change udev actions in patches and ebuild (gradm-udev_fix.patch,2.93 KB, patch)
2013-02-18 12:58 UTC, Marvin Vek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marvin Vek 2013-02-18 12:56:07 UTC
Directory /lib/udev will be created on non-udev systems, and the ebuild tries to run udevadm without checking if it even exists. So, i wrote a small patch fixing this behavior..

[PATCH] Change udev actions in patches and ebuild

The original Makefile checks for an existing /etc/udev (or /lib/udev
after the patches), and will and should only install the udev rules if
it exists (udev rules without udev, or making a path and then checking if it exists, is both rather useless).

Additionally fixed an eclass function, eclass stated it was deprecated.

Reproducible: Always

Steps to Reproduce:
1. Have a system without udev installed (or eudev for that matter, mdev will do).
2. Remove directory /lib/udev completely.
3. Finally, emerge gradm.
Actual Results:  
See the error when it reaches the final stage of the emerge (install) for udevadm not existing, and see there's now a /lib/udev directory that wasn't there before.

Expected Results:  
No error, no attempt to run udevadm, no /lib/udev.
Comment 1 Marvin Vek 2013-02-18 12:58:38 UTC
Created attachment 339240 [details, diff]
[PATCH] Change udev actions in patches and ebuild
Comment 2 Anthony Basile gentoo-dev 2013-02-18 18:42:53 UTC
(In reply to comment #1)
> Created attachment 339240 [details, diff] [details, diff]
> [PATCH] Change udev actions in patches and ebuild

udevadm trigger --action=add --sysname-match=grsec does not create /dev/grsec anymore.  Try it.  I'm going to remove that from the next rev bump.  Can you test for me at your end and see if I'm right on this point.
Comment 3 Marvin Vek 2013-02-18 23:29:50 UTC
(In reply to comment #2)
> udevadm trigger --action=add --sysname-match=grsec does not create
> /dev/grsec anymore.  Try it.  I'm going to remove that from the next rev
> bump.  Can you test for me at your end and see if I'm right on this point.

Still have a machine booting with udev, was able to try (and I'm afraid I can't confirm your expectations):

# rm /dev/grsec
# file /dev/grsec
/dev/grsec: ERROR: cannot open `/dev/grsec' (No such file or directory)
# udevadm trigger --action=add --sysname-match=grsec
# file /dev/grsec
/dev/grsec: character special
Comment 4 Anthony Basile gentoo-dev 2013-02-19 01:41:11 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > udevadm trigger --action=add --sysname-match=grsec does not create
> > /dev/grsec anymore.  Try it.  I'm going to remove that from the next rev
> > bump.  Can you test for me at your end and see if I'm right on this point.
> 
> Still have a machine booting with udev, was able to try (and I'm afraid I
> can't confirm your expectations):
> 
> # rm /dev/grsec
> # file /dev/grsec
> /dev/grsec: ERROR: cannot open `/dev/grsec' (No such file or directory)
> # udevadm trigger --action=add --sysname-match=grsec
> # file /dev/grsec
> /dev/grsec: character special

What version of udev?
Comment 5 Marvin Vek 2013-02-19 18:51:50 UTC
(In reply to comment #4)
> What version of udev?

That was 171-r9. Release 171-r10 that I just installed pulled in sys-apps/makedev-3.23.1 and sys-fs/static-dev-0.1, but that yielded the same result.

Now, release sys-fs/udev-197-r8 (build without USE=kmod) pulled in sys-fs/udev-init-scripts-23, /etc/init.d/udev-postmount disappeared, I can confirm that udevadm doesn't create the /dev/grsec anymore.
Comment 6 Anthony Basile gentoo-dev 2013-03-24 13:07:06 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > What version of udev?
> 
> That was 171-r9. Release 171-r10 that I just installed pulled in
> sys-apps/makedev-3.23.1 and sys-fs/static-dev-0.1, but that yielded the same
> result.
> 
> Now, release sys-fs/udev-197-r8 (build without USE=kmod) pulled in
> sys-fs/udev-init-scripts-23, /etc/init.d/udev-postmount disappeared, I can
> confirm that udevadm doesn't create the /dev/grsec anymore.

Since udev will not create device nodes anymore, its time to just drop udevadm from the ebuild which I did in -r1.

I'm not so sure about not creating /lib/udev.  I uderstand that its not used on a system without udev, but if one were ever to install udev after gradm, there would be a missing component.  We'd have to introduce a USE flag to control this behaviour (eg USE="-udev" emerge gradm), and I'm inclined not to do that.

If you feel strongly about it, reopen the bug with a patch and give me a rational.