Page MenuHomeFreeBSD

Increase YPMAXRECORD to 16M to be compatible with Linux.
ClosedPublic

Authored by kib on Jul 9 2019, 11:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 29, 12:30 PM
Unknown Object (File)
Oct 24 2024, 8:11 AM
Unknown Object (File)
Oct 16 2024, 10:38 PM
Unknown Object (File)
Oct 8 2024, 6:49 PM
Unknown Object (File)
Oct 3 2024, 9:15 AM
Unknown Object (File)
Oct 2 2024, 11:54 PM
Unknown Object (File)
Sep 28 2024, 8:43 AM
Unknown Object (File)
Sep 28 2024, 8:26 AM

Details

Summary

Glibc made same change, increasing the allowed length for keys and values in YP to 16M, in 2013. We need this for compatibility with very large automounter maps.

Since YP protocol definition uses the constant to declare variable-size opaque byte strings, the change should be binary compatible with existing installations which do not expose keys or values larger than 1024 bytes.

All uses of local variables with YPMAXRECORD sizes were removed to avoid insane stack use. On the other hand, variables with static lifetime should be fine and only result in increased VA use.

Sponsored by: Mellanox Technologies

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 25724

Event Timeline

ian added inline comments.
lib/libc/net/gethostbynis.c
91–92

s/&ypbuf/ypbuf/

same change a few lines down in result= line

lib/libc/net/getnetbynis.c
80–81

&ypbuf here and 3 lines down as well

In fact, it looks like this pattern of the old code using '&array' instead of just 'array' is repeated in more of the changes below, I'm not going to flag every one of them right now (because I was just doing a "quick glance" and have to get back to $work).

kib marked 2 inline comments as done.

Fix bugs pointed out by ian. I did not found other instances of it.

markj added inline comments.
usr.sbin/rpc.yppasswdd/yppasswdd_server.c
368

Should this be a goto as well?

kib marked an inline comment as done.

Do not leak pwbuf.

There are no checks for memory allocation failures, but otherwise it looks ok to me.

This revision is now accepted and ready to land.Aug 8 2019, 1:12 AM
This revision now requires review to proceed.Aug 8 2019, 3:15 PM
markj added inline comments.
usr.sbin/yppush/yppush_main.c
448

return YP_YPERR?

This revision is now accepted and ready to land.Aug 8 2019, 9:35 PM
usr.sbin/yppush/yppush_main.c
448

I am not sure.

I returned 0 on principle that malloc might fail mostly due to insane size, not because app should handle real OOM situation. And then, returning 0 means that the iteration over the entries should continue, which is what I believe is the right action.

usr.sbin/yppush/yppush_main.c
448

Ok. It might be worth a comment.

kib marked 2 inline comments as done.

Add comment hinting why we do not stop iteration on asprintf (malloc) failure.

This revision now requires review to proceed.Aug 9 2019, 8:30 PM
This revision is now accepted and ready to land.Aug 9 2019, 8:41 PM