|
|
| version 1.1.1.2, 2013/10/14 07:51:14 | version 1.1.1.3, 2016/11/01 09:54:32 |
|---|---|
| Line 3 | Line 3 |
| * | * |
| * Copyright (C) Andrew Tridgell 1996 | * Copyright (C) Andrew Tridgell 1996 |
| * Copyright (C) Paul Mackerras 1996 | * Copyright (C) Paul Mackerras 1996 |
| * Copyright (C) 2004-2013 Wayne Davison | * Copyright (C) 2004-2015 Wayne Davison |
| * | * |
| * This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify |
| * it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by |
| Line 26 int file_extra_cnt = 0; /* count of file-list extras t | Line 26 int file_extra_cnt = 0; /* count of file-list extras t |
| int inc_recurse = 0; | int inc_recurse = 0; |
| int compat_flags = 0; | int compat_flags = 0; |
| int use_safe_inc_flist = 0; | int use_safe_inc_flist = 0; |
| int want_xattr_optim = 0; | |
| int proper_seed_order = 0; | |
| extern int am_server; | extern int am_server; |
| extern int am_sender; | extern int am_sender; |
| Line 76 int filesfrom_convert = 0; | Line 78 int filesfrom_convert = 0; |
| #define CF_SYMLINK_TIMES (1<<1) | #define CF_SYMLINK_TIMES (1<<1) |
| #define CF_SYMLINK_ICONV (1<<2) | #define CF_SYMLINK_ICONV (1<<2) |
| #define CF_SAFE_FLIST (1<<3) | #define CF_SAFE_FLIST (1<<3) |
| #define CF_AVOID_XATTR_OPTIM (1<<4) | |
| #define CF_CHKSUM_SEED_FIX (1<<5) | |
| static const char *client_info; | static const char *client_info; |
| Line 267 void setup_protocol(int f_out,int f_in) | Line 271 void setup_protocol(int f_out,int f_in) |
| #endif | #endif |
| if (local_server || strchr(client_info, 'f') != NULL) | if (local_server || strchr(client_info, 'f') != NULL) |
| compat_flags |= CF_SAFE_FLIST; | compat_flags |= CF_SAFE_FLIST; |
| if (local_server || strchr(client_info, 'x') != NULL) | |
| compat_flags |= CF_AVOID_XATTR_OPTIM; | |
| if (local_server || strchr(client_info, 'C') != NULL) | |
| compat_flags |= CF_CHKSUM_SEED_FIX; | |
| write_byte(f_out, compat_flags); | write_byte(f_out, compat_flags); |
| } else | } else |
| compat_flags = read_byte(f_in); | compat_flags = read_byte(f_in); |
| /* The inc_recurse var MUST be set to 0 or 1. */ | /* The inc_recurse var MUST be set to 0 or 1. */ |
| inc_recurse = compat_flags & CF_INC_RECURSE ? 1 : 0; | inc_recurse = compat_flags & CF_INC_RECURSE ? 1 : 0; |
| want_xattr_optim = protocol_version >= 31 && !(compat_flags & CF_AVOID_XATTR_OPTIM); | |
| proper_seed_order = compat_flags & CF_CHKSUM_SEED_FIX ? 1 : 0; | |
| if (am_sender) { | if (am_sender) { |
| receiver_symlink_times = am_server | receiver_symlink_times = am_server |
| ? strchr(client_info, 'L') != NULL | ? strchr(client_info, 'L') != NULL |
| Line 323 void setup_protocol(int f_out,int f_in) | Line 333 void setup_protocol(int f_out,int f_in) |
| if (am_server) { | if (am_server) { |
| if (!checksum_seed) | if (!checksum_seed) |
| checksum_seed = time(NULL); | checksum_seed = time(NULL) ^ (getpid() << 6); |
| write_int(f_out, checksum_seed); | write_int(f_out, checksum_seed); |
| } else { | } else { |
| checksum_seed = read_int(f_in); | checksum_seed = read_int(f_in); |