summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* 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).
* Fix authunix_maxgrouplist testache1995-03-181-2/+2
| | | | Submitted by: Scott Hazen Mueller <scott@zorch.sf-bay.org>
* Fix 'putting +: in /etc/group causes many programs to dump core' bugwpaul1995-03-181-1/+11
| | | | | | | | | by heading off possible null pointer dereferences in grscan(). Also change getgrnam() slightly to properly handle the change: if grscan() returns an rval of 1 and leaves a '+' in the gr_name field and YP is enabled, poll the YP group.byname map before giving up. This should insure that we make every effort to find a match in the local and YP group databases before bailing out.
* Remove `|| flags & ALT == 0' which was an obscure no-op, not abde1995-03-121-1/+1
| | | | parenthesization/precedence bug.
* Obtained from: 1.1.5. Originally by jtc. Cosmetically changed for thisbde1995-03-121-15/+23
| | | | | | | | | | | | | | | | | | commit by bde. Fix bugs in floating point formatting. The 4.4lite version is similar to revision 1.3 in old-cvs and is missing all of jtc's fixes in revision 1.4 in old-cvs. Revision 1.2 in ncvs fixed one of the old bugs but introduced at least one new one (for %.0e). old-cvs log: revision 1.4 date: 1993/11/04 19:38:22; author: jtc; state: Exp; lines: +33 -20 My work from NetBSD to make printf() & friends ANSI C compliant. Fixes several bugs in floating point formatting: 1. Trailing zeros were being stripped with %e format. 2. %g/%G formats incorrect. 3. Lots of other nits.
* stdio.h --> unistd.hache1995-03-091-1/+1
|
* Don't build swab.o here. It gets built in libc/i386/string. Previouslybde1995-03-071-1/+1
| | | | | | the copy built from here was overwritten by the other copy and the other copy was put in library-building command lines twice. ld now objects to duplicated modules.
* On snap 950210, format %s (print seconds from the epoch) is missingjoerg1995-03-012-1/+23
| | | | | | | | | from the code in strftime.c . This affects both the library code and all the commands using it (e.g. date +%s). Note that %s is not required by ANSI, but we've already got it in 1.1.5.1. Suggested by: luigi@labinfo.iet.unipi.it (Luigi Rizzo)
* Don't attempt to lstat() the POSIXLY invalid empty pathname.bde1995-02-251-1/+1
| | | | | realpath() still accepts "" as an arg and converts it to a canonical pathname for the current directory.
* Explain the full story, and make it understandable too.phk1995-02-251-2/+7
|
* fix the synopsis to showphk1995-02-241-5/+1
| | | | | | | | | | | | | | void | *signal(int sig, void (*func)(int)) instead of | void | *signal(sig, func()) | | void | (*func)()
* Add missing #include <time.h> with time() prototypeache1995-02-241-0/+1
|
* Minor optimization.ache1995-02-181-7/+9
|
* Minor optimizationache1995-02-181-7/+4
|
* Copyrights cleanupache1995-02-184-22/+38
|
* Bruce pointed out, that a misleading warning would be issuedse1995-02-171-1/+1
| | | | | | | in an (unlikely) border case (maxgroups==1 and the user is on an /etc/group line for the same group and that group only ...). Now this case is dealt with as before ...
* Protect against duplicate gids in group list (as could be these1995-02-171-2/+5
| | | | result of being a member of some group in both /etc/group and YP).
* Don't pick _warn module nowache1995-02-171-10/+34
|
* Correct the parameters for the fchown. The third was erroneouslyats1995-02-171-1/+1
| | | | specified as uid_t but should be gid_t.
OpenPOWER on IntegriCloud