summaryrefslogtreecommitdiff
path: root/util.c
Commit message (Collapse)AuthorAgeFilesLines
* Bump the year to 2014.Wayne Davison2014-01-261-1/+1
|
* Fix a few issues with make_path().Wayne Davison2013-12-231-4/+18
| | | | | | | | The make_path() utility function was not returning the right status when --dry-run was used, so I added some stat() checking that only happens for -n. I also noticed that the function was not handling the case where the whole path needed to be created, so I fixed that. Fixes bug 10209.
* Move some code from util.c to util2.c and add sum_as_hex().Wayne Davison2013-06-111-60/+0
|
* Fix module-name splitting with --protect-args.Wayne Davison2013-06-021-0/+6
| | | | Fixes bug 8838.
* Fix msleep() if time goes backwards. Fixes bug 9789.Wayne Davison2013-05-191-0/+2
|
* Update copyright year.Wayne Davison2013-01-191-1/+1
|
* Fix bogus "vanished file" with "./" prefixes.Wayne Davison2012-10-071-3/+5
| | | | Fixes bug 9212.
* Test asprintf() failure with < 0, not <= 0.Wayne Davison2011-10-081-2/+2
|
* Let's cast getpid() to an int instead of a long for snprintf().Wayne Davison2011-10-081-3/+5
|
* Mention the number of child args.Wayne Davison2011-05-071-1/+3
|
* Avoid adding a slash to path '/'.Wayne Davison2011-04-221-2/+3
|
* Applying the preallocate patch.Wayne Davison2011-04-041-0/+36
|
* Move time setting to syscall.c and add syscall fallback.Wayne Davison2010-08-261-35/+42
| | | | See bug 5506 and bug 7621.
* Add --omit-link-times and use CAN_SET_SYMLINK_TIMES less.Wayne Davison2010-08-261-9/+4
|
* Avoid a non-writable-by-the-user file when copying xattrs.Wayne Davison2010-08-211-0/+5
| | | | Fixes part of the problem in bug 5147.
* May as well use do_mkdir() directly these days.Wayne Davison2010-04-301-7/+0
|
* Don't set the umask to 0 any more: it's ugly and pointless.Matt McCutchen2010-04-241-15/+3
|
* This should fix another checker warning.Wayne Davison2009-12-121-2/+2
|
* Moved a few group-related functions with some minor tweaks;Wayne Davison2009-10-201-32/+0
|
* Add support for transferring & setting nsec time values.Wayne Davison2009-09-071-3/+12
|
* Always use lutimes() if it is available.Wayne Davison2009-09-071-8/+7
|
* Use typedefs for the filter structures.Wayne Davison2009-05-231-1/+1
|
* Enhance name_to_{u,g}id() to optionally parse numbers and renameWayne Davison2009-05-071-4/+12
| | | | to {user,group}_to_*(). Based on a patch by Matt McCutchen.
* More backup improvements:Wayne Davison2009-04-111-29/+69
| | | | | | | | | | | | | | | - Changed get_backup_name() to verify the backup path, and make any missing directories. This avoids accidental use of a symlink as a dir in a backup path, and gets rid of any other non-dirs that are in the way. It also avoids the need for various operations to retry after calling make_bak_dir(), simplifying several pices of code. - Changed create_directory_path() to make_path(), giving it flags that lets the caller decide if it should skip a leading slash or drop the trailing filename. - Mention when we create the backup directory, so the user is not caught unaware when rsync uses a directory they didn't expect. - Got rid of some dir-moving backup code that is not used. - Added a little more backup-debug output.
* Improved the unsafe_symlink() code to not get fooled by extra '/' charsWayne Davison2009-03-031-30/+25
| | | | in the symlink's path. Added test cases. This fixes bug #6151.
* Update the copyright year.Wayne Davison2009-01-031-1/+1
|
* Change clean_fname() to keep "//" at the start for cygwin.Wayne Davison2008-11-151-3/+11
|
* Fixed a bunch of "warn_unused_result" compiler warnings.Wayne Davison2008-11-091-1/+4
|
* Moved the flist_ndx_{push,pop}() routines from io.c into util.c.Wayne Davison2008-09-261-0/+33
|
* Convey the cleaned-up module-path to the user in all cases.Wayne Davison2008-09-111-0/+28
| | | | Fixed a just-introduced problem with a relative module-path.
* Split up the ifuncs.h file into 3 .h files.Wayne Davison2008-09-011-0/+2
|
* Output numbers in 3-digit groups by default (e.g. 1,234,567).Wayne Davison2008-09-011-17/+1
| | | | | Also improved the human-readable output functions, including adding the ability to output negative numbers.
* Fixed a couple minor problems in util.c:Wayne Davison2008-08-011-3/+7
| | | | | | - Make sure that handle_partial_dir() never returns a truncated fname. - Make robust_rename() return that it failed to do a cross-device copy if the partial-dir could not be created.
* Moving big_num() into lib/compat.c so tls.c can use it.Wayne Davison2008-07-171-43/+0
|
* Changed human_num() to big_num() with an extra arg so that it canWayne Davison2008-07-171-10/+10
| | | | be used in place of all %.0f output idioms.
* Added the --info=FLAGS an --debug=FLAGS options, which allowsWayne Davison2008-07-131-5/+4
| | | | fine-grained output control (in addition to the coarse -v).
* Fixed several issues with preserving xattrs when using --backup.Wayne Davison2008-05-171-0/+8
|
* Preserve the right errno value when trying adjunct functions duringWayne Davison2008-05-171-7/+28
| | | | robust backup, copy, and renaming activities.
* Fix a file-globbing bug in the daemon when chroot is on.Wayne Davison2008-04-111-1/+1
|
* Fixed a potential overflow issue with realloc() that Sebastian KrahmerWayne Davison2008-04-081-2/+5
| | | | pointed out.
* Improved the chdir() code:Wayne Davison2008-03-301-35/+19
| | | | | | | | | | | | | - Renamed push_dir() to change_dir() and revised it a little so that it can chdir() to a relative path without an intervening chdir() back to the staring path. - Renamed push_pathname() to change_pathname() and revised it to take different args and to only call path_is_daemon_excluded() on a new path (not a revisit of a file's already-checked path). - Fixed change_pathname() to set the right pathname value when a chdir() call fails. - Set orig_dir once outside of the change_pathname() function. - Got rid of pop_dir().
* Don't send daemon-config filter-action messages back to the user.Wayne Davison2008-03-241-3/+3
|
* Made the filename arg-parsing code skip args that have excluded pathWayne Davison2008-03-221-14/+7
| | | | | | | components, returning the same errors that would occur if the path elements didn't actually exist. The glob_match() code was also changed to no longer truncate an arg with an excluded path element (it just omits excluded items from glob matching).
* Improved ENSURE_MEMSPACE() macro and use it in more places in glob code.Wayne Davison2008-03-221-13/+6
|
* Make glob_expand() return an indicator if the glob had no matches.Wayne Davison2008-03-211-7/+13
|
* A couple improvements to the new arg-globbing code:Wayne Davison2008-03-211-45/+52
| | | | | | - Put all the state variables into a single struct. - Reuse the buffer memory for each glob_expand() call until a final call with a NULL pointer tells us to free it.
* Changed the arg-globbing routine to use a custom arg-globbing algorithmWayne Davison2008-03-201-87/+146
| | | | | | that does not include any daemon-excluded items in the matches. It is also not subverted by the presence of one or more dot-dir elements in an arg.
* Some improvements to the file-name cleaning code:Wayne Davison2008-03-201-22/+28
| | | | | | | | | - Removed the CFN_KEEP_LEADING_DOT_DIR flag for clean_fname(). - Explicitly add an implied dot-dir to the transfer rather than keeping a leading a "./" prefix as a part of a relative pathname. - Added the CFN_KEEP_DOT_DIRS flag for clean_fname(). - Added the SP_KEEP_DOT_DIRS flag for sanitize_path(). - Call clean_fname() a couple more times.
* Changed the name of the server_filter_list to beWayne Davison2008-03-201-12/+11
| | | | daemon_filter_list, for improved clarity.
* Fixed a bug in the truncating of daemon-excluded paths.Wayne Davison2008-03-201-5/+3
|