History log of /openbsd-current/usr.bin/rdist/client.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.37 28-Jun-2019 deraadt

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.36 09-Jul-2017 espie

have bsd.prog.mk/bsd.lib.mk generate .y -> .c/.h rules without intermediate
files. This fixes up parallel builds in the default case.
FreeBSD does something similar.

okay millert@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.35 09-Dec-2015 mmcc

Remove NULL-checks before free(). ok tb@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.34 21-Jan-2015 guenther

Reduce opt_t from long to int.
Debug message consistency: format opts with %#x and modes with %#04o


# 1.33 20-Jan-2015 guenther

Split out from rdist/defs.h the client-only and server-only bits into
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


# 1.32 16-Jan-2015 deraadt

Replace <sys/param.h> with <limits.h> and other less dirty headers where
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)


Revision tags: OPENBSD_5_6_BASE
# 1.31 12-Jul-2014 guenther

The statdb code has never been complete here


# 1.30 12-Jul-2014 guenther

Eliminate some annoying variable shadowing


# 1.29 05-Jul-2014 guenther

Assume POSIX: uid_t and gid_t


# 1.28 05-Jul-2014 guenther

Assume POSIX: <dirent.h>, struct dirent


# 1.27 05-Jul-2014 guenther

Use void* in malloc/realloc/calloc wrappers


Revision tags: OPENBSD_5_5_BASE
# 1.26 18-Aug-2013 guenther

Fix calls to printf-like functions which passed a non-fixed string
as the format and no variable args.
Replace "%#0.*X" with "%#.*X": the zero-fill flag is ignored/implied
on numeric conversions when a precision is specified.

ok jung@ millert@ krw@


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.25 12-Nov-2012 guenther

Once a C_RECVDIR command is sent, a matching C_END command has to be
sent later, even if the opendir() fails or the nodescend option is set.

ok krw@, ian@


# 1.24 12-Nov-2012 guenther

Fix various format string issues. Stop assuming time_t is long or smaller.
Enable warnings.

ok krw@, ian@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.23 10-Apr-2011 krw

Apply some tough type-love and give rdist a chance to handle files
larger than 2GB. Diff from Stephan R. Gerber via PR#6586, tweaks
by me.

ok deraadt@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.22 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
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


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.21 15-Feb-2009 deraadt

make rdist silently ignore special file types which cannot be moved
(well, if you turn on debug it will still tell you)
from Tim van der Molen <tbvdm@xs4all.nl


Revision tags: OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.20 04-Oct-2004 jsg

hierarchy is spelt hierarchy, ok djm@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE
# 1.19 03-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


# 1.18 14-May-2003 millert

o Sync w/ freerdist 0.92 minus the compress option
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.


# 1.17 06-May-2003 millert

use POSIX regex


# 1.16 19-Apr-2003 millert

strcpy/strcat/sprintf removal; krw@ OK


# 1.15 07-Apr-2003 deraadt

replace strcpy calls that got inlined by gcc; Hans-Joerg.Hoexer@yerbouti.franken.de


# 1.14 05-Apr-2003 deraadt

strings; ok miod ho krw


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.13 19-Nov-2001 mpech

kill more registers

millert@ ok


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.12 05-Mar-1999 millert

make output look more like what BSD pritnf does when it hits a NULL


# 1.11 05-Mar-1999 millert

Don't assume printf will deal gracefully with NULL pointers for %s, BSD does but SysV does not


# 1.10 23-Feb-1999 millert

Check lp->target for NULL, not *lp->target as required by dynamic allocation introduce in rev 1.8


# 1.9 06-Feb-1999 millert

kill redundant (and incorrect) check for mallco failure


# 1.8 04-Feb-1999 millert

Fix a serious memory consumption problem when running over directories
that contain many hard-linked files; johnh@isi.edu
Also add an xstrdup() that behaves like xmalloc() on failure.


Revision tags: OPENBSD_2_4_BASE
# 1.7 26-Jun-1998 millert

rdist 6.1.4 + OpenBSD patches + some -Wall


# 1.6 18-May-1998 deraadt

readlink len-1


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.5 21-Jul-1997 angelos

Fix compilation warning.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.4 25-Jul-1996 millert

Updated to rdist 6.1.3. Used real snprintf() (instead of string length
in the format) since we have it.


# 1.3 26-Jun-1996 deraadt

rcsid


# 1.2 05-Mar-1996 dm

rdist 6.1.2


# 1.1 03-Feb-1996 dm

