search for: file_struct

Displaying 20 results from an estimated 107 matches for "file_struct".

2008 Mar 19
0
[PATCH] Unsnarl missing_below/dry_run logic.
...te/missing.test | 28 +++++++++++++++++ 2 files changed, 69 insertions(+), 38 deletions(-) create mode 100644 testsuite/missing.test diff --git a/generator.c b/generator.c index c06ea0d..b209812 100644 --- a/generator.c +++ b/generator.c @@ -1213,6 +1213,14 @@ static void list_file_entry(struct file_struct *f) static int phase = 0; static int dflt_perms; +static int implied_dirs_are_missing; +/* Helper for recv_generator's skip_dir and dry_missing_dir tests. */ +static BOOL is_below(struct file_struct *file, struct file_struct *subtree) +{ + return F_DEPTH(file) > F_DEPTH(subtree) + &...
2004 Feb 06
4
memory reduction
As those of you who watch CVS will be aware Wayne has been making progress in reducing memory requirements of rsync. Much of what he has done has been the product of discussions between he and myself that started a month ago with John Van Essen. Most recently Wayne has changed how the file_struct and its associated data are allocated, eliminating the string areas. Most of these changes have been small and relatively low impact although combining the allocation of the file_struct with the strings does impact the memory management of file_struct. Attached is a patch that implements the next...
2004 Mar 10
4
HFS+ resource forks: WIP patch included
...7 +737,7 @@ if (lastdir && strcmp(fname, lastdir) == 0) { file->dirname = lastdir; } else { - file->dirname = strdup(fname); + file->dirname = STRDUP(ap,fname); lastdir = file->dirname; } file->basename = STRDUP(ap, p + 1); @@ -804,6 +804,9 @@ struct file_struct *file; extern int delete_excluded; + struct file_struct *file_hfsrf; + extern char *hfs_mode; + /* f is set to -1 when calculating deletion file list */ file = make_file(fname, &flist->string_area, f == -1 && delete_excluded? SERVER_EXCLUDES @@ -831,8 +834,77 @@ local...
2004 Jan 25
2
scan for first existing hard-link file
...e to be created). ..wayne.. -------------- next part -------------- --- backup.c 20 Jan 2004 05:24:07 -0000 1.19 +++ backup.c 25 Jan 2004 09:54:32 -0000 @@ -25,6 +25,7 @@ extern int backup_suffix_len; extern int backup_dir_len; extern char *backup_suffix; extern char *backup_dir; +extern struct file_struct **hlink_list; extern int am_root; extern int preserve_devices; @@ -263,7 +264,7 @@ static int keep_backup(char *fname) } #endif if (!kept && preserve_hard_links && file->link_u.links - && file->F_HEAD != file) { + && hlink_list[file->F_INDEX...
2002 Jan 13
1
rsynd-2.5.1 / hlink.c patches
...w@qsl.network Personal Opinion Only EAGLE> gdiff -u ref_src:hlink.c lcl_src:hlink.c_unix --- ref_src:hlink.c Sat Jan 5 13:27:03 2002 +++ lcl_src:hlink.c_unix Sat Jan 12 19:28:00 2002 @@ -23,7 +23,8 @@ extern int verbose; #if SUPPORT_HARD_LINKS -static int hlink_compare(struct file_struct *f1,struct file_struct *f2) +static int hlink_compare + (const struct file_struct *f1, const struct file_struct *f2) { if (!S_ISREG(f1->mode) && !S_ISREG(f2->mode)) return 0; if (!S_ISREG(f1->mode)) return -1; @@ -60,7 +61,7 @@ qsort(hlink_list,flist->count...
2003 Jul 24
0
(no subject)
...1:27:53 2003 *************** *** 31,37 **** void sum_init(void); void sum_update(char *p, int len); void sum_end(char *sum); ! void close_all(void); void _exit_cleanup(int code, const char *file, int line); void cleanup_disable(void); void cleanup_set(char *fnametmp, char *fname, struct file_struct *file, --- 31,37 ---- void sum_init(void); void sum_update(char *p, int len); void sum_end(char *sum); ! void close_all(); void _exit_cleanup(int code, const char *file, int line); void cleanup_disable(void); void cleanup_set(char *fnametmp, char *fname, struct file_struct *file, ******...
2004 May 10
2
read error produces null-byte-filled destination file
I've run into a bug in the IO handling when reading a file. Suppose I have a file that lives on an NFS filesystem. That filesystem is NOT being exported with auth=0 permissions. So, if I try to access a file as root, it successfully opens the file, but subsequent reads fail with EACCES. This produces a destination file full of null bytes. I noticed this with 2.5.7, but checked 2.6.2 as
2002 Apr 03
3
metadata in dryrun mode
As I reported a while back rsync doesn't handle metadata (permissions and ownership) in dryrun mode. I offered to make a patch and that offer still stands. I didn't have the time for it until now and want to pick it up again. I had some ugly hack back then but I want to redo it in a clean way. I would like some input on my thoughts. IMHO, it would be ideally if the check for dry_run
2010 Jun 15
3
about rsyncing of block devices
...int copy_devices; extern int am_root; extern int am_server; extern int am_sender; @@ -328,7 +329,8 @@ int read_ndx_and_attrs(int f_in, int *if if (iflags & ITEM_TRANSFER) { int i = ndx - cur_flist->ndx_start; - if (i < 0 || !S_ISREG(cur_flist->files[i]->mode)) { + struct file_struct *file = cur_flist->files[i]; + if (i < 0 || !(S_ISREG(file->mode) || (copy_devices && IS_DEVICE(file->mode)))) { rprintf(FERROR, "received request to transfer non-regular file: %d [%s]\n", ndx, who_am_i()); diff -pur rsync-3.0.7/sender.c rsync-3.0.7.new/...
2008 Mar 26
1
rsync 3.0.1pre -H fails assertion
Wayne, I have this bug in redhat bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=439074 Summary: rsync 3.0.1pre -H fails assertion Is it ok to pass this kind of bug directly upstream filing a new bug in bugzilla and linking the fedora bug ? (There is also a reproducer there) Simo. -- Simo Sorce * Red Hat, Inc * New York
2004 Feb 16
1
[patch] Add `--link-by-hash' option (rev 2).
...this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* This file contains code used by the --link-by-hash option. */ + +#include "rsync.h" + +extern char *link_by_hash_dir; + +#ifdef HAVE_LINK + +char* make_hash_name(struct file_struct *file) +{ + char hash[33], *dst; + unsigned char *src; + unsigned char c; + int i; + + src = (unsigned char*)file->u.sum; + for (dst = hash, i = 0; i < 4; i++, src++) { + c = *src >> 4; + *(dst++) = (c >= 10) ? (c - 10 + 'a') : (c + '0'); + c = *src & 0x0f; +...
2008 Feb 15
4
Revised flags patch
...(f, to_wire_mode(mode)); +#ifdef SUPPORT_FLAGS + if (fileflags_ndx && !(xflags & XMIT_SAME_FLAGS)) + write_int(f, (int)fileflags); +#endif if (uid_ndx && !(xflags & XMIT_SAME_UID)) { if (protocol_version < 30) write_int(f, uid); @@ -610,6 +624,9 @@ static struct file_struct *recv_file_ent { static int64 modtime; static mode_t mode; +#ifdef SUPPORT_FLAGS + static uint32 fileflags; +#endif #ifdef SUPPORT_HARD_LINKS static int64 dev; #endif @@ -745,6 +762,11 @@ static struct file_struct *recv_file_ent if (chmod_modes && !S_ISLNK(mode)) mode = tweak_...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 4).
...this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* This file contains code used by the --link-by-hash option. */ + +#include "rsync.h" + +extern char *link_by_hash_dir; + +#ifdef HAVE_LINK + +char* make_hash_name(struct file_struct *file) +{ + char hash[33], *dst; + unsigned char *src; + unsigned char c; + int i; + + src = (unsigned char*)file->u.sum; + for (dst = hash, i = 0; i < 4; i++, src++) { + c = *src >> 4; + *(dst++) = (c >= 10) ? (c - 10 + 'a') : (c + '0'); + c = *src & 0x0f; +...
2004 Feb 17
0
[patch] Add `--link-by-hash' option (rev 3).
...this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* This file contains code used by the --link-by-hash option. */ + +#include "rsync.h" + +extern char *link_by_hash_dir; + +#ifdef HAVE_LINK + +char* make_hash_name(struct file_struct *file) +{ + char hash[33], *dst; + unsigned char *src; + unsigned char c; + int i; + + src = (unsigned char*)file->u.sum; + for (dst = hash, i = 0; i < 4; i++, src++) { + c = *src >> 4; + *(dst++) = (c >= 10) ? (c - 10 + 'a') : (c + '0'); + c = *src & 0x0f; +...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 5).
...this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* This file contains code used by the --link-by-hash option. */ + +#include "rsync.h" + +extern char *link_by_hash_dir; + +#ifdef HAVE_LINK + +char* make_hash_name(struct file_struct *file) +{ + char hash[33], *dst; + unsigned char *src; + unsigned char c; + int i; + + src = (unsigned char*)file->u.sum; + for (dst = hash, i = 0; i < 4; i++, src++) { + c = *src >> 4; + *(dst++) = (c >= 10) ? (c - 10 + 'a') : (c + '0'); + c = *src & 0x0f; +...
2023 May 17
1
[PATCH] Add --omit-{device,special}-times options
...rms; extern int preserve_mtimes; extern int omit_dir_times; extern int omit_link_times; +extern int omit_device_times; +extern int omit_special_times; extern int delete_mode; extern int delete_before; extern int delete_during; @@ -482,7 +484,12 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp) return 0; #endif } else { - if (preserve_mtimes && any_time_differs(sxp, file, fname)) + int keep_time = !preserve_mtimes ? 0 + : S_ISDIR(file->mode) ? !omit_dir_times + : IS_DEVICE(file->mode) ? !omit_device_times + : IS_SPECIAL(file->mo...
2007 Dec 13
3
rsync 3.00pre6 segfault in add_dirs_to_tree
...:2068 #2 0x0000000000419052 in client_run (f_in=16, f_out=16, pid=-1, argc=1, argv=0x56c230) at main.c:1033 #3 0x000000000041a09a in main (argc=2, argv=0x56c230) at main.c:1260 (gdb) bt f #0 add_dirs_to_tree (parent_ndx=-1, from_flist=0x56c590, dir_cnt=1) at flist.c:1422 file = (struct file_struct *) 0x0 ~~~~it crashes at add_dirs_to_tree() when reference a NULL pointer. i = 2 dp = (int32_t *) 0x2a983f2f28 parent_dp = (int32_t *) 0x0 (gdb) p *((struct file_list *)0x56c590)->sorted[0] $4 = {dirname = 0x0, modtime = 1197492871, len32 = 4096, mode = 16895, flags =...
2003 Jun 25
3
patch draft for extended attributes on linux
...} +#endif + #if SUPPORT_HARD_LINKS if (preserve_hard_links && S_ISREG(file->mode)) { if (remote_version < 26) { @@ -457,7 +463,9 @@ static void send_file_entry(struct file_ } - +/** + * This matches up with send_file_entry() + **/ static void receive_file_entry(struct file_struct **fptr, unsigned flags, int f) { @@ -555,6 +563,13 @@ static void receive_file_entry(struct fi sanitize_path(file->link, file->dirname); } } + +#if SUPPORT_XATTRS + if (opt_xattr) { + xalist_receive(f, file); + } +#endif + #if SUPPORT...
2005 Jan 05
1
rsync filename heuristics
...17:00:06.000000000 +1000 > @@ -42,11 +42,12 @@ > extern int always_checksum; > extern int modify_window; > extern char *compare_dest; > +extern int fuzzy; > > > /* choose whether to skip a particular file */ > static int skip_file(char *fname, > - struct file_struct *file, STRUCT_STAT *st) > + struct file_struct *file, const STRUCT_STAT *st) > { > if (st->st_size != file->length) { > return 0; > @@ -185,7 +186,61 @@ > return s; > } > > +/* Returns -1 for can't open (null file), -2 for skip */ > +static i...
2004 Jan 27
1
Differentiating debug messages from both sides
...t to %.0f bytes, did%s move\n", + rprintf(FINFO, "[%c] expand file_list to %.0f bytes, did%s move\n", + *who_am_i, (double)sizeof(flist->files[0]) * flist->malloced, (new_ptr == flist->files) ? " not" : ""); @@ -781,8 +783,10 @@ struct file_struct *make_file(char *fnam skip_excludes: - if (verbose > 2) - rprintf(FINFO, "make_file(%s,*,%d)\n", fname, exclude_level); + if (verbose > 2) { + rprintf(FINFO, "[%c] make_file(%s,*,%d)\n", + *who_am_i, fname, exclude_level); + } file = new(struct file_stru...