summaryrefslogtreecommitdiffstats
path: root/libc/inet/getservice.c
Commit message (Collapse)AuthorAgeFilesLines
* getservice: fix handling of long linesNatanael Copa2010-10-141-22/+16
| | | | | | | | | | | | | | | Don't try to be smart by dynamically realloc buffersize as it doesn't work. Instead, be simple and allocate a buffer big enough. This fixes a memory leak when calling getserv{ent,byname,byport} multiple times. To save memory we reduce number of max aliases. We seldomly will need more than 1 anyways. While here, fix segfault that happened if there were too many aliases. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* getservice: getservent_r must return ERANGE when buffer is too smallNatanael Copa2010-10-141-3/+2
| | | | | | | | | | | | | | | | | | | This fixes issue introduced by 72e1a1ce186c39f07282398e2af9eb0253e60f15 This should also fix the following testcase to exit with error rather than cause an endless loop. int main(void) { if (getservbyname("non-existing", "udp") == NULL) err(1, "getservbyname"); return 0; } Reported by Pirmin Walthert http://lists.uclibc.org/pipermail/uclibc/2010-August/044277.html Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* getserv: fix reading services lines w > 80 charsBernhard Reutner-Fischer2010-08-191-24/+23
| | | | | | e.g. getservbyname() Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* switch getservice to config parserBernhard Reutner-Fischer2010-08-051-212/+139
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* trim Experimentally off and uncommented hiddenBernhard Reutner-Fischer2009-09-181-14/+0
| | | | | | | | sed -i -e '/Experimentally off - /d' $(grep -rl "Experimentally off - " *) sed -i -e '/^\/\*[[:space:]]*libc_hidden_proto(/d' $(grep -rl "libc_hidden_proto" *) should be a nop Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Last portion of libc_hidden_proto removal.Denis Vlasenko2008-11-201-8/+8
| | | | | Appears to build fine (several .configs tried)
* next portion of libc_hidden_proto removalDenis Vlasenko2008-11-201-2/+2
|
* libc_hidden_proto removal, a few more functionsDenis Vlasenko2008-11-181-1/+1
|
* libc_hidden_proto removal, just a few functionsDenis Vlasenko2008-11-181-1/+1
|
* Revert revision 19347, plus libc_hidden_proto for __uc_malloc.Bernd Schmidt2008-06-121-3/+3
| | | | | Some of the code is functionally identical before and after, but for now I'm just mechanically reverting the entire mess.
* Fix build failure due to missing 'smallint' definitionCarmelo Amoroso2008-05-271-0/+1
| | | | | | by adding <unistd.h> header file. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Slight size reduction by use of smallints/consts:Denis Vlasenko2008-05-251-2/+2
| | | | | | - 288016 1924 7176 297116 4889c libuClibc-0.9.29.so + 287956 1924 7168 297048 48858 libuClibc-0.9.29.so
* Moving libc_hidden_proto's into #ifdef UCLIBC_INTERNAL blockDenis Vlasenko2008-05-191-2/+2
| | | | | | | | | in string.h and strings.h. This caught unguarded string ops in libc/inet/ethers.c __ether_line_w() function. I will wait for fallout reports for a week or so, then continue converting more libc_hidden_proto's.
* add hidden_proto's for __uc_mallocDenis Vlasenko2008-02-121-0/+1
| | | | | (patch by Bernd Schmidt <bernds_cb1 at t-online.de>)
* make regex_old.c, ruserpass.c use __uc_malloc,Denis Vlasenko2007-07-301-3/+2
| | | | | | | | | | | | | replace "buf = malloc(BUFSIZ); if (!buf) abort();" by __uc_malloc elsewhere. With last 7 patches together uclibc has 3k of static data total with fairly big .config and with 2k being used for 2 x BUFSIZ stdio buffer: text data bss dec hex filename 114 132 2048 2294 8f6 _stdio.o (ex lib/libc.a) total data 593 total bss 3062
* Major cleanup of internal mutex locking. Be more consistant in how we doEric Andersen2006-12-071-26/+22
| | | | | | | things, and avoid potential deadlocks caused when a thread holding a uClibc internal lock get canceled and terminates without releasing the lock. This change also provides a single place, bits/uClibc_mutex.h, for thread libraries to modify to change all instances of internal locking.
* Enable _GNU_SOURCE build wide, trying to get consistent interfaces, else IMA ↵Peter S. Mazinger2006-01-221-1/+0
| | | | is a useless attempt
* make DODEBUG=y happy, update sysdeps/common/* copyrightPeter S. Mazinger2006-01-141-6/+6
|
* hidden_def/hidden_proto: convert all users (I hope) termios split, add some ↵Peter S. Mazinger2006-01-141-30/+39
| | | | missing headers, other jump relocs removed
* Convert some users and get rid of __rpc_thread_createerr jump reloc, this ↵Peter S. Mazinger2005-12-161-0/+1
| | | | was indeed a badly chosen name
* mmap/mremap/socket/rewind gonePeter S. Mazinger2005-12-081-0/+1
|
* Again rpc ;-( , all *inet*, *addr*Peter S. Mazinger2005-12-081-0/+1
|
* macro out the thread funcs in libc if threading is disabledMike Frysinger2005-12-061-7/+3
|
* More hiding, including __mempcpyPeter S. Mazinger2005-12-031-40/+45
|
* Hide mostly used functionsPeter S. Mazinger2005-12-011-4/+4
|
* Hide some of mem* and str*Peter S. Mazinger2005-11-271-0/+1
|
* Change the global 'buf' to 'servbuf' since some functions in here useEric Andersen2004-05-071-7/+7
| | | | a local named 'buf' and we want to avoid shadowing that.
* Reduce memory used by static buffers and allocate that memory dynamiclyEric Andersen2004-03-181-4/+20
| | | | | | | | | | instead. Based on an initial patch from Tobias Anderberg, but reworked. I asked Tobias to look into doing something more like what is done in busybox, but that proved to be a pain. One possible concern is that these buffers will probably show up as memory leaks i.e. with valgrind. Perhaps we should add in an atexit call to free this memory right after we allocate it?
* Fix a really dumb bug introduced in version 1.4 of this file (a patch for ipv6Eric Andersen2003-12-281-1/+3
| | | | | | | | | support) which could cause things like EOF and read errors while reading /etc/services to always return a TRY_AGAIN. The perl test suite would alloc a larger buffer and try again until all memory was exhausted. When we get a read error, or EOF, it means we didn't get what we wanted, and so we should return an error. Doing so fixes the failing perl 5.8.2 test. -Erik
* Fix whitespaceEric Andersen2003-12-281-5/+5
|
* Fix a long-standing bug with pthreads. A couple of linuxthreads filesManuel Novoa III2003-12-271-2/+2
| | | | | | | | | | | | | | | | were including libc-lock.h which had a bunch of weak pragmas. Also, uClibc supplied a number of no-op weak thread functions even though many weren't needed. This combined result was that sometimes the functional versions of thread functions in pthread would not override the weaks in libc. While fixing this, I also prepended double-underscore to all necessary weak thread funcs in uClibc, and removed all unused weaks. I did a test build, but haven't tested this since these changes are a backport from my working tree. I did test the changes there and no longer need to explicitly add -lpthread in the perl build for perl to pass its thread self tests.
* Make things more re-entrany, kill some cruft.Eric Andersen2002-06-171-114/+143
| | | | -Erik
* Bart Visscher <magick@Linux-Fan.com> has added some missing IPV6 support, andEric Andersen2002-03-191-24/+74
| | | | | added several additional reentrant networking functions such that iptables now runs with IPV6 support.
* Adjust naming for __FORCE_GLIBC__ to __FORCE_GLIBC and addEric Andersen2001-11-211-1/+1
| | | | | support for __FORCE_NOGLIBC per Brian Stafford <brian.stafford@office-logic.com>
* Update networking includes.Eric Andersen2001-02-051-0/+2
|
* Add in getprotobyname, getservicebyname, and related junkEric Andersen2000-10-271-0/+176