Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cannot find username for UID
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
kderichs
n00b
n00b


Joined: 19 Jan 2004
Posts: 7

PostPosted: Mon Jan 19, 2004 10:39 pm    Post subject: cannot find username for UID Reply with quote

Hi everybody,
when I log into my system as any user but root I get the message "cannot find username for UID xxxx". Furthermore if I do a ls -la as a non-root user it dosen't show the username but only it's ID.
I digged up a few threads but they don't seem to fit to my problem. The passwd is worldreadable and the /etc/nsswitch.conf seems to be ok as well.

    bash-2.05b# su - kderichs
    /usr/bin/whoami: cannot find username for UID 1003
    -bash: [: =: unary operator expected
    I have no name!@kderichs-lx1 kderichs $ ll /etc/passwd
    -rw--w--w- 1 0 root 1993 Jan 19 21:28 /etc/passwd
    I have no name!@kderichs-lx1 kderichs $ exit
    logout
    bash-2.05b# whoami
    root
    bash-2.05b# ll /etc/passwd
    -rw--w--w- 1 root root 1993 Jan 19 21:28 /etc/passwd

The strace output for the whoami (executed as user kderichs)
Quote:
open("/etc/passwd", O_RDONLY) = -1 EACCES (Permission denied)
write(2, "whoami: cannot find username for"..., 42whoami: cannot find username for UID 1003
) = 42
_exit(1)


What I did:
To emerge a masked package I changed my /etc/make.conf to
Quote:
ACCEPT_KEYWORDS="~x86"

After that I started
Code:
emerge system

and while this was running
Code:
emerge --fetchonly world

when the emerge system finished the output said to run a script to update the installed dev-perl modules (sorry but I forgot it's name). I run this script and something strange happend. It run 2 passe only over the perl modules and during the 3rd pass it started to emerge all pakages, which were downloaded by the emerge fetchonly. I didn't give much thought and went on to setup my box. I added another user and the UID problem showd up.
Another problem that might be realated if I do
emerge a
emerge b
it sometimes happens that while running emerge b at the the were it says
>>> merge b to /
all file of emerge a are again move to /

I hope that someone can help and I would like to say thanks in advance.
Kurt
Back to top
View user's profile Send private message
kderichs
n00b
n00b


Joined: 19 Jan 2004
Posts: 7

PostPosted: Mon Jan 19, 2004 11:05 pm    Post subject: Reply with quote

hi,
after looking around a bit I found another problem:
Some file under /dev belong to whatever user logged in first after a boot. these are
    /dev/fb/0
    /dev/vc/1
    /dev/ide/host0/bus0/target1/lun0/cd
    /dev/ide/host0/bus1/target1/lun0/cd
    /dev/sound/adsp
    /dev/sound/dsp
    /dev/sound/audio
    /dev/sound/mixer
    /dev/snd/controlC0
    /dev/snd/timer
    /dev/snd/pcmC0D2p
    /dev/snd/pcmC0D2c
    /dev/snd/pcmC0D1p
    /dev/snd/pcmC0D0p
    /dev/snd/pcmC0D0c
    /dev/gpmctl
    /dev/floppy/0u1440
    /dev/floppy/0u1680
    /dev/floppy/0u1722
    /dev/floppy/0u1743
    /dev/floppy/0u1760
    /dev/floppy/0u1920
    /dev/floppy/0u1840
    /dev/floppy/0u1600
    /dev/floppy/0u360
    /dev/floppy/0u720
    /dev/floppy/0u820
    /dev/floppy/0u830
    /dev/floppy/0u1040
    /dev/floppy/0u1120
    /dev/floppy/0u800
    /dev/floppy/0

As the strace says permission denied, I thought this might give you another hint.
Thanks again
Kurt
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Tue Jan 20, 2004 12:37 pm    Post subject: Re: cannot find username for UID Reply with quote

kderichs wrote:
I have no name!@kderichs-lx1 kderichs $ ll /etc/passwd
-rw--w--w- 1 0 root 1993 Jan 19 21:28 /etc/passwd
I have no name!@kderichs-lx1 kderichs $ exit
logout
bash-2.05b# whoami
root
bash-2.05b# ll /etc/passwd
-rw--w--w- 1 root root 1993 Jan 19 21:28 /etc/passwd[/list]
The strace output for the whoami (executed as user kderichs)
Quote:
open("/etc/passwd", O_RDONLY) = -1 EACCES (Permission denied)
write(2, "whoami: cannot find username for"..., 42whoami: cannot find username for UID 1003
) = 42
_exit(1)



Looks like the permissions are wrong for /etc/passwd they are world-writable on your system. They should be world-readable. Try

Code:
chmod 644 /etc/passwd


The stuff in /dev isn't relevant. Basically certain devices are chowned to the first user who logs in, then chowned back to what it says in /etc/security/console.perms when they log out again.

HTH
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
kderichs
n00b
n00b


Joined: 19 Jan 2004
Posts: 7

PostPosted: Wed Jan 21, 2004 9:17 am    Post subject: Reply with quote

Thanks for the answer. I never actually entered the command because the ls showed that the permissons were right. Now it's working again. Thanks!!
What I can't understand is how it's possible that the ls shows the wrong permission. Any ideas?
Kurt
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Wed Jan 21, 2004 12:55 pm    Post subject: Reply with quote

It could be a misconfigured ebuild, but usually it's down to mistyping something as root.
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum