Skip to contentSkip to conversation

idmapd client-side static mapping

DISCUSSION Jiri Horky 3 participants 3 messages Jul 12, 2012 – Jul 22, 2012

Subsystems (2)
lore
Share & tools
lore

Jiri Horky

author
#0 lore raw

Hi,

man pages for idmapd.conf states possibility to use Static mapping. Looking at the source code of libnfsidmap v0.24, it is clear that static mappings are only valid for server side (svcgssd) which the man page forgets to mention. Is there any specific reason why not to implement the static resolution functions on the client side as well?

I would send a patch if there is a change it will be accepted.

Regards
Jiri Horky

#1 lore raw
Quoted 3 lines · Jiri Horky

Hi,

man pages for idmapd.conf states possibility to use Static mapping. Looking at the source code of libnfsidmap v0.24, it is clear that static mappings are only valid for server side (svcgssd) which the man page forgets to mention. Is there any specific reason why not to implement the static resolution functions on the client side as well?

That is a good question... I always wonders this myself....

Quoted 2 lines

I would send a patch if there is a change it will be accepted.

There is only one way to find out! ;-)

steved.

#2 lore raw

Hi,

I sent the patch in the separated email and now I hope for the best :)

Some more notes: if one configures only the "Static" translation method nowadays, any translation of id to name does not occur (since it is not implemented), return code of the nfs4_uid_to_name() function will be 0 which is set by init function in libnfsidmap.c:357 and you get empty string as the result which puzzles the client and completely freezes the system. It can be triggered by e.g. issuing "chown 1000 /nfs4mnt/testfile". I think that more correct behavior would be to return -ENOENT if there are no plugins with a given translation function. This is not included in the patch sent.

By the way, is there a reason why the function like nfs4_name_to_uid or its "gid" partner does not return "nobody/nogroup" when it fails to do the translation? On my system, it is set to a random value (uninitialized int) in this case.

Jiri Horky

Quoted 10 lines · Steve Dickson
Quoted 3 lines · Jiri Horky

Hi,

man pages for idmapd.conf states possibility to use Static mapping. Looking at the source code of libnfsidmap v0.24, it is clear that static mappings are only valid for server side (svcgssd) which the man page forgets to mention. Is there any specific reason why not to implement the static resolution functions on the client side as well?

That is a good question... I always wonders this myself....

Quoted 1 line

I would send a patch if there is a change it will be accepted.

There is only one way to find out! ;-)

steved.