summaryrefslogtreecommitdiff
path: root/lib/libc/net/getnetbynis.c
Commit message (Collapse)AuthorAgeFilesLines
* Increase YPMAXRECORD to 16M to be compatible with Linux.Konstantin Belousov2019-08-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | 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. Glibc made same change, increasing the allowed length for keys and values in YP to 16M, in 2013. Reviewed by: markj Discussed with: ian Sponsored by: Mellanox Technologies MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D20900 Notes: svn path=/head/; revision=350957
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* Replace index() and rindex() calls with strchr() and strrchr().Ed Schouten2012-01-031-1/+1
| | | | | | | | | | | | | The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls. Notes: svn path=/head/; revision=229403
* - When there is no room for returning the result, nss backendHajimu UMEMOTO2010-08-131-2/+6
| | | | | | | | | | | | | have to return ERANGE and terminate with NS_RETURN. - When gethostbyname_r(3) and the friends end with an error, set errno to the value nss backend returns, and return errno value. PR: kern/131623 MFC after: 2 weeks Notes: svn path=/head/; revision=211276
* - make reentrant version of netdb functions glibc style API, andHajimu UMEMOTO2006-04-151-20/+64
| | | | | | | | | | expose them to outside of libc. - make netdb functions NSS friendly. Reviewed by: arch@ and current@ (no objection) Notes: svn path=/head/; revision=157779
* Update the resolver in libc to BIND9's one.Hajimu UMEMOTO2006-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Since, res_sendsigned(3) and the friends use MD5 functions, it is hard to include them without having MD5 functions in libc. So, res_sendsigned(3) is not merged into libc. Since, res_update(3) in BIND9 is not binary compatible with our res_update(3), res_update(3) is leaved as is, except some necessary modifications. The res_update(3) and the friends are not essential part of the resolver. They are not defined in resolv.h but defined in res_update.h separately in BIND9. Further, they are not called from our tree. So, I hide them from our resolv.h, but leave them only for binary backward compatibility (perhaps, no one calls them). Since, struct __res_state_ext is not exposed in BIND9, I hide it from our resolv.h. And, global variable _res_ext is removed. It breaks binary backward compatibility. But, since it is not used from outside of our libc, I think it is safe. Reviewed by: arch@ (no objection) Notes: svn path=/head/; revision=156960
* - Remove padding for ABI compatibility of n_net member from structHajimu UMEMOTO2005-06-031-3/+0
| | | | | | | | | | | | | | | | netent. - Change 1st argument of getnetbyaddr() to an uint32_t on 64 bit arch as well to confirm to POSIX-2001. These changes break ABI compatibility on 64 bit arch. There is similar padding issue for ai_addrlen of struct addrinfo. However, it is leaved as is for now. Discussed on: arch@, standards@ and current@ X-MFC after: never Notes: svn path=/head/; revision=146904
* - The ai_addrlen of a struct addrinfo used to be a size_t, perHajimu UMEMOTO2005-05-151-4/+7
| | | | | | | | | | | | | | | | | | | RFC 2553. In XNS5.2, and subsequently in POSIX-2001 and RFC 3493, it was changed to a socklen_t. And, the n_net of a struct netent used to be an unsigned long integer. In XNS5, and subsequently in POSIX-2001, it was changed to an uint32_t. To accomodate for this while preserving ABI compatibility with the old interface, we need to prepend or append 32 bits of padding, depending on the (LP64) architecture's endianness. - Correct 1st argument of getnetbyaddr() to uint32_t on 32 bit arch. Stay as is on 64 bit arch for ABI backward compatibility for now. Reviewed by: das, peter MFC after: 2 weeks Notes: svn path=/head/; revision=146244
* NETDB_INTERNAL is not fit, here. return NO_RECOVERY for h_errno.Hajimu UMEMOTO2005-04-291-1/+1
| | | | Notes: svn path=/head/; revision=145684
* make getnetby*() thread-safe.Hajimu UMEMOTO2005-04-281-35/+56
| | | | Notes: svn path=/head/; revision=145626
* Fix the style of the SCM ID's.David E. O'Brien2002-03-221-4/+2
| | | | | | | I believe have made all of libc .c's as consistent as possible. Notes: svn path=/head/; revision=92986
* Remove 'register' keyword.David E. O'Brien2002-03-211-1/+1
| | | | Notes: svn path=/head/; revision=92889
* Removed duplicate VCS ID tags, as per style(9).Ruslan Ermilov2001-08-131-2/+2
| | | | Notes: svn path=/head/; revision=81586
* Add nsswitch support. By creating an /etc/nsswitch.conf file, you canJacques Vidrine2000-09-061-18/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure FreeBSD so that various databases such as passwd and group can be looked up using flat files, NIS, or Hesiod. = Hesiod has been added to libc (see hesiod(3)). = A library routine for parsing nsswitch.conf and invoking callback functions as specified has been added to libc (see nsdispatch(3)). = The following C library functions have been modified to use nsdispatch: . getgrent, getgrnam, getgrgid . getpwent, getpwnam, getpwuid . getusershell . getaddrinfo . gethostbyname, gethostbyname2, gethostbyaddr . getnetbyname, getnetbyaddr . getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr = host.conf has been removed from src/etc. rc.network has been modified to warn that host.conf is no longer used at boot time. In addition, if there is a host.conf but no nsswitch.conf, the latter is created at boot time from the former. Obtained from: NetBSD Notes: svn path=/head/; revision=65532
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-2/+2
| | | | Notes: svn path=/head/; revision=50476
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-2/+2
| | | | Notes: svn path=/head/; revision=22993
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-2/+2
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Small yet significant tweaks/cleanups:Bill Paul1996-12-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - getservent: o put _yp_check() proto under #ifdef YP where it belongs o local YP buffers should be YPMAXRECORD + 2 bytes long and should be NUL terminated after copying - gethostbynis: o local YP buffer should be YPMAXRECORD + 2 bytes long - getnetbynis: o local YP buffer should be YPMAXRECORD + 2 bytes long and should be NUL terminated after copying - ether_addr: o local YP buffers should be YPMAXRECORD + 2 bytes long and should be NUL terminated after copying (in this case it's BUFSIZ + 2 bytes, but it happens that BUFSIZ == YPMAXRECORD. - gethostbydns: o nuke stray 'return(NULL)' in __dns_getanswer() (harmless but looks silly) These are 2.2 candidates. I will wait a few days to make sure these don't break anything and then, if there are no objections, move them to the 2.2 branch. Notes: svn path=/head/; revision=20953
* I asked Bill Paul why _getnetbynis() was only being called with 2 parameters,Jordan K. Hubbard1996-12-061-3/+3
| | | | | | | | | | | | | | | | | and he said: The 3rd agrument is new; looks like it was part of the upgrade to a new BIND with some IPv6 support. The third argument here should be AF_INET. In order for it to be anything else, I'd have to add new NIS functions to support IPv6 lookups. I don't even know what those look like yet. So there ya go, add AF_INET as the 3rd argument to the call. Submitted-by: wpaul Notes: svn path=/head/; revision=20168
* Merge in bind-4.9.4-P1 resolver...Peter Wemm1996-08-291-10/+23
| | | | Notes: svn path=/head/; revision=17903
* Fix other half of problem reported in PR #1079: _getnetbynisaddr() isBill Paul1996-03-231-12/+41
| | | | | | | | | | | | | | | | | | | | broken. The translation from network number to ASCII string was not working correctly (you would sometimes get things like 0.244.0.0 instead of 244.0.0). Also copied results of yp_match() to a static buffer for consistency with gethostbynis.c. Note: _getnetbynisaddr() chops off trailing .0's, i.e. 244.0.0 is truncated to 244. By contrast, getnetbyht.c code (for local /etc/networks lookups) leaves the traling .0's in place. This means that the NIS and local file lookups will match different things when looking up the same network number. I'm not sure which is the correct behavior. (I think the DNS lookup code tries all combinations -- should the NIS and local host lookup routines do that too?) Notes: svn path=/head/; revision=14775
* As above.Poul-Henning Kamp1995-10-221-3/+3
| | | | Notes: svn path=/head/; revision=11661
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-4/+4
| | | | Notes: svn path=/head/; revision=8870
* Fixed YP networks map support.Garrett Wollman1994-09-261-7/+24
| | | | Notes: svn path=/head/; revision=3108
* get* rework and new bind codePaul Traina1994-09-251-0/+117
Notes: svn path=/head/; revision=3070