summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/rcmd.c
Commit message (Collapse)AuthorAgeFilesLines
* 64bit portability fixes.dfr1998-10-051-11/+11
| | | | Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
* Buffer overflow from DNS name information which could cause root accessimp1997-02-261-1/+2
| | | | | | | when called from lpd. Reviewed by: jkh, pst Submitted by: Oliver Friedrichs <oliver@secnet.com>
* Fix PR2579: potential security hole in rcmd.cimp1997-02-091-2/+2
| | | | Submitted by: Julian Assange
* clear sockaddr_in's on stack before usepeter1996-08-121-26/+28
| | | | | | | | | set sin_len close one ftp port bounce attack have rresvport() use bindresvport() rather than duplicate the code, rresvport() is a superset of bindresvport(). Obtained from: OpenBSD / Jason Downs / Theo de Raadt, minor tweaks by me.
* General -Wall warning cleanup, part I.jkh1996-07-121-0/+2
| | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu>
* Use the setsockopt for IP_PORTRANGE to cause rresvport() to allocate apeter1996-05-311-12/+24
| | | | | | | | | privileged port within a single bind(), rather than looping through attempts to bind over and over again over progressively lower ports. This should speed up rlogin/rsh etc, and will probably cure some of the strange rlogin hangs that have been reported in the past where rresvport() managed to bind() to a port address that it shouldn't have.
* Submitted by: Bill Fenner <fenner@parc.xerox.com>wpaul1995-08-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix for PR #510. The original problem was that __ivaliduser() was failing to grant access to a machine listed in a +@netgroup specified in /etc/hosts.equiv, even though the host being checked was most certainly in the +@netgroup. The /etc/hosts.equiv file in question looked like this: localhost +@netgroup The reason for the failure was had to do with gethostbyaddr(). Inside the __ivaliduser() routine, we need to do a gethostbyaddr() in order to get back the actual name of the host we're trying to validate since we're only passed its IP address. The hostname returned by gethostbyaddr() is later passed as an argument to innetgr(). The problem is that __icheckhost() later does a gethostbyname() of its own, which clobbers the buffer returned by gethostbyaddr(). The fix is just to copy the hostname into a private buffer and use _that_ as the 'host' argument that gets passed to innetgr(). And here I was crawling all over the innetgr() code thinking the problem was there. *sigh*
* Just when you thought it was safe...wpaul1995-08-071-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - getnetgrent.c: address some NIS compatibility problems. We really need to use the netgroup.byuser and netgroup.byhost maps to speed up innetgr() when using NIS. Also, change the NIS interaction in the following way: If /etc/netgroup does not exist or is empty (or contains only the NIS '+' token), we now use NIS exclusively. This lets us use the 'reverse netgroup' maps and is more or less the behavior of other platforms. If /etc/netgroup exists and contains local netgroup data (but no '+'). we use only lthe local stuff and ignore NIS. If /etc/netgroup exists and contains both local data and the '+', we use the local data nd the netgroup map as a single combined database (which, unfortunately, can be slow when the netgroup database is large). This is what we have been doing up until now. Head off a potential NULL pointer dereference in the old innetgr() matching code. Also fix the way the NIS netgroup map is incorporated into things: adding the '+' is supposed to make it seem as though the netgroup database is 'inserted' wherever the '+' is placed. We didn't quite do it that way before. (The NetBSD people apparently use a real, honest-to-gosh, netgroup.db database that works just like the password database. This is actually a neat idea since netgroups is the sort of thing that can really benefit from having multi-key search capability, particularly since reverse lookups require more than a trivial amount of processing. Should we do something like this too?) - netgroup.5: document all this stuff. - rcmd.c: some sleuthing with some test programs linked with my own version of innetgr() has revealed that SunOS always passes the NIS domain name to innetgr() in the 'domain' argument. We might as well do the same (if YP is defined). - ether_addr.c: also fix the NIS interaction so that placing the '+' token in the /etc/ethers file makes it seem like the NIS ethers data is 'inserted' at that point. (Chances are nobody will notice the effect of this change, which is just te way I like it. :)
* Slight adjustment to previous fix for __ivaliduser(). It was checking forpeter1995-07-161-2/+4
| | | | | | | | the comment before checking for long lines, so there was a possibility that the wrap-around might be used as an exploitable hostname. Reviewed by: Submitted by: Obtained from:
* Make ruserok() accept the #-starting comment lines we used to havejoerg1995-07-161-0/+2
| | | | | | in our default /etc/hosts.equiv. Closes PR #conf/620: Default /etc/hosts.equiv...
* 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. :)
* Based on fix from 1.1.5.1:csgr1994-09-081-1/+10
| | | | | | | | | | | >From: jtk@atria.com (John T. Kohl) in rcmd: It calls select() with a hardcoded "number of file descriptors" argument of 32, rather than computing it based on the sockets about which it cares. - Now we work out the nfds arg, and do some error checking Submitted by: Geoff.
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+408
OpenPOWER on IntegriCloud