summaryrefslogtreecommitdiffstats
path: root/usr.bin/rdistd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use password/group cache functions and avoid stashing a pointer tomillert2018-09-211-32/+20
| | | | | | | | the return value of getgrgid(3) or getgrnam(3) which relies on undefined behavior. The rdist server will now use getgroups(2) to determine group membership of the invoking user. In addition, there is now one implementation of tilde expansion instead of two. OK tb@ tim@
* Fix a crash in rdistd triggered by the recent getpw{ent,nam,uid}millert2018-09-091-4/+6
| | | | | | | | | | | changes. This stems from rdist stashing a pointer to the static area used by getpw{ent,nam,uid} and using it to avoid repeating passwd lookups when pw->pw_name matches the user to be looked up. This relied on undefined behavior, and with the recent passwd changes, is no longer possible as the old pointer will be invalidated. A better approach is to use the upcoming uid_from_user(3) functions. Found by and fix OK tim@
* gid_t is unsigned, so < 0 test is always false, compare against (gid_t)-1otto2017-08-301-2/+2
| | | | explicitly; ok millert@
* Avoid compiler warning about zero-length printf format strings.millert2016-03-301-3/+3
| | | | | | Allow a NULL format in message() and switch the two calls to error() and message() with an empty format string to using NULL. OK deraadt@
* The change to make mkstemp(3) require at least 6 trailing Xs brokemillert2016-03-301-14/+8
| | | | | | | | | | rdistd for directories that do not exist on the destination. Calling mkstemp(3) twice with the same format (filled in by the first mkstemp(3) call) is bogus so call chkparent() *before* mkstemp(3) instead of only on error. This costs an extra lstat(2) in the case where the directory already exists but simplifies the code and doesn't rely on undefined behavior (namely, the state of the template when mkstemp fails). OK tim@
* remove needless allocation castsmmcc2015-12-221-2/+2
|
* Remove a couple needless allocation casts. No binary change.mmcc2015-12-221-3/+3
|
* Switch to linkat() to support hardlinked symlinksguenther2015-11-151-11/+19
| | | | | Simplify chown logic by using fchownat() Cache whether we're root instead of calling getuid() before each chown
* in getopt() blocks, stop incrementing flag variable which are supposedderaadt2015-02-081-2/+2
| | | | | to just be 0/1 ok miod florian
* Assume NFS_CHECK and RO_CHECK are defined.guenther2015-01-213-32/+13
| | | | | We only need the dev_t and not the entire struct stat in mntinfo. Delete some superfluous casts.
* Reduce opt_t from long to int.guenther2015-01-211-21/+19
| | | | Debug message consistency: format opts with %#x and modes with %#04o
* Split out from rdist/defs.h the client-only and server-only bits intoguenther2015-01-205-25/+127
| | | | | | | | | rdist/client.h and rdistd/server.h Only put #includes in .h files that are necessary for the .h to be used; all other #includes go in the .c files Move all extern variable declarations to the .h files, renaming local variables to avoid shadowing Replace me_type member of mntent_t with an "is NFS?" flag bit
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-163-19/+19
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* Correct reversed test of setmountent() returnguenther2015-01-101-2/+2
| | | | Fix from Dennis Lindroos (denafcm (at) gmail.com)
* Kill os-openbsd.h: we have <paths.h>, _PATH_RSH, and utimes()guenther2014-07-121-2/+2
|
* Rename 'link' parameter to eliminate shadow warningsguenther2014-07-121-9/+9
|
* Yes, we have setproctitle(). Delete that and several unused HAVE_* #definesguenther2014-07-121-3/+1
|
* Assume we have getfsstat(); simplify the interface to the *mountent()guenther2014-07-052-280/+31
| | | | wrappers
* Assume BSD44: statfs()guenther2014-07-051-32/+9
|
* Assume POSIX: S_IFSOCK and S_IFIFOguenther2014-07-051-15/+1
| | | | Kill some 'notyet' code that will never be enabled
* Assume POSIX: lchown(), fchown(), fchmod(), fchmodat()guenther2014-07-051-24/+3
| | | | Assume we have rcmdsh()
* Assume POSIX: uid_t and gid_tguenther2014-07-051-19/+16
| | | | Add parens to quiet gcc on previous commit
* Assume POSIX: <dirent.h>, struct direntguenther2014-07-051-3/+6
|
* Oops, fix both locations using D_NAMLEN()guenther2014-07-051-4/+3
|
* Stop using silly macro when checking for '.' and '..' directory entriesguenther2014-07-051-4/+3
|
* A local array can't be NULLguenther2014-07-051-2/+2
|
* change some rsh references to ssh. poke by jmctedu2014-04-191-5/+2
|
* If a constant string needs a name, use a static const array instead of aguenther2013-10-271-2/+2
| | | | | | | | pointer or non-const array, as that minimizes the symbols, maximizes the placement into read-only memory, and avoids warnings from gcc -Wformat=2 when they're used as format strings. ok deraadt@
* remove casts to time_t * which are not neededderaadt2013-04-161-2/+2
|
* Fix various format string issues. Stop assuming time_t is long or smaller.guenther2012-11-122-11/+13
| | | | | | Enable warnings. ok krw@, ian@
* Apply some tough type-love and give rdist a chance to handle fileskrw2011-04-102-32/+31
| | | | | | | larger than 2GB. Diff from Stephan R. Gerber via PR#6586, tweaks by me. ok deraadt@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-274-71/+4
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* pathnames with space, tab, newline, etc are encoded before being sent.deraadt2009-03-281-7/+13
| | | | | But they were not reliably being decoded, resulting in wrong naming on the target machine. diff from Tim van der Molen
* correct .Dt; from Tim van der Molenjmc2009-03-091-3/+3
|
* Fix breakage introduced in rev 1.8 wrt rdisting symlinks. Push themillert2008-05-251-16/+22
| | | | | mkstemp() down into recvfile() and use mktemp() for recvlink(). OK okan@
* Change a mktemp(3) to mkstemp(3), preventing a race condition.ray2008-05-131-21/+12
| | | | | | Improve error checking. OK okan@
* convert to new .Dd format;jmc2007-05-311-2/+2
|
* one synopsis; sync usage()jmc2007-02-262-10/+5
|
* double semicolon; from Daniel Matic in PR 4929otto2006-02-011-4/+4
|
* fix readlink() usage.mpech2003-07-071-3/+3
| | | | millert@ ok
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-035-34/+14
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* o Sync w/ freerdist 0.92 minus the compress optionmillert2003-05-145-621/+554
| | | | | | | o KNF and ANSIfy the function headers Sparse file support is currently a no-op since it didn't work. Proper sparse file support will be added later.
* use POSIX regexmillert2003-05-061-4/+1
|
* mdocify; apparently no one every reads this man page.millert2003-04-211-43/+41
|
* strcpy/strcat/sprintf removal; krw@ OKmillert2003-04-191-18/+15
|
* more POSIX chownmillert2003-04-101-5/+5
|
* strings; ok miod ho krwderaadt2003-04-053-24/+29
|
* kill more registersmpech2001-11-192-20/+20
| | | | millert@ ok
* occured->occurredmpech2001-09-191-5/+5
| | | | | | | idea from deraadt@ via NetBSD millert@ ok p.s. Next commit will fix a typo in the sys/
* Make two variables that ought not to be static be auto.millert1999-11-261-4/+5
| | | | Remove a useless loop invariant (already tested before the loop is reached).