diff --git a/src/XrdApps/XrdCpConfig.cc b/src/XrdApps/XrdCpConfig.cc index 4a0d87c985f..4718cb8dbbe 100644 --- a/src/XrdApps/XrdCpConfig.cc +++ b/src/XrdApps/XrdCpConfig.cc @@ -81,7 +81,7 @@ static XrdSysError eDest(&Logger, ""); XrdSysError *XrdCpConfig::Log = &XrdCpConfiguration::eDest; -const char *XrdCpConfig::opLetters = ":C:d:D:fFhHI:NpPrRsS:t:T:vVX:y:z:ZA"; +const char *XrdCpConfig::opLetters = ":C:d:D:EfFhHI:NpPrRsS:t:T:vVX:y:z:ZA"; struct option XrdCpConfig::opVec[] = // For getopt_long() { @@ -94,6 +94,7 @@ struct option XrdCpConfig::opVec[] = // For getopt_long() {OPT_TYPE "infiles", 1, 0, XrdCpConfig::OpIfile}, {OPT_TYPE "license", 0, 0, XrdCpConfig::OpLicense}, {OPT_TYPE "nopbar", 0, 0, XrdCpConfig::OpNoPbar}, + {OPT_TYPE "notlsok", 0, 0, XrdCpConfig::OpNoTlsOK}, {OPT_TYPE "path", 0, 0, XrdCpConfig::OpPath}, {OPT_TYPE "posc", 0, 0, XrdCpConfig::OpPosc}, {OPT_TYPE "proxy", 1, 0, XrdCpConfig::OpProxy}, @@ -103,6 +104,7 @@ struct option XrdCpConfig::opVec[] = // For getopt_long() {OPT_TYPE "silent", 0, 0, XrdCpConfig::OpSilent}, {OPT_TYPE "sources", 1, 0, XrdCpConfig::OpSources}, {OPT_TYPE "streams", 1, 0, XrdCpConfig::OpStreams}, + {OPT_TYPE "tlsdata", 0, 0, XrdCpConfig::OpTlsData}, {OPT_TYPE "tpc", 1, 0, XrdCpConfig::OpTpc}, {OPT_TYPE "verbose", 0, 0, XrdCpConfig::OpVerbose}, {OPT_TYPE "version", 0, 0, XrdCpConfig::OpVersion}, @@ -241,6 +243,8 @@ do{while(optind < Argc && Legacy(optind)) {} break; case OpNoPbar: OpSpec |= DoNoPbar; break; + case OpNoTlsOK: OpSpec |= DoNoTlsOK; + break; case OpPath: OpSpec |= DoPath; break; case OpPosc: OpSpec |= DoPosc; @@ -265,6 +269,8 @@ do{while(optind < Argc && Legacy(optind)) {} case OpStreams: OpSpec |= DoStreams; if (!a2i(optarg, &nStrm, 1, 15)) Usage(22); break; + case OpTlsData: OpSpec |= DoTlsData; + break; case OpTpc: OpSpec |= DoTpc; if (!strcmp("delegate", optarg)) {OpSpec|= DoTpcDlgt; @@ -881,9 +887,9 @@ void XrdCpConfig::Usage(int rc) static const char *Options= "\n" "Options: [--cksum ] [--debug ] [--coerce] [--dynamic-src]\n" " [--force] [--help] [--infiles ] [--license] [--nopbar]\n" - " [--path] [--parallel ] [--posc] [--proxy :]\n" + " [--notlsok] [--path] [--parallel ] [--posc] [--proxy :]\n" " [--recursive] [--retry ] [--server] [--silent] [--sources ]\n" - " [--streams ] [--tpc [delegate] {first|only}] [--verbose]\n" + " [--streams ] [--tlsdata] [--tpc [delegate] {first|only}] [--verbose]\n" " [--version] [--xrate ] [--zip ] [--allow-http]"; static const char *Syntax2= "\n" @@ -911,6 +917,7 @@ void XrdCpConfig::Usage(int rc) "-H | --license prints license terms and conditions\n" "-I | --infiles specifies the file that contains a list of input files\n" "-N | --nopbar does not print the progress bar\n" + " --notlsok allow fallback to xroot protocol if xroots specified\n" "-p | --path automatically create remote destination path\n" "-P | --posc enables persist on successful close semantics\n" "-D | --proxy uses the specified SOCKS4 proxy connection\n" @@ -920,6 +927,7 @@ void XrdCpConfig::Usage(int rc) "-s | --silent produces no output other than error messages\n" "-y | --sources uses up to the number of sources specified in parallel\n" "-S | --streams copies using the specified number of TCP connections\n" + "-E | --tlsdata entrcypt data as well for xroots protocol\n" "-T | --tpc uses third party copy mode between the src and dest.\n" " Both the src and dest must allow tpc mode. Argument\n" " 'first' tries tpc and if it fails, does a normal copy;\n" diff --git a/src/XrdApps/XrdCpConfig.hh b/src/XrdApps/XrdCpConfig.hh index e8f72442e9e..8c1fe5837f9 100644 --- a/src/XrdApps/XrdCpConfig.hh +++ b/src/XrdApps/XrdCpConfig.hh @@ -65,7 +65,7 @@ struct defVar int Parallel; // Number of simultaneous copy ops (1 to 4) char *pHost; // -> SOCKS4 proxy hname (0 if none) int pPort; // SOCKS4 proxy port - int OpSpec; // Bit mask of set options (see Doxxxx) + long long OpSpec; // Bit mask of set options (see Doxxxx) int Dlvl; // Debug level (0 to 3) int nSrcs; // Number of sources wanted (dflt 1) int nStrm; // Number of streams wanted (dflt 1) @@ -88,82 +88,88 @@ char *zipFile; // The file name if the URL points to a ZIP a static XrdSysError *Log; // -> Error message object -static const int OpCksum = 'C'; // -adler -MD5 legacy -> DoCksrc -static const int DoCksrc = 0x00000001; // --cksum :source -static const int DoCksum = 0x00000002; // --cksum -static const int DoCkprt = 0x00000004; // --cksum :print +static const int OpCksum = 'C'; // -adler -MD5 legacy -> DoCksrc +static const int DoCksrc = 0x0000000000000001LL; // --cksum :source +static const int DoCksum = 0x0000000000000002LL; // --cksum +static const int DoCkprt = 0x0000000000000004LL; // --cksum :print static const int OpCoerce = 'F'; -static const int DoCoerce = 0x00000008; // -F | --coerce +static const int DoCoerce = 0x0000000000000008LL; // -F | --coerce static const int OpDebug = 'd'; -static const int DoDebug = 0x00000010; // -d | --debug +static const int DoDebug = 0x0000000000000010LL; // -d | --debug static const int OpForce = 'f'; -static const int DoForce = 0x00000020; // -f | --force +static const int DoForce = 0x0000000000000020LL; // -f | --force static const int OpHelp = 'h'; -static const int DoHelp = 0x00000040; // -h | --help +static const int DoHelp = 0x0000000000000040LL; // -h | --help static const int OpIfile = 'I'; -static const int DoIfile = 0x00000080; // -I | --infiles +static const int DoIfile = 0x0000000000000080LL; // -I | --infiles -static const int OpLicense = 'H'; // -H | --license +static const int OpLicense = 'H'; // -H | --license -static const int OpNoPbar = 'N'; -static const int DoNoPbar = 0x00000100; // -N | --nopbar | -np {legacy} +static const int OpNoPbar = 'N'; // -N | --nopbar | -np {legacy} +static const int DoNoPbar = 0x0000000000000100LL; static const int OpPath = 'p'; -static const int DoPath = 0x00800000; // -p | --path +static const int DoPath = 0x0000000000800000LL; // -p | --path static const int OpPosc = 'P'; -static const int DoPosc = 0x00000200; // -P | --posc +static const int DoPosc = 0x0000000000000200LL; // -P | --posc static const int OpProxy = 'D'; -static const int DoProxy = 0x00000400; // -D | --proxy +static const int DoProxy = 0x0000000000000400LL; // -D | --proxy static const int OpRecurse = 'r'; -static const int OpRecursv = 'R'; -static const int DoRecurse = 0x00000800; // -r | --recursive | -R {legacy} +static const int OpRecursv = 'R'; // -r | --recursive | -R {legacy} +static const int DoRecurse = 0x0000000000000800LL; static const int OpRetry = 't'; -static const int DoRetry = 0x00001000; // -t | --retry +static const int DoRetry = 0x0000000000001000LL; // -t | --retry static const int OpServer = 0x03; -static const int DoServer = 0x00002000; // --server +static const int DoServer = 0x0000000000002000LL; // --server static const int OpSilent = 's'; -static const int DoSilent = 0x00004000; // -s | --silent +static const int DoSilent = 0x0000000000004000LL; // -s | --silent static const int OpSources = 'y'; -static const int DoSources = 0x00008000; // -y | --sources +static const int DoSources = 0x0000000000008000LL; // -y | --sources static const int OpStreams = 'S'; -static const int DoStreams = 0x00010000; // -S | --streams +static const int DoStreams = 0x0000000000010000LL; // -S | --streams -static const int OpTpc = 'T'; -static const int DoTpc = 0x00020000; // -T | --tpc {first | only} -static const int DoTpcOnly = 0x00100000; // -T | --tpc only -static const int DoTpcDlgt = 0x00800000; // -T | --tpc delegate ... +static const int OpTpc = 'T'; // -T | --tpc [delegate] {first | only} +static const int DoTpc = 0x0000000000020000LL; // --tpc {first | only} +static const int DoTpcOnly = 0x0000000000100000LL; // --tpc only +static const int DoTpcDlgt = 0x0000000000800000LL; // --tpc delegate ... static const int OpVerbose = 'v'; -static const int DoVerbose = 0x00040000; // -v | --verbose +static const int DoVerbose = 0x0000000000040000LL; // -v | --verbose -static const int OpVersion = 'V'; // -V | --version +static const int OpVersion = 'V'; // -V | --version static const int OpXrate = 'X'; -static const int DoXrate = 0x00080000; // -X | --xrate +static const int DoXrate = 0x0000000000080000LL; // -X | --xrate static const int OpParallel = 0x04; -static const int DoParallel = 0x00200000; // --parallel +static const int DoParallel = 0x0000000000200000LL; // --parallel static const int OpDynaSrc = 'Z'; -static const int DoDynaSrc = 0x00400000; // --dynamic-src +static const int DoDynaSrc = 0x0000000000400000LL; // --dynamic-src -// const int DoTpcDlgt = 0x00800000; // Marker to show bit used +// const int DoTpcDlgt = 0x0000000000800000LL; // Marker for bit used static const int OpZip = 'z'; -static const int DoZip = 0x01000000;// --zip +static const int DoZip = 0x0000000001000000LL; // -z | --zip + +static const int OpTlsData = 'E'; +static const int DoTlsData = 0x0000000002000000LL; // -E | --tlsdata + +static const int OpNoTlsOK = 0x05; +static const int DoNoTlsOK = 0x0000000004000000LL; // --notlsok // Flag to allow the use of HTTP (and HTTPS) as source and destination // protocols. If specified, the XrdClHttp client plugin must be available