Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 72220 - getent shipped with uClibc does not work with egetent
Summary: getent shipped with uClibc does not work with egetent
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High major
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
: 80550 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-23 04:02 UTC by Benedikt Böhm (RETIRED)
Modified: 2005-07-16 18:00 UTC (History)
2 users (show)

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


Attachments
corrects passwd/group behaviour to look for uid/gid too (getent.dif,782 bytes, patch)
2005-02-02 02:27 UTC, Peter S. Mazinger
Details | Diff
corrects also gid search (getent.dif,830 bytes, patch)
2005-02-02 02:33 UTC, Peter S. Mazinger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benedikt Böhm (RETIRED) gentoo-dev 2004-11-23 04:02:11 UTC
The getent script shipped with uClibc does not work correctly with egetent/enewuser from eutilc eclass.

To find out the next free uid egetent uses `getent passwd xxx`
getent from uClibc uses `string="^\<$2\>:"` which only finds entries at the beginnig of /etc/passwd (usernames) and not uids!


Reproducible: Always
Steps to Reproduce:
1. getent passwd UID
2.
3.

Actual Results:  
mentor root # getent passwd 101 
mentor root # 

Expected Results:  
mentor root # getent passwd 101 
tenshi:x:101:407:added by portage for tenshi:/var/lib/tenshi:/bin/false 
mentor root #
Comment 1 Peter S. Mazinger 2004-12-07 04:02:30 UTC
getent script was based on glibc 2.2.5, using same syntax, options where possible and return codes, due to lack of docu on syntax (man page says almost knowing, I didn't know about that syntax possibility)
`string=":\<$2\>:"` has to be possible too than (along w/ the current implem, but this will have effect on the other options too, where maybe this is not desirable
Comment 2 Peter S. Mazinger 2004-12-07 04:04:24 UTC
the change is necessary for group too
Comment 3 solar (RETIRED) gentoo-dev 2005-01-30 11:51:54 UTC
any in the mood to code an update for this?
Comment 4 SpanKY gentoo-dev 2005-01-30 11:56:40 UTC
i looked at it a while back but it's not a quick fix and i gave up after some minutes of hacking on it
Comment 5 Peter S. Mazinger 2005-02-02 02:27:23 UTC
Created attachment 50203 [details, diff]
corrects passwd/group behaviour to look for uid/gid too
Comment 6 Peter S. Mazinger 2005-02-02 02:33:24 UTC
Created attachment 50204 [details, diff]
corrects also gid search
Comment 7 solar (RETIRED) gentoo-dev 2005-02-02 06:18:41 UTC
I've put this in cvs at uclibc.org
Comment 8 Aurélien Francillon 2005-02-03 07:29:29 UTC
*** Bug 80550 has been marked as a duplicate of this bug. ***
Comment 9 Milan Holzäpfel 2005-07-16 07:55:26 UTC
I fixed this for myself temporarily by replacing 

| getent "$1" "$2"

with 

| egrep  "^(($2:)|([^:]*:[^:]*:$2:))" /etc/$1

in eutils.eclass, which is of course an extremely dirty solution :) 

I'm posting it just in case it might be of any help for anyone. 

Regards,
Milan
Comment 10 SpanKY gentoo-dev 2005-07-16 18:00:05 UTC
merged getent patch from svn back into our current uclibc ebuild patchset