rdist 6.1.1


Revision tags: OPENBSD_6_2_BASE
# 1.36 09-Jul-2017 espie

have bsd.prog.mk/bsd.lib.mk generate .y -> .c/.h rules without intermediate
files. This fixes up parallel builds in the default case.
FreeBSD does something similar.

okay millert@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.35 09-Dec-2015 mmcc

Remove NULL-checks before free(). ok tb@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.34 21-Jan-2015 guenther

Reduce opt_t from long to int.
Debug message consistency: format opts with %#x and modes with %#04o


# 1.33 20-Jan-2015 guenther

Split out from rdist/defs.h the client-only and server-only bits into
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


# 1.32 16-Jan-2015 deraadt

Replace <sys/param.h> with <limits.h> and other less dirty headers where
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)


Revision tags: OPENBSD_5_6_BASE
# 1.31 12-Jul-2014 guenther

The statdb code has never been complete here


# 1.30 12-Jul-2014 guenther

Eliminate some annoying variable shadowing


# 1.29 05-Jul-2014 guenther

Assume POSIX: uid_t and gid_t


# 1.28 05-Jul-2014 guenther

Assume POSIX: <dirent.h>, struct dirent


# 1.27 05-Jul-2014 guenther

Use void* in malloc/realloc/calloc wrappers


Revision tags: OPENBSD_5_5_BASE
# 1.26 18-Aug-2013 guenther

Fix calls to printf-like functions which passed a non-fixed string
as the format and no variable args.
Replace "%#0.*X" with "%#.*X": the zero-fill flag is ignored/implied
on numeric conversions when a precision is specified.

ok jung@ millert@ krw@


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.25 12-Nov-2012 guenther

Once a C_RECVDIR command is sent, a matching C_END command has to be
sent later, even if the opendir() fails or the nodescend option is set.

ok krw@, ian@


# 1.24 12-Nov-2012 guenther

Fix various format string issues. Stop assuming time_t is long or smaller.
Enable warnings.

ok krw@, ian@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.23 10-Apr-2011 krw

Apply some tough type-love and give rdist a chance to handle files
larger than 2GB. Diff from Stephan R. Gerber via PR#6586, tweaks
by me.

ok deraadt@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.22 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
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


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.21 15-Feb-2009 deraadt

make rdist silently ignore special file types which cannot be moved
(well, if you turn on debug it will still tell you)
from Tim van der Molen <tbvdm@xs4all.nl


Revision tags: OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.20 04-Oct-2004 jsg

hierarchy is spelt hierarchy, ok djm@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE
# 1.19 03-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


# 1.18 14-May-2003 millert

o Sync w/ freerdist 0.92 minus the compress option
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.


# 1.17 06-May-2003 millert

use POSIX regex


# 1.16 19-Apr-2003 millert

strcpy/strcat/sprintf removal; krw@ OK


# 1.15 07-Apr-2003 deraadt

replace strcpy calls that got inlined by gcc; Hans-Joerg.Hoexer@yerbouti.franken.de


# 1.14 05-Apr-2003 deraadt

strings; ok miod ho krw


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.13 19-Nov-2001 mpech

kill more registers

millert@ ok


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.12 05-Mar-1999 millert

make output look more like what BSD pritnf does when it hits a NULL


# 1.11 05-Mar-1999 millert

Don't assume printf will deal gracefully with NULL pointers for %s, BSD does but SysV does not


# 1.10 23-Feb-1999 millert

Check lp->target for NULL, not *lp->target as required by dynamic allocation introduce in rev 1.8


# 1.9 06-Feb-1999 millert

kill redundant (and incorrect) check for mallco failure


# 1.8 04-Feb-1999 millert

Fix a serious memory consumption problem when running over directories
that contain many hard-linked files; johnh@isi.edu
Also add an xstrdup() that behaves like xmalloc() on failure.


Revision tags: OPENBSD_2_4_BASE
# 1.7 26-Jun-1998 millert

rdist 6.1.4 + OpenBSD patches + some -Wall


# 1.6 18-May-1998 deraadt

readlink len-1


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.5 21-Jul-1997 angelos

Fix compilation warning.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.4 25-Jul-1996 millert

Updated to rdist 6.1.3. Used real snprintf() (instead of string length
in the format) since we have it.


# 1.3 26-Jun-1996 deraadt

rcsid


# 1.2 05-Mar-1996 dm

rdist 6.1.2


# 1.1 03-Feb-1996 dm

rdist 6.1.1