summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* If locale not available, fallback to strcasecmp, not to strcmpache1995-04-161-2/+2
|
* Head off potential core dump in _havemaster() (we don't need to free anywpaul1995-04-151-4/+1
| | | | memory here: the underlying YP routines handle this one for us).
* Better conformance to SunOS behavior: if we can't match a user to onewpaul1995-04-141-2/+8
| | | | | | | | of the plus or minus lists at all, reject him. This lets you create a +@netgroup list of users that you want to admit and reject everybody else. If you end your +@netgroup list with the wildcard line (+:::::::::) then you'll have a +@netgroup list that remaps the specified people but leaves people not in any netgroup unaffected.
* Add err_set_file() and err_set_exit() functions to make it possible forwollman1995-04-132-18/+64
| | | | | programs which use err(3) to work nicely in a wider range of environments (e.g., dialog).
* Add an ethers(3) man page.wpaul1995-04-122-3/+190
|
* More of the same: we also need to handle multiple domains properlywpaul1995-04-091-6/+33
| | | | even if /var/yp/binding/DOMAIN.VERS doesn't exist yet.
* Fix behavior of YP library routines in environments with multiple domains,wpaul1995-04-091-6/+24
| | | | | | | | | | | | | | | | | | | | | | | where one or more of the non-default domains are not yet bound. If we make a YP request for a domain other than the default domain, and there is no binding for the new domain yet, _yp_dobind() sees that the /var/yp/binding/DOMAIN.VERS file for the unbound domain is not locked (by ypbind) and from this it concludes that the NIS system is dead, so it gives up. This behavior has been changed: before giving up in this case, we now make a second check to see if the binding file for the *default* domain is also not locked. Only if the default domain binding file is also unlocked to we now assume that ypbind has bought the farm and bail out. (Note: this assumes that the user hasn't changed the default domain while ypbind is running.) With this change, _do_ypbind() is allowed to proceed into the next section of code wherein it prods ypbind into establishing a binding for the new domain. This first call times out after ten seconds, after which it should retry and succeed. From then on, the binding for the second domain should be handled normally.
* Add missing header referenceache1995-04-091-0/+1
|
* Reviewed by: ache and wollman (long ago)bde1995-04-072-52/+11
| | | | | | | | | | | | | | | | | | isctype.c: o The tolower() and toupper() functions duplicated too much code and were out of date (surprise). This didn't matter because it was difficult to call them. o Change formatting to be more like that in <ctype.h> (with extra parentheses as in the macros). Perhaps this file should be machine generated or everything should be handled like __tolower() so that no code is repeated. nomacros.c: o Instead of looking at _USE_CTYPE_INLINE_ to see what <ctype.h> has done, set _EXTERNALIZE_CTYPE_INLINES_ to tell <ctype.h> what to do, so that we don't have anything left to do. Note that code is now generated even if inlines are used by default. This allows users to switch to non-inline versions.
* Obtained from: 1.1.5 (originally by jtc)bde1995-04-061-1/+2
| | | | | | | Fix printf("%g", 0.0) - print "0", not "0.". The previous fixes in this area had one non-cosmetic (non-)change that caused this bug. Bruce
* The man page setmode(3) declares `void setmode' when it should bejoerg1995-04-051-1/+1
| | | | | | declared `void *setmode'. Submitted by: kargl@troutmask.apl.washington.edu
* Add "before inclusion of any header which ... "ache1995-04-041-1/+1
| | | | Suggested by: bde
* 'Fix' for esoteric misfeature discovered while searching for another bug:wpaul1995-04-041-1/+16
| | | | | | | | | | | | | | | | | | | | | | select() returns EINVAL if you try to feed it a value of FD_SETSIZE greater that 256. You can apparently adjust this by specifying a larger value of FD_SETSIZE when configuring your kernel. However, if you set the maximum number of open file descriptors per process to some value greater than the FD_SETSIZE value that select() expects, many selects() within the RPC library code will be botched because _rpc_dtablesize() will return invalid numbers. This is to say that it will return the upper descriptor table size limit which can be much higher than 256. Unless select() is prepared to expect this 'unusually' high value, it will fail. (A good example of this can be seen with NIS enabled: if you type 'unlimit' at the shell prompt and then run any command that does NIS calls, you'll be bombarded with errors from clnttcp_create().) A temporary fix for this is to clamp the value returned by _rpc_dtablesize() at FD_SETSIZE (as defined in <sys/types.h> (256)). I suppose the Right Thing would be to provide some mechanism for select() to dynamically adjust itself to handle FD_SETSIZE values larger than 256, but it's a bit late in the game for that. Hopefully 256 file descriptors will be enough to keep RPC happy for now.
* getpwent.c: fix problem with emacs dumping core when NIS is enabled. Alsowpaul1995-04-043-21/+34
| | | | | | | | add #includes for YP headers when compiling with -DYP to avoid some implicit declarations. getgrent.c & getnetgrent.c: add some #includes to avoid implicit declarations of YP functions.
* Properly describe how to expand default limit of handled descriptorsache1995-04-041-1/+6
|
* Submitted by: Sebastian Strollowwpaul1995-04-021-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obtained from: Casper H. Dik (by vay of Usenet) Small patch to help improve NIS rebinding times (among other things): >From: casper@fwi.uva.nl (Casper H.S. Dik) >Newsgroups: comp.sys.sun.misc,comp.sys.sun.admin >Subject: FIX for slow rebinding of NIS. >Summary: a small change in libc makes life with NIS a lot easier. >Message-ID: <1992Jan17.173905.11727@fwi.uva.nl> >Date: 17 Jan 92 17:39:05 GMT >Sender: news@fwi.uva.nl >Organization: FWI, University of Amsterdam >Lines: 138 >Nntp-Posting-Host: halo.fwi.uva.nl Have you been plagued by long waits when your NIS server is rebooted? READ ON! Sun has a patch, but the README says: ********************* WARNING ****************************** This is a new version of ypbind that never uses the NIS binding file to cache the servers binding. This will have the effect of fixing the current symptom. However, it might degrade the overall performance of the system when the server is available. This is most likely to happen on an overloaded server, which will cause the network to produce a broadcast storm. ************************************************************* Therefor, I have produced another fix. o What goes wrong. When the NIS server is rebooted, ypserv will obtain different ports to listen for RPC requests. All clients will continue to use the old binding they obtained earlier. The NIS server will send ICMP dst unreachable messages for the RPC requests that arrive at the old port. These ICMPs are dropped on the floor and the client code will continue sending the requests until the timer has expired. The small fix at the end of this message will pick up these ICMP messages and deliver them to the RPC layer. o Before and after. I've tested this on some machines and this is the result: (kill and restart ypserv on the server) original% time ypmatch user passwd user:.... 0.040u 0.090s 2:35.64 0.0% 0+126k 0+0io 0pf+0w (155 seconds elapsed time) fixedhost% time ypmatch user passwd user:.... 0.050u 0.050s 0:10.20 0.9% 0+136k 0+0io 0pf+0w (10 seconds elapsed time) Rebinding is almost instantaneous. o Other benefits. RPC calls that use UDP as transport will no longer time out but will abort much sooner. (E.g., the remote host is unreachable or 111/udp is filtered by an intermediate router)
* Fix xdr_ypmap_parms() so that it agrees with xdr_domainname(), xdr_peername()wpaul1995-04-021-4/+4
| | | | and friends.
* Fix manpage ruleache1995-04-021-1/+1
|
* Add ether_addr functions to libc. This seems to be the logical placewpaul1995-04-022-1/+235
| | | | to put them. A man page is in the works.
* Add some missing xdr functions needed for server-side implementations.wpaul1995-04-021-1/+116
| | | | | (This is to help me reduce yppush a bit: it has its own copy of yp_xdr.c right now, but I can get rid of it now that this stuff is here.)
* Add the nls code for XPG3-style message catalogs to libc.jkh1995-03-309-0/+854
| | | | Obtained from: NetBSD
* Add nls include to Makefile.jkh1995-03-301-0/+1
|
* Clear IGNPAR in cfmakeraw() instead of set it.ache1995-03-291-2/+2
|
* Fix a missing _hash() to prevent namespace pollution with the db/hash routines.jkh1995-03-281-5/+7
| | | | | | | Grrr. If the dbhash routines weren't grossly overengineered I wouldn't even need to do this! :-( Also now export the hash_stats routine. Manpage coming RSN - I promise.
* Use yp_order() instead of yp_first() in _havemaster() to check for thewpaul1995-03-271-7/+7
| | | | | presence of the master.passwd.byname map, and remember to free the returned order value before exiting.
* Bump the shared library minor # because of the additions of thenate1995-03-271-0/+2
| | | | strhash() functions.
* Hash 8bit chars without sign extensionache1995-03-261-3/+8
|
* Update info about LC_COLLATE implementationache1995-03-261-3/+1
|
* Add the strhash family of routines. They provide a number of featuresjkh1995-03-262-2/+416
| | | | | that the db/hash functions don't, and they're much simpler to use for low-overhead string hashing.
* Updated manual page to indicate flags argument; added return value anddg1995-03-251-6/+24
| | | | errors section.
* scandir(3) didn't transfer d_type, and d_ino is called d_fileno now.phk1995-03-251-1/+2
|
* Add calls to endgrent() and endnetgrent() to the end of _createcaches().wpaul1995-03-251-0/+2
|
* Add more sanity checks. *Lots* of sanity checks. Huge tracts of sanity checks.wpaul1995-03-241-8/+40
| | | | | | | | | | | Make sure all arguments to the yp_*() functions are valid before sending them off to the server. This is somewhat distressing: once again my FreeBSD box brought down my entire network because of NIS bogosities. I *think* the poor argument checking in this module is the cause, but I still haven't been able to reproduce the exact series of events that lead to the ypserv crashes. For now I've resorted to sticking my FreeBSD box in a seprate domain. Hopefully a weekend of heavy testing will uncover the problem.
* Make sanity checks saner: don't let setnetgrent() or innetgr() swallowwpaul1995-03-241-2/+8
| | | | any bogus arguments.
* Change strtok() to strsep(), using strtok() can cause memory corruptionache1995-03-241-16/+29
| | | | if user program use it too in the same time.
* Sicnce this code shares the same fragment as gethostnamaddr:ache1995-03-241-10/+16
| | | | | | | | Change strtok() to strsep(), cause memory corruption for all programs which use strtok() too in the same time. Fix potential NULL reference, depends of /etc/hosts.conf format Fix the bug when service name fetched always from beginning of the line, not from parsed token.
* Change strtok() to strsep(), cause memory corruption for allache1995-03-241-10/+16
| | | | | | | programs which use strtok() too in the same time. Fix potential NULL reference, depends of /etc/hosts.conf format Fix the bug when service name fetched always from beginning of the line, not from parsed token.
* Yikes! Fix stupid mistake I made in last commit that made getpwent() ignorewpaul1995-03-241-9/+12
| | | | | local password entries when YP was enabled. (How the heck did that get by me!?)
* As per Justin T. Gibbs's request, agument the +@netgroup/-@netgroupwpaul1995-03-241-36/+72
| | | | | | | | | | | | | remapping mechanism in the following manner: if given an entry +@foo and there is no netgroup named 'foo,' try searching for a regular user group called 'foo' and build the cache using the members of group 'foo' instead. If both a netgroup 'foo' and a user group 'foo' exist, the 'foo' netgroup takes precedence, since we're primarily interested in netgroup matching anyway. This allows access control schemes based on ordinary user groups (which are also available via NIS) rather than netgroups, since netgroups on some systems are limited in really brain-damaged ways.
* Don't let yp_match() or yp_next() operate on null or empty keys: askingwpaul1995-03-231-1/+11
| | | | | | ypserv to do a yp_match() with an a null or empty key causes much havok. (Note that this could be construed as a denial of service attack if used maliciously.)
* Don't let setnetgrent() operate on a null or empty group name: it canwpaul1995-03-231-0/+4
| | | | tickle a bug in ypserv and make a serious mess of things.
* Very important sanity checks: today I clobbered all four NIS servers onwpaul1995-03-231-6/+8
| | | | | | | | | | | | | my network because setnetgrent() was trying to do a lookup on group "". It seems that an attempt to do a yp_match() (and possible yp_next()) on a null or empty key causes Sun's ypserv in SunOS 4.1.3 to exit suddenly (and without warning). Our ypserv behaves badly in this situation too, thoush it doesn't appear to crash. In any event, getpwent, getnetgrent and yp_match() and yp_next() are now extra careful not to accidentally pass on null or empty arguments. Also made a small change to getpwent.c to allow +::::::::: wildcarding, which I had disabled previously.
* Lots of fixes/improvements in the +user substitution handling:wpaul1995-03-231-52/+39
| | | | | - Have the +@netgroup/-@netgroup caches handle the +user/-user cases too. - Clean up getpwent() to take advantage of the improved +user/-user handling.
* Small cleanups:wpaul1995-03-231-39/+44
| | | | | | - Prepend a '_' to a couple of things - Make sure YP is enabled in _createcaches() - Remove a couple of unused/uneeded variables from _createcaches()
* Phew! Done at last: getpwent now understands +@netgroup/-@netgroup directiveswpaul1995-03-231-9/+212
| | | | | in addition to the existing NIS substitutions. I may tweak this a bit in the future, but the important stuff is all here.
* Use better/stronger/faster NIS lookup code: by using yp_match() instead ofwpaul1995-03-211-44/+14
| | | | | the yp_first()/yp_next() combo, we let the database code in ypserv do some of the work for us.
* Reviewed by: Bill Paul <wpaul@freebsd.org>wpaul1995-03-211-2/+2
| | | | | | | | | | | | | | | | Submitted by: Sebastian Strollo <seb@erix.ericsson.se> - In /usr/src/lib/libc/yp/yplib.c, function yp_first when clnt_call fails with (r != RPC_SUCCESS) ysd->dom_vers should be set to 0! This ensures that /var/yp/bindings/dom.vers will be read again on retry. What happens now is that when our server is down and someone tries to use yp they will continue to try until kingdom come. So: if(r != RPC_SUCCESS) { clnt_perror(ysd->dom_client, "yp_first: clnt_call"); ysd->dom_vers = -1; ^^^^ change to 0 goto again; }
* At last! Modified __ivaliduser() to do the same kind of user/host validationwpaul1995-03-201-3/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | that everyone else does: you can now use +host/-host, +user,-user and +@netgroup/-@netgroup in /etc/hosts.equiv, /.rhosts, /etc/hosts.lpd and ~/.rhosts. Previously, __ivaliduser would only do host/user matches, which was lame. This affects all the r-commands, lpd, and any other program/service that uses ruserok(). An example of the usefullness of this feature would be a hosts.equiv file that looks like this: +@equiv-hosts Since the netgroup database can now be accessed via NIS, this lets you set up client machines once and then never have to worry about them again: all hosts.equiv changes can now be done through NIS. Once I finish with getpwent.c, we'll be able to do similar wacky things with login authentication too. (Our password field substitution will finally be on par with everyone else's, and I'll finally be able to fully integrate my FreeBSD machine into my network without having to worry about the grad students sneaking into it when I'm not looking. :) Danger Will Robinson! I tested this thing every which way I could, but Murphy's Law applies! If anybody spots a potential security problem with the way my matching algorithm works, tell me immediately! I don't want crackers snickering and calling me names behind my back. :)
* Whoops: expanding netgroups that reference multiple netgroups doesn'twpaul1995-03-191-1/+1
| | | | | | | | | | | | | | | work because parse_netgrp() doesn't recurse properly. Fixed by changing if (parse_netgrp(spos)) return(1); to if (parse_netgrp(spos)) continue; inside parse_netgrp(). (Lucky for me I happen to have a fairly complex 'live' netgroup database to test this stuff with.)
* Two major changes:wpaul1995-03-191-4/+71
| | | | | | | | | | | | | | - Added support for reading netgroups from NIS/YP in addition to the local /etc/netgroups file. (Note that SunOS and many other systems only support reading netgroups via NIS, which is a bit odd.) - Fix Evil Null Pointer Dereferences From Hell (tm) that caused parse_netgrp() to SEGV when expanding netgroups that include references to other netgroups. Funny how nobody else noticed this. This is the first step in implimenting +@netgroup substitution in getpwent.c and any other places that could use it and don't already support it (which is probably everywhere).
OpenPOWER on IntegriCloud