Wayne Davison [Thu, 5 Feb 2004 01:07:23 +0000 (01:07 +0000)]
- Fixed a bug using --numeric-ids as non-root when the receiver
does not have permissions to set one or more of the gids.
- If the add_[ug]id() routine couldn't find a name for an ID, we
still note the ID in our list of IDs so that we don't try to
look it up again (and again). (The name-less IDs are stripped
when sending the IDs from the sender to the receiver.)
- Created a better add_to_list() function that handles the linking
of the new node into the list (rather than the caller doing it).
- Added new internal functions for some receiver-side work that
needed to be done in multiple places (the recv_add_[ug]id()
functions).
- We output debug info even for ID mappings that have no names.
This make the list complete and also notes which gids get
mapped to -1 (GID_NONE).
- Turned several while loops into for loops.
Wayne Davison [Wed, 4 Feb 2004 19:25:11 +0000 (19:25 +0000)]
If a gid doesn't have a name on the originating system, the receiver
won't see it in the list of IDs to remap. That means that we need to
call the is_in_group() function from inside match_gid() to know if we
can set the group or not (if we're not root).
Wayne Davison [Mon, 2 Feb 2004 21:33:03 +0000 (21:33 +0000)]
- Use as little memory as possible for the file_struct (saves another 3
bytes per file).
- Made the idev struct allocated by the group-malloc again (J.W. suggested
the proper way to align it for all systems).
- Added init_flist().
Wayne Davison [Mon, 2 Feb 2004 05:06:36 +0000 (05:06 +0000)]
- Changed the file-list allocation to alloc all the memory we need
with one call, not with several mallocs and strdups.
- Got rid of string_area() stuff (as suggested in the "@todo").
- Enhanced free_file() to optionally free the whole struct or to
clear it (since we don't need to do both).
- Don't zero out the other flist data when we're about to free it.
Wayne Davison [Sun, 1 Feb 2004 17:29:41 +0000 (17:29 +0000)]
- Fixed the bug where the --daemon option would squelch all option errors
for later parameters.
- Complain if someone passes us -l and we don't support symlinks.
Wayne Davison [Sun, 1 Feb 2004 16:28:31 +0000 (16:28 +0000)]
Changed the rdev code to have both an "rdev" variable (which always
has the full device value) and an "rdev_high" variable (which zeros
the lower byte in the last rdev value).
Wayne Davison [Tue, 27 Jan 2004 01:05:14 +0000 (01:05 +0000)]
Improved the differentiation of the transmit flags from the live flags
by naming the transmit flags with an XMIT_ prefix. Improved the names
of two other flags, got rid of the LIVE_FLAGS mask, and shortened the
flag storage in the flist struct (to save memory).
Wayne Davison [Tue, 27 Jan 2004 01:05:13 +0000 (01:05 +0000)]
Use the new names for the transmit-flag defines. We also make sure
that the FLAG_TOP_DIR flag doesn't get set in the live data for a
non-directory (when it's used as a kluge to prevent a 0x00 byte being
sent over the wire for the flag data).
Wayne Davison [Sun, 25 Jan 2004 22:32:11 +0000 (22:32 +0000)]
Added defines (FLAG_HLINK_EOL, HL_CHECK_MASTER, and HL_SKIP) and changed
the struct hlink to have an index into the hlink_list[] array instead of
a head pointer.
Wayne Davison [Sun, 25 Jan 2004 22:32:10 +0000 (22:32 +0000)]
We now link the hard-linked flist entries into a circular list, mark
the last item with FLAG_HLINK_EOL, and save off an index for our
master entry in the hlink_list[] array. Added the hard_link_check()
function.
Wayne Davison [Sun, 25 Jan 2004 22:32:09 +0000 (22:32 +0000)]
Use the new hard_link_check() function to figure out which one of the
hard-linked files to send (when -H was specified, of course). Moved
the call to do_hard_links() and the final directory-permissions scan
into generate_files() from recv_files().