Bug 8019 - Various improvements to the fileflags patch
Summary: Various improvements to the fileflags patch
Status: RESOLVED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.8
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-16 22:15 UTC by Mike Bombich
Modified: 2011-05-30 15:53 UTC (History)
0 users

See Also:


Attachments
Several changes to the fileflags.diff patch (42.60 KB, patch)
2011-03-16 22:15 UTC, Mike Bombich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Bombich 2011-03-16 22:15:15 UTC
Created attachment 6298 [details]
Several changes to the fileflags.diff patch

The attached patch improves the following:

- The fileflags variable was occasionally referenced without being initialized
- sx.st.st_flags is initialized in flist.c:send_file_name() so get_xattr has access to fileflags
- rsync.c: Errors that occur in undo_make_mutable are now reported (I think this also resolves an issue in which rsync would report "Unknown error (0)")
- rsync.c: make_mutable is now called in set_file_attrs allowing set_file_attrs to apply acls, xattrs, times, etc. to files in locked directories.
- syscall.c: Added make_mutable/force_change functionality to many of these system calls
Comment 1 Wayne Davison 2011-03-19 23:02:16 UTC
(In reply to comment #0)
> - The fileflags variable was occasionally referenced without being initialized

I'm not sure what you were seeing for this.  You added some setting of the static fileflags variable to 0 for the non-fileflags option case, but that variable is always 0 when that option is off.  I did change the bit that initializes F_FFLAGS(file) to ensure that force_changes w/o preserve_fileflags sets it to 0.  I also made sure that the code that fakes the value into st_flags sets a 0 if --fileflags is off.

> [...]

> - syscall.c: Added make_mutable/force_change functionality to many of these
> system calls

I note that dirname() function expects a non-const string and may potentially change the buffer, so it can't be used in these syscall functions.  I created a function that tweaks the path into a buffer and calls make_mutable() on the result, and then twiddled your new code to make use of it.  I also enhanced make_mutable() a bit and simplified some of the existing make_mutable() calls.

The result has been checked into the patches git repo.

Thanks!