Claudinei Matos - 2006-09-21

Hi,

I'm using libnss-mysql on my company network since the last year and it works like a charm. Everybody can login from all machines and I have a centralized user database on my mysql server.
Well, from 2 or 3 months ago I'd starded to use an AMD64 machine and since I do use Gentoo, I'm using an almost 64bits installation.
I did installed libnss-mysql-1.5, the first available for amd64 architecture on gentoo portage tree and aparently everything was running fine.
Since the last 3 weeks I started to change my network scheme for users/groups permissions incrementing the number of groups on my system for better control purposes and that's when the problem begins.
Doing a simple "id" command on my 64bits machine has a different result then all the others 32bits machines.
For better understand I will descript an example:

Let's say that we have a user named "alan" and this user has 2 groups:
the default group users (uid 100) on /etc/groups and the group "local" (uid 1001) on mysql.

Following the "id" command process (how I can see on strace log) I now that I have to do 3 type of querys. One for get the user id, one for get all available groups and a third type to check if the user is found on all available groups.

If I do a query on mysql I get the follow:
select name, from groups;
+--------+-------+
| name   | gid   |
+--------+-------+
| local  | 1001  |
| local2 | 1002  |
+--------+-------+
select login from grouplist where gid='1001';
+-------+
| login |
+-------+
| alan  |
+-------+

Well the mysql result on both machines is identical and also on strace log I can see that the user is found on the group, but for any reason the group is not listed on amd64 machine, just on 32bits machines.
amd64 machine output:
uid=1001(alan) gid=100(users) groups=100(users)
and on 32bits machines:
uid=1001(alan) gid=100(users) groups=100(users),1001(local)

What is funny is that if I do add other group to the user on mysql table like the group "local2", the "id" command on amd64 machine will output the follow:
uid=1001(alan) gid=100(users) groups=100(users),1001(local)
and the 32bits:
uid=1001(alan) gid=100(users) groups=100(users),1001(local),1002(local2)

but if I do add a group that just exist on /etc/group, the output on amd64 still the same, offcourse, since it will not look for a group it doesn't have.

I did looked at glibc, coreutils, libnss-mysql and all they are using the same version on all machines (32bits and 64bits).

I also tried to debug the querys executed on the mysql server and I didn't noticed any significant difference between 32bits or 64bits clients.

Debugging libnss-mysql also doesn't output any different result, so I'm absolutelly lost on what to do to solve this problem.

My versions:
libnss-mysql-1.5
glibc-2.4-r3
coreutils-5.94-r1

Another observation is that this problem also occurs on other 2 64bits machines that has glibc-2.3.4-r3 but libnss-mysql-1.5, what makes me belive that it's a 64bits problem only.

Please, if you could give me some tip, or some way to better debug it, I will be so thankfull.

Thanks,

Claudinei Matos