diff options
author | Wayne Davison <wayned@samba.org> | 2011-12-16 09:03:25 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2011-12-16 09:07:19 -0800 |
commit | a3b62ff4cf1175a52c851d196b94aa378976621d (patch) | |
tree | 850eab331102afef76d07541fa5311f3f7881042 /generator.c | |
parent | 60ef39705797c9df7069297eb4ed5feab5e88f29 (diff) | |
download | rsync-a3b62ff4cf1175a52c851d196b94aa378976621d.tar.gz rsync-a3b62ff4cf1175a52c851d196b94aa378976621d.tar.bz2 rsync-a3b62ff4cf1175a52c851d196b94aa378976621d.zip |
Avoid double-free of xattr/acl data in real_sx.
Fixes bug 8665.
Diffstat (limited to 'generator.c')
-rw-r--r-- | generator.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/generator.c b/generator.c index df690da6..e05d889c 100644 --- a/generator.c +++ b/generator.c @@ -1349,8 +1349,9 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, dry_missing_dir = file; file->flags |= FLAG_MISSING_DIR; } + init_stat_x(&real_sx); + real_sx.st = sx.st; real_ret = statret; - real_sx = sx; if (file->flags & FLAG_DIR_CREATED) statret = -1; if (!preserve_perms) { /* See comment in non-dir code below. */ @@ -1653,8 +1654,9 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, } } + init_stat_x(&real_sx); + real_sx.st = sx.st; /* Don't copy xattr/acl pointers, as they would free wrong. */ real_ret = statret; - real_sx = sx; if (partial_dir && (partialptr = partial_dir_fname(fname)) != NULL && link_stat(partialptr, &partial_st, 0) == 0 |