Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 43151 - udev: /dev/null regular file, wrong permissions.
Summary: udev: /dev/null regular file, wrong permissions.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-27 18:25 UTC by Aaron Gyes
Modified: 2004-06-05 22:01 UTC (History)
2 users (show)

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


Attachments
udev-019-unlink-existing.patch (udev-019-unlink-existing.patch,1.92 KB, patch)
2004-02-28 16:21 UTC, Martin Schlemmer (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Gyes 2004-02-27 18:25:53 UTC
I've been using a 'pure' udev setup for quite a while now, and for the last month or two, my /dev/null appears to be just a regular file. It's full of junk that's been >'d there, which I'm sure is a security issue. It is also not using the permissions set in udev.permissions. All other nodes appear to be in fine working order.
( floam@Aluminum ~ ) ll /dev/null
-rw-r--r--    1 root     root            0 Feb 27 18:06 /dev/null

If I dump the udev db, it appears it knows what should be happening:
P: /class/mem/null
N: null
M: 0666
S:
O: root
G: root

Could something be overwritting it?
Comment 1 Aaron Gyes 2004-02-27 18:35:16 UTC
Actually, :s/last month or two/last week or two/. It just feels like a long time.
Comment 2 Ian Weber 2004-02-27 20:24:29 UTC
I'm getting this issue too. Using mknod to create the node statically works but as you'd expect, it'll disappear at the next reboot. I've tried creating an additional rule in udev.rules but no dice there either.
Comment 3 SpanKY gentoo-dev 2004-02-27 21:02:40 UTC
if you setup udev incorrectly when first utilized this could have cropped up then ...

if you do this does it still come back ?
rm /dev/null
mknod /dev/null c 1 3
reboot

if so, try this:
rm /dev/null
mknod /dev/null c 1 3
tar -jclpf /lib/udev-state/devices.tar.bz2
reboot
Comment 4 Aaron Gyes 2004-02-27 21:19:52 UTC
Spanky: No, because I am using a "pure" udev system. (No devices tarball, turned off in /etc/conf.d/rc.) Everything is generated on boot.
Comment 5 Aaron Gyes 2004-02-27 21:22:35 UTC
(I am very sure it work work fine if I used a device tarball, but in my mind a static /dev/ defeats part of the purpose of udev.)
Comment 6 SpanKY gentoo-dev 2004-02-27 21:25:08 UTC
are you using the rcscript run in parallel option ?
Comment 7 Aaron Gyes 2004-02-27 21:30:38 UTC
I was until two days ago, but feared something may have been writing to /dev/null before it existed. Parallel has been off for about two days and it made no difference.
Comment 8 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-27 21:36:04 UTC
 # ln -snf ../../../sbin/udev /etc/hotplug.d/default/udev.hotplug

and reboot - see if that fixes it?
Comment 9 Aaron Gyes 2004-02-27 21:53:12 UTC
Zero change.
Comment 10 Aaron Gyes 2004-02-27 21:55:28 UTC
Should I revert back, or is it safe be using /sbin/udev instead?
Comment 11 Michael C. Ferguson 2004-02-28 09:23:38 UTC
This issue just appeared on my system too (and caused some other strange problems,
like portmap and sshd not starting). I've also been running a "pure" udev setup
for about a week now, and just this morning the problem occured. I'm not sure
what I could have done that would have caused it... perhaps the initscripts should
automatically create /dev/null and /dev/console every boot 'just to be sure'?

Also, RC_PARALLEL_STARTUP="no", and basically everything else is in a pretty 
generic configuration.
Comment 12 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-28 16:21:58 UTC
Created attachment 26542 [details, diff]
udev-019-unlink-existing.patch

Remove all files before creating nodes/symlinks.
Comment 13 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-28 16:25:10 UTC
Basically null gets touched after /dev is mounted, but *before* the nodes
is created, and as /dev/null is then a file, udev do not remove it and replace
with corret node.  Patch fix this.

Anyhow, floam tested this, and its in 019-r1.

Comment 14 Aaron Gyes 2004-02-28 16:28:23 UTC
As said on IRC, patch works like a charm here.
Comment 15 Aaron Gyes 2004-02-28 16:29:30 UTC
Oops, should learn to not wait 3 minutes between typing and clicking Commit.
Comment 16 John Nilsson 2004-05-31 14:58:48 UTC
I'm having issues with this also.

Description:

1. I boot the computer and gdm starts.
2. Change to vt/1 and login as root.
3. ls -la /dev/null
root:root 666
4. logout
5. Change to vt/7 and login as my user
6. Change to vt/2 and login as another user
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
...
7. Change to vt/1 and login as root
8. ls -la /dev/null
<my user>:root 660


Variations:
step 6. With gdmflexiserver instead (vt/8) gnome crashes.
step 8 and/or 3. result: <myuser>:floppy 660


System:

RC_DEVICE_TARBALL="no"
sys-fs/udev-025-r1
sys-kernel/gentoo-dev-sources-2.6.5-r1
sys-apps/baselayout-1.8.12



Any tip on how to catch the process changing ownerships?
Comment 17 John Nilsson 2004-05-31 21:38:44 UTC
I don't know if it's related but this shows up in my log:

Jun  1 06:32:10 xxxx (xxxx-32486): iid OAFIID:BrokenNoType:20000808 has a NULL type
Jun  1 06:32:10 xxxx (xxxx-32486): invalid character '#' in iid 'OAFIID:This#!!%$iid%^$%_|~!OAFIID_ContainsBadChars'
Jun  1 06:32:13 xxxx (xxxx-32486): iid OAFIID:BrokenNoType:20000808 has a NULL type
Jun  1 06:32:13 xxxx (xxxx-32486): invalid character '#' in iid 'OAFIID:This#!!%$iid%^$%_|~!OAFIID_ContainsBadChars'

where 32486 = /usr/libexec/bonobo-activation-server --ac-activate --ior-output-fd=18
Comment 18 John Nilsson 2004-06-05 22:01:32 UTC
It wasn't related. I had a line with /dev/fd/0 in /etc/fstab which didn't play well with pam_console.