Operating System - HP-UX
1822437 Members
2582 Online
109642 Solutions
New Discussion юеВ

Maximum length of a NIS string (key and values)

 
Naveej.K.A
Honored Contributor

Maximum length of a NIS string (key and values)

Hi

I need to find out the maximum length of the key and value strings used by NIS.

If this is a configurable parameter, I need to know where this is configured on a system.

Regards,

Naveej
practice makes a man perfect!!!
5 REPLIES 5
Robert-Jan Goossens
Honored Contributor

Re: Maximum length of a NIS string (key and values)

Hi Naveej,

Check this doc from docs.hp.com.

http://tinylink.com/?bd0DDEa9jH

Regards,
Robert-Jan
Heiner E. Lennackers
Respected Contributor

Re: Maximum length of a NIS string (key and values)

The whole string should be not longer than 1024 characters.

HeL
if this makes any sense to you, you have a BIG problem
Heiner E. Lennackers
Respected Contributor

Re: Maximum length of a NIS string (key and values)

The whole string has to be shorter than 1024 characters.
if this makes any sense to you, you have a BIG problem
Dave Olker
Neighborhood Moderator

Re: Maximum length of a NIS string (key and values)

Hi Naveej,

As others have said, there is a 1024-byte limitation. The reason I'm posting is not for a "me too", but to provide some additional information.

If you look at the dbm(3C) man page you'll find this:

_________________________________

The sum of the sizes of a key/content pair must not exceed the internal block size (currently 1024 bytes). Moreover, all key/content pairs that hash together must fit on a single block. store returns an error if a disk block fills with inseparable data.
_________________________________


What this means to you is:

1. The combination of the key/content pair needs to fit into a 1024 byte block

2. If two or more values hash to the same block then *all* of the key/content pairs that hash to that block must be able to be stored in a single 1024 byte block

3. This is not configurable

4. The dbm stuff can only create 2GB database files, which limits the number of hash values and 1024 byte blocks


Item #2 above is significant because I've seen (and reproduced) cases where I can get an NIS map build failure to occur with an /etc/group file that only contains 2 entries! In this case the /etc/group file had 2 entries that were rather large and both hashed to the same block and the combination of both entries key/content pairs could not be stored in the same block, which resulted in the NIS map build failure.

What this also means is that if you're seeing problems where multiple dbm keys are hashing to the same block, you can try making a small modification to the key in question (i.e. change the group name in /etc/group by one character, or change the user name in /etc/passwd by one character) to get it to hash to a different block and store successfully.

Hope this helps,

Dave


I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Naveej.K.A
Honored Contributor

Re: Maximum length of a NIS string (key and values)

Hi,

Thanks for your answers.

We have a customer who is having some issues with E-mail addresss. We are using aliases maps in NIS.

I searched further and got to know that the NIS alias map follow the RFC 2821 / 2822 for which the user name is 64 and the max domain part is 255.

so I suspect the correct answer is 64 + 255 + 1 (@) = 320

Thanks once again for your replies
practice makes a man perfect!!!