diff --git a/README/README.AUTH b/README/README.AUTH index ead2831036b7c..77a9545e4713c 100644 --- a/README/README.AUTH +++ b/README/README.AUTH @@ -1,3 +1,7 @@ +# NOTE: The auth package is depcreated and will be remove in v6.42. +ROOT will not provide socket authentication anymore but assumes that TSocket connections are between trusted processes. +Consider using SSH tunneling if you need secure network connections. + Authentication to ROOT servers (TServerSocket) ============================================== diff --git a/core/base/inc/LinkDef3.h b/core/base/inc/LinkDef3.h index 5adf791bafbe7..886df79ea99d8 100644 --- a/core/base/inc/LinkDef3.h +++ b/core/base/inc/LinkDef3.h @@ -163,7 +163,7 @@ #pragma link C++ class TFileInfo+; #pragma link C++ class TFileInfoMeta+; #pragma link C++ class TFileCollection+; -#pragma link C++ class TVirtualAuth; +#pragma link C++ class ROOT::Deprecated::TVirtualAuth; #pragma link C++ class TVirtualMutex; #pragma link C++ class ROOT::TVirtualRWMutex; #pragma link C++ class TLockGuard; diff --git a/core/base/inc/TROOT.h b/core/base/inc/TROOT.h index f7692a5db7da2..e85e43eb8ff48 100644 --- a/core/base/inc/TROOT.h +++ b/core/base/inc/TROOT.h @@ -99,10 +99,15 @@ namespace ROOT { UInt_t GetThreadPoolSize(); } +namespace ROOT::Deprecated::Internal { +TSeqCollection *GetListOfSecContexts(const TROOT &); +} // namespace ROOT::Deprecated::Internal + class TROOT : public TDirectory { friend class TCling; friend TROOT *ROOT::Internal::GetROOT2(); +friend TSeqCollection *ROOT::Deprecated::Internal::GetListOfSecContexts(const TROOT &); private: Int_t fLineIsProcessing = 0; ///< To synchronize multi-threads @@ -256,7 +261,9 @@ friend TROOT *ROOT::Internal::GetROOT2(); TSeqCollection *GetListOfStreamerInfo() const { return fStreamerInfo; } TSeqCollection *GetListOfMessageHandlers() const { return fMessageHandlers; } TCollection *GetListOfClassGenerators() const { return fClassGenerators; } - TSeqCollection *GetListOfSecContexts() const { return fSecContexts; } + TSeqCollection *GetListOfSecContexts() const + R__DEPRECATED(6, 42, "GetListOfSecContexts is deprecated. See README.AUTH for details.") + { return ROOT::Deprecated::Internal::GetListOfSecContexts(*this); } TSeqCollection *GetClipboard() const { return fClipboard; } TSeqCollection *GetListOfDataSets() const { return fDataSets; } TCollection *GetListOfEnums(Bool_t load = kFALSE); diff --git a/core/base/inc/TVirtualAuth.h b/core/base/inc/TVirtualAuth.h index eb72d87aed7ac..fe87432830e28 100644 --- a/core/base/inc/TVirtualAuth.h +++ b/core/base/inc/TVirtualAuth.h @@ -21,9 +21,12 @@ #include "Rtypes.h" -class TSecContext; class TSocket; +namespace ROOT::Deprecated { + +class TSecContext; + class TVirtualAuth { public: @@ -39,4 +42,10 @@ class TVirtualAuth { ClassDef(TVirtualAuth,0) // client auth interface }; +} // namespace ROOT::Deprecated + +using TVirtualAuth R__DEPRECATED(6, 42, "TVirtualAuth is deprecated. ROOT will not provide " + "socket authentication anymore but assumes that TSocket connections are between trusted processes. " + "Consider using SSH tunneling if you need secure network connections.") = ROOT::Deprecated::TVirtualAuth; + #endif diff --git a/core/base/src/TROOT.cxx b/core/base/src/TROOT.cxx index 700e01f15ce09..4caca7d16cc0f 100644 --- a/core/base/src/TROOT.cxx +++ b/core/base/src/TROOT.cxx @@ -170,6 +170,11 @@ FARPROC dlsym(void *library, const char *function_name) #include "TWinNTSystem.h" #endif +TSeqCollection *ROOT::Deprecated::Internal::GetListOfSecContexts(const TROOT &r) +{ + return r.fSecContexts; +} + extern "C" void R__SetZipMode(int); static DestroyInterpreter_t *gDestroyInterpreter = nullptr; @@ -2835,7 +2840,7 @@ void TROOT::SetBatch(Bool_t batch) /// interactive mode. /// - "server:port": turns the web display into server mode with specified port. Web widgets will not be displayed, /// only text message with window URL will be printed on standard output -/// +/// /// \note See more details related to webdisplay on RWebWindowsManager::ShowWindow void TROOT::SetWebDisplay(const char *webdisplay) diff --git a/etc/plugins/TFile/P120_TNetFile.C b/etc/plugins/TFile/P120_TNetFile.C index f7a2706078e4d..da9f773e40af2 100644 --- a/etc/plugins/TFile/P120_TNetFile.C +++ b/etc/plugins/TFile/P120_TNetFile.C @@ -1,17 +1,17 @@ void P120_TNetFile() { - gPluginMgr->AddHandler("TFile", "^rootd:", "TNetFile", - "Net", "TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); - gPluginMgr->AddHandler("TFile", "^rootup:", "TNetFile", - "Net", "TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); - gPluginMgr->AddHandler("TFile", "^roots:", "TNetFile", - "Net", "TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); - gPluginMgr->AddHandler("TFile", "^rootk:", "TNetFile", - "Net", "TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); - gPluginMgr->AddHandler("TFile", "^rootg:", "TNetFile", - "Net", "TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); - gPluginMgr->AddHandler("TFile", "^rooth:", "TNetFile", - "Net", "TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); - gPluginMgr->AddHandler("TFile", "^rootug:", "TNetFile", - "Net", "TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); + gPluginMgr->AddHandler("TFile", "^rootd:", "ROOT::Deprecated::TNetFile", + "Net", "ROOT::Deprecated::TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); + gPluginMgr->AddHandler("TFile", "^rootup:", "ROOT::Deprecated::TNetFile", + "Net", "ROOT::Deprecated::TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); + gPluginMgr->AddHandler("TFile", "^roots:", "ROOT::Deprecated::TNetFile", + "Net", "ROOT::Deprecated::TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); + gPluginMgr->AddHandler("TFile", "^rootk:", "ROOT::Deprecated::TNetFile", + "Net", "ROOT::Deprecated::TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); + gPluginMgr->AddHandler("TFile", "^rootg:", "ROOT::Deprecated::TNetFile", + "Net", "ROOT::Deprecated::TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); + gPluginMgr->AddHandler("TFile", "^rooth:", "ROOT::Deprecated::TNetFile", + "Net", "ROOT::Deprecated::TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); + gPluginMgr->AddHandler("TFile", "^rootug:", "ROOT::Deprecated::TNetFile", + "Net", "ROOT::Deprecated::TNetFile(const char*,Option_t*,const char*,Int_t,Int_t)"); } diff --git a/etc/plugins/TFileStager/P020_TNetFileStager.C b/etc/plugins/TFileStager/P020_TNetFileStager.C index 2d467a1a9775b..f28b6ae9ae9d1 100644 --- a/etc/plugins/TFileStager/P020_TNetFileStager.C +++ b/etc/plugins/TFileStager/P020_TNetFileStager.C @@ -1,17 +1,17 @@ void P020_TNetFileStager() { - gPluginMgr->AddHandler("TFileStager", "^rootd:", "TNetFileStager", - "Net", "TNetFileStager(const char *)"); - gPluginMgr->AddHandler("TFileStager", "^rootup:", "TNetFileStager", - "Net", "TNetFileStager(const char *)"); - gPluginMgr->AddHandler("TFileStager", "^roots:", "TNetFileStager", - "Net", "TNetFileStager(const char *)"); - gPluginMgr->AddHandler("TFileStager", "^rootk:", "TNetFileStager", - "Net", "TNetFileStager(const char *)"); - gPluginMgr->AddHandler("TFileStager", "^rootg:", "TNetFileStager", - "Net", "TNetFileStager(const char *)"); - gPluginMgr->AddHandler("TFileStager", "^rooth:", "TNetFileStager", - "Net", "TNetFileStager(const char *)"); - gPluginMgr->AddHandler("TFileStager", "^rootug:", "TNetFileStager", - "Net", "TNetFileStager(const char *)"); + gPluginMgr->AddHandler("TFileStager", "^rootd:", "ROOT::Deprecated::TNetFileStager", + "Net", "ROOT::Deprecated::TNetFileStager(const char *)"); + gPluginMgr->AddHandler("TFileStager", "^rootup:", "ROOT::Deprecated::TNetFileStager", + "Net", "ROOT::Deprecated::TNetFileStager(const char *)"); + gPluginMgr->AddHandler("TFileStager", "^roots:", "ROOT::Deprecated::TNetFileStager", + "Net", "ROOT::Deprecated::TNetFileStager(const char *)"); + gPluginMgr->AddHandler("TFileStager", "^rootk:", "ROOT::Deprecated::TNetFileStager", + "Net", "ROOT::Deprecated::TNetFileStager(const char *)"); + gPluginMgr->AddHandler("TFileStager", "^rootg:", "ROOT::Deprecated::TNetFileStager", + "Net", "ROOT::Deprecated::TNetFileStager(const char *)"); + gPluginMgr->AddHandler("TFileStager", "^rooth:", "ROOT::Deprecated::TNetFileStager", + "Net", "ROOT::Deprecated::TNetFileStager(const char *)"); + gPluginMgr->AddHandler("TFileStager", "^rootug:", "ROOT::Deprecated::TNetFileStager", + "Net", "ROOT::Deprecated::TNetFileStager(const char *)"); } diff --git a/etc/plugins/TSystem/P070_TNetSystem.C b/etc/plugins/TSystem/P070_TNetSystem.C index 45a5cca5bf862..96b93493f75d8 100644 --- a/etc/plugins/TSystem/P070_TNetSystem.C +++ b/etc/plugins/TSystem/P070_TNetSystem.C @@ -1,17 +1,17 @@ void P070_TNetSystem() { - gPluginMgr->AddHandler("TSystem", "^rootd:", "TNetSystem", - "Net", "TNetSystem(const char *,Bool_t)"); - gPluginMgr->AddHandler("TSystem", "^rootup:", "TNetSystem", - "Net", "TNetSystem(const char *,Bool_t)"); - gPluginMgr->AddHandler("TSystem", "^roots:", "TNetSystem", - "Net", "TNetSystem(const char *,Bool_t)"); - gPluginMgr->AddHandler("TSystem", "^rootk:", "TNetSystem", - "Net", "TNetSystem(const char *,Bool_t)"); - gPluginMgr->AddHandler("TSystem", "^rootg:", "TNetSystem", - "Net", "TNetSystem(const char *,Bool_t)"); - gPluginMgr->AddHandler("TSystem", "^rooth:", "TNetSystem", - "Net", "TNetSystem(const char *,Bool_t)"); - gPluginMgr->AddHandler("TSystem", "^rootug:", "TNetSystem", - "Net", "TNetSystem(const char *,Bool_t)"); + gPluginMgr->AddHandler("TSystem", "^rootd:", "ROOT::Deprecated::TNetSystem", + "Net", "ROOT::Deprecated::TNetSystem(const char *,Bool_t)"); + gPluginMgr->AddHandler("TSystem", "^rootup:", "ROOT::Deprecated::TNetSystem", + "Net", "ROOT::Deprecated::TNetSystem(const char *,Bool_t)"); + gPluginMgr->AddHandler("TSystem", "^roots:", "ROOT::Deprecated::TNetSystem", + "Net", "ROOT::Deprecated::TNetSystem(const char *,Bool_t)"); + gPluginMgr->AddHandler("TSystem", "^rootk:", "ROOT::Deprecated::TNetSystem", + "Net", "ROOT::Deprecated::TNetSystem(const char *,Bool_t)"); + gPluginMgr->AddHandler("TSystem", "^rootg:", "ROOT::Deprecated::TNetSystem", + "Net", "ROOT::Deprecated::TNetSystem(const char *,Bool_t)"); + gPluginMgr->AddHandler("TSystem", "^rooth:", "ROOT::Deprecated::TNetSystem", + "Net", "ROOT::Deprecated::TNetSystem(const char *,Bool_t)"); + gPluginMgr->AddHandler("TSystem", "^rootug:", "ROOT::Deprecated::TNetSystem", + "Net", "ROOT::Deprecated::TNetSystem(const char *,Bool_t)"); } diff --git a/etc/plugins/TVirtualAuth/P010_TRootAuth.C b/etc/plugins/TVirtualAuth/P010_TRootAuth.C index fa1013e0dd0fa..099400ef945e5 100644 --- a/etc/plugins/TVirtualAuth/P010_TRootAuth.C +++ b/etc/plugins/TVirtualAuth/P010_TRootAuth.C @@ -1,5 +1,5 @@ void P010_TRootAuth() { - gPluginMgr->AddHandler("TVirtualAuth", "Root", "TRootAuth", - "RootAuth", "TRootAuth()"); + gPluginMgr->AddHandler("TVirtualAuth", "Root", "ROOT::Deprecated::TRootAuth", + "RootAuth", "ROOT::Deprecated::TRootAuth()"); } diff --git a/io/io/src/TFile.cxx b/io/io/src/TFile.cxx index 459919ca42541..6b97e04797bc4 100644 --- a/io/io/src/TFile.cxx +++ b/io/io/src/TFile.cxx @@ -3985,7 +3985,7 @@ TFile *TFile::Open(const char *url, Option_t *options, const char *ftitle, if (h->LoadPlugin() == -1) return nullptr; TClass *cl = TClass::GetClass(h->GetClass()); - if (cl && cl->InheritsFrom("TNetFile")) + if (cl && cl->InheritsFrom("ROOT::Deprecated::TNetFile")) f = (TFile*) h->ExecPlugin(5, name.Data(), option, ftitle, compress, netopt); else f = (TFile*) h->ExecPlugin(4, name.Data(), option, ftitle, compress); diff --git a/net/auth/inc/AuthConst.h b/net/auth/inc/AuthConst.h index bf5daff5a1022..066b938cf16fb 100644 --- a/net/auth/inc/AuthConst.h +++ b/net/auth/inc/AuthConst.h @@ -22,6 +22,8 @@ #include "RtypesCore.h" +namespace ROOT::Deprecated { + // Number of security levels and masks const Int_t kMAXSEC = 6; const Int_t kMAXSECBUF = 4096; @@ -33,4 +35,20 @@ const Int_t kMAXRSATRIES = 100; const Int_t kPRIMELENGTH = 20; const Int_t kPRIMEEXP = 40; +} // namespace ROOT::Deprecated + +const Int_t kMAXSEC R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::kMAXSEC; +const Int_t kMAXSECBUF R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::kMAXSECBUF; +const Int_t kAUTH_REUSE_MSK R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = + ROOT::Deprecated::kAUTH_REUSE_MSK; +const Int_t kAUTH_CRYPT_MSK R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = + ROOT::Deprecated::kAUTH_CRYPT_MSK; +const Int_t kAUTH_SSALT_MSK R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = + ROOT::Deprecated::kAUTH_SSALT_MSK; +const Int_t kAUTH_RSATY_MSK R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = + ROOT::Deprecated::kAUTH_RSATY_MSK; +const Int_t kMAXRSATRIES R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::kMAXRSATRIES; +const Int_t kPRIMELENGTH R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::kPRIMELENGTH; +const Int_t kPRIMEEXP R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::kPRIMEEXP; + #endif diff --git a/net/auth/inc/LinkDefRoot.h b/net/auth/inc/LinkDefRoot.h index 3ac609bc9e781..0fc34a9f1029d 100644 --- a/net/auth/inc/LinkDefRoot.h +++ b/net/auth/inc/LinkDefRoot.h @@ -12,9 +12,9 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class TAuthenticate; -#pragma link C++ class THostAuth; -#pragma link C++ class TRootAuth; -#pragma link C++ class TRootSecContext; +#pragma link C++ class ROOT::Deprecated::TAuthenticate; +#pragma link C++ class ROOT::Deprecated::THostAuth; +#pragma link C++ class ROOT::Deprecated::TRootAuth; +#pragma link C++ class ROOT::Deprecated::TRootSecContext; #endif diff --git a/net/auth/inc/TAuthenticate.h b/net/auth/inc/TAuthenticate.h index e246932d8039c..6ab85d1907f1b 100644 --- a/net/auth/inc/TAuthenticate.h +++ b/net/auth/inc/TAuthenticate.h @@ -30,30 +30,33 @@ #endif #include "AuthConst.h" -class TAuthenticate; -class THostAuth; class TPluginHandler; class TSocket; -class TRootSecContext; class TVirtualMutex; -typedef Int_t (*CheckSecCtx_t)(const char *subj, TRootSecContext *ctx); -typedef Int_t (*GlobusAuth_t)(TAuthenticate *auth, TString &user, TString &det); -typedef Int_t (*Krb5Auth_t)(TAuthenticate *auth, TString &user, TString &det, Int_t version); -typedef Int_t (*SecureAuth_t)(TAuthenticate *auth, const char *user, const char *passwd, - const char *remote, TString &det, Int_t version); - -R__EXTERN TVirtualMutex *gAuthenticateMutex; +namespace ROOT::Deprecated { struct R__rsa_KEY; // opaque replacement for rsa_KEY struct R__rsa_KEY_export; // opaque replacement for rsa_KEY_export struct R__rsa_NUMBER; // opaque replacement for rsa_NUMBER +R__EXTERN TVirtualMutex *gAuthenticateMutex; + +class TAuthenticate; +class THostAuth; +class TRootAuth; +class TRootSecContext; + +typedef Int_t (*CheckSecCtx_t)(const char *subj, ROOT::Deprecated::TRootSecContext *ctx); +typedef Int_t (*GlobusAuth_t)(ROOT::Deprecated::TAuthenticate *auth, TString &user, TString &det); +typedef Int_t (*Krb5Auth_t)(ROOT::Deprecated::TAuthenticate *auth, TString &user, TString &det, Int_t version); +typedef Int_t (*SecureAuth_t)(ROOT::Deprecated::TAuthenticate *auth, const char *user, const char *passwd, + const char *remote, TString &det, Int_t version); + class TAuthenticate : public TObject { -friend class TRootAuth; -friend class TRootSecContext; -friend class TSocket; +friend class ROOT::Deprecated::TRootAuth; +friend class ROOT::Deprecated::TRootSecContext; public: enum ESecurity { @@ -172,13 +175,13 @@ friend class TSocket; static const char *GetGlobalUser(); static GlobusAuth_t GetGlobusAuthHook(); static THostAuth *GetHostAuth(const char *host, const char *user="", - Option_t *opt = "R", Int_t *Exact = nullptr); + Option_t *opt = "R", Int_t *Exact = nullptr); static const char *GetKrb5Principal(); static Bool_t GetPromptUser(); static Int_t GetRSAInit(); static const char *GetRSAPubExport(Int_t key = 0); static THostAuth *HasHostAuth(const char *host, const char *user, - Option_t *opt = "R"); + Option_t *opt = "R"); static void InitRandom(); static void MergeHostAuthList(TList *Std, TList *New, Option_t *Opt = ""); static char *PromptPasswd(const char *prompt = "Password: "); @@ -210,4 +213,14 @@ friend class TSocket; ClassDefOverride(TAuthenticate,0) // Class providing remote authentication service }; +} // namespace ROOT::Deprecated + +R__EXTERN TVirtualMutex *&gAuthenticateMutex R__DEPRECATED(6, 42, "the RootAuth library is deprecated"); + +using CheckSecCtx_t R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::CheckSecCtx_t; +using GlobusAuth_t R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::GlobusAuth_t; +using Krb5Auth_t R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::Krb5Auth_t; +using SecureAuth_t R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::SecureAuth_t; +using TAuthenticate R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::TAuthenticate; + #endif diff --git a/net/auth/inc/THostAuth.h b/net/auth/inc/THostAuth.h index 5f773709bfb4f..1f324e88d53e4 100644 --- a/net/auth/inc/THostAuth.h +++ b/net/auth/inc/THostAuth.h @@ -31,6 +31,8 @@ #include "TSecContext.h" // for kROOTTZERO. +namespace ROOT::Deprecated { + class THostAuth : public TObject { private: @@ -110,4 +112,8 @@ class THostAuth : public TObject { ClassDefOverride(THostAuth,1) // Class providing host specific authentication information }; +} // namespace ROOT::Deprecated + +using THostAuth R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::THostAuth; + #endif diff --git a/net/auth/inc/TRootAuth.h b/net/auth/inc/TRootAuth.h index 7ddfa116f673b..e9c96c8aa6954 100644 --- a/net/auth/inc/TRootAuth.h +++ b/net/auth/inc/TRootAuth.h @@ -25,9 +25,12 @@ #include "TVirtualAuth.h" #include "Rtypes.h" -class TSecContext; class TSocket; +namespace ROOT::Deprecated { + +class TSecContext; + class TRootAuth : public TVirtualAuth { public: @@ -43,4 +46,8 @@ class TRootAuth : public TVirtualAuth { ClassDefOverride(TRootAuth,0) // client auth interface }; +} // namespace ROOT::Deprecated + +using TRootAuth R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::TRootAuth; + #endif diff --git a/net/auth/inc/TRootSecContext.h b/net/auth/inc/TRootSecContext.h index a16dc8f6c871a..7cb0ca5306291 100644 --- a/net/auth/inc/TRootSecContext.h +++ b/net/auth/inc/TRootSecContext.h @@ -24,6 +24,8 @@ #include "TAuthenticate.h" #include "TSecContext.h" +namespace ROOT::Deprecated { + class TRootSecContext : public TSecContext { private: @@ -51,4 +53,8 @@ class TRootSecContext : public TSecContext { ClassDefOverride(TRootSecContext,0) // Class providing host specific authentication information }; +} + +using TRootSecContext R__DEPRECATED(6, 42, "the RootAuth library is deprecated") = ROOT::Deprecated::TRootSecContext; + #endif diff --git a/net/auth/src/TAuthenticate.cxx b/net/auth/src/TAuthenticate.cxx index 565acdad724bf..5af49f683bfa3 100644 --- a/net/auth/src/TAuthenticate.cxx +++ b/net/auth/src/TAuthenticate.cxx @@ -79,14 +79,16 @@ extern "C" char *crypt(const char *, const char *); # include #endif -struct R__rsa_KEY: rsa_KEY { R__rsa_KEY(): rsa_KEY() {} }; -struct R__rsa_KEY_export: rsa_KEY_export {}; -struct R__rsa_NUMBER: rsa_NUMBER {}; - #ifdef R__SSL static BF_KEY fgBFKey; // Blowfish symmetric key #endif +namespace ROOT::Deprecated { + +struct R__rsa_KEY: rsa_KEY { R__rsa_KEY(): rsa_KEY() {} }; +struct R__rsa_KEY_export: rsa_KEY_export {}; +struct R__rsa_NUMBER: rsa_NUMBER {}; + // Statics initialization TList *TAuthenticate::fgAuthInfo = 0; TString TAuthenticate::fgAuthMeth[] = { "UsrPwd", "Unsupported", "Unsupported", @@ -118,8 +120,12 @@ Int_t TAuthenticate::fgProcessID = -1; TVirtualMutex *gAuthenticateMutex = 0; +} // namespace ROOT::Deprecated + +TVirtualMutex *&gAuthenticateMutex = ROOT::Deprecated::gAuthenticateMutex; + // Standard version of Sec Context match checking -Int_t StdCheckSecCtx(const char *, TRootSecContext *); +static Int_t StdCheckSecCtx(const char *, ROOT::Deprecated::TRootSecContext *); @@ -158,8 +164,7 @@ static int auth_rand() //////////////////////////////////////////////////////////////////////////////// /// Create authentication object. -TAuthenticate::TAuthenticate(TSocket *sock, const char *remote, - const char *proto, const char *user) +ROOT::Deprecated::TAuthenticate::TAuthenticate(TSocket *sock, const char *remote, const char *proto, const char *user) { if (gDebug > 2 && gAuthenticateMutex) Info("Authenticate", "locking mutex (pid: %d)",gSystem->GetPid()); @@ -328,7 +333,7 @@ TAuthenticate::TAuthenticate(TSocket *sock, const char *remote, //////////////////////////////////////////////////////////////////////////////// /// Called in connection with a timer timeout -void TAuthenticate::CatchTimeOut() +void ROOT::Deprecated::TAuthenticate::CatchTimeOut() { Info("CatchTimeOut", "%d sec timeout expired (protocol: %s)", fgAuthTO, fgAuthMeth[fSecurity].Data()); @@ -344,7 +349,7 @@ void TAuthenticate::CatchTimeOut() /// Authenticate to remote rootd server. Return kTRUE if /// authentication succeeded. -Bool_t TAuthenticate::Authenticate() +Bool_t ROOT::Deprecated::TAuthenticate::Authenticate() { if (gDebug > 2 && gAuthenticateMutex) Info("Authenticate", "locking mutex (pid: %d)",gSystem->GetPid()); @@ -656,7 +661,7 @@ Bool_t TAuthenticate::Authenticate() /// Set default authentication environment. The values are inferred /// from fSecurity and fDetails. -void TAuthenticate::SetEnvironment() +void ROOT::Deprecated::TAuthenticate::SetEnvironment() { R__LOCKGUARD2(gAuthenticateMutex); @@ -778,8 +783,7 @@ void TAuthenticate::SetEnvironment() //////////////////////////////////////////////////////////////////////////////// /// Try to get user name and passwd from several sources. -Bool_t TAuthenticate::GetUserPasswd(TString &user, TString &passwd, - Bool_t &pwhash, Bool_t srppwd) +Bool_t ROOT::Deprecated::TAuthenticate::GetUserPasswd(TString &user, TString &passwd, Bool_t &pwhash, Bool_t srppwd) { if (srppwd) { Error("GetUserPasswd", "SRP no longer supported by ROOT"); @@ -846,7 +850,7 @@ Bool_t TAuthenticate::GetUserPasswd(TString &user, TString &passwd, /// ~/.netrc files. For more info see the version with 4 arguments. /// This version is maintained for backward compatability reasons. -Bool_t TAuthenticate::CheckNetrc(TString &user, TString &passwd) +Bool_t ROOT::Deprecated::TAuthenticate::CheckNetrc(TString &user, TString &passwd) { Bool_t hash = false; return CheckNetrc(user, passwd, hash, /* srppwd */ false); @@ -876,8 +880,7 @@ Bool_t TAuthenticate::CheckNetrc(TString &user, TString &passwd) /// /// for the secure protocols. All lines must start in the first column. -Bool_t TAuthenticate::CheckNetrc(TString &user, TString &passwd, - Bool_t &pwhash, Bool_t srppwd) +Bool_t ROOT::Deprecated::TAuthenticate::CheckNetrc(TString &user, TString &passwd, Bool_t &pwhash, Bool_t srppwd) { if (srppwd) { Error("CheckNetrc", "SRP no longer supported by ROOT"); @@ -971,7 +974,7 @@ Bool_t TAuthenticate::CheckNetrc(TString &user, TString &passwd, //////////////////////////////////////////////////////////////////////////////// /// Static method returning the global user. -const char *TAuthenticate::GetGlobalUser() +const char *ROOT::Deprecated::TAuthenticate::GetGlobalUser() { return fgUser; } @@ -979,7 +982,7 @@ const char *TAuthenticate::GetGlobalUser() //////////////////////////////////////////////////////////////////////////////// /// Static method returning the global password hash flag. -Bool_t TAuthenticate::GetGlobalPwHash() +Bool_t ROOT::Deprecated::TAuthenticate::GetGlobalPwHash() { return fgPwHash; } @@ -987,7 +990,7 @@ Bool_t TAuthenticate::GetGlobalPwHash() //////////////////////////////////////////////////////////////////////////////// /// Static method returning the global SRP password flag. -Bool_t TAuthenticate::GetGlobalSRPPwd() +Bool_t ROOT::Deprecated::TAuthenticate::GetGlobalSRPPwd() { return false; } @@ -995,7 +998,7 @@ Bool_t TAuthenticate::GetGlobalSRPPwd() //////////////////////////////////////////////////////////////////////////////// /// Static method returning default expiring date for new validity contexts -TDatime TAuthenticate::GetGlobalExpDate() +TDatime ROOT::Deprecated::TAuthenticate::GetGlobalExpDate() { return fgExpDate; } @@ -1003,7 +1006,7 @@ TDatime TAuthenticate::GetGlobalExpDate() //////////////////////////////////////////////////////////////////////////////// /// Static method returning the default user information. -const char *TAuthenticate::GetDefaultUser() +const char *ROOT::Deprecated::TAuthenticate::GetDefaultUser() { return fgDefaultUser; } @@ -1011,7 +1014,7 @@ const char *TAuthenticate::GetDefaultUser() //////////////////////////////////////////////////////////////////////////////// /// Static method returning the principal to be used to init Krb5 tickets. -const char *TAuthenticate::GetKrb5Principal() +const char *ROOT::Deprecated::TAuthenticate::GetKrb5Principal() { ::Error("Krb5Auth", "Kerberos5 is no longer supported by ROOT"); return nullptr; @@ -1020,7 +1023,7 @@ const char *TAuthenticate::GetKrb5Principal() //////////////////////////////////////////////////////////////////////////////// /// Static method returning the authentication reuse settings. -Bool_t TAuthenticate::GetAuthReUse() +Bool_t ROOT::Deprecated::TAuthenticate::GetAuthReUse() { return fgAuthReUse; } @@ -1028,7 +1031,7 @@ Bool_t TAuthenticate::GetAuthReUse() //////////////////////////////////////////////////////////////////////////////// /// Static method returning the prompt user settings. -Bool_t TAuthenticate::GetPromptUser() +Bool_t ROOT::Deprecated::TAuthenticate::GetPromptUser() { return fgPromptUser; } @@ -1036,7 +1039,7 @@ Bool_t TAuthenticate::GetPromptUser() //////////////////////////////////////////////////////////////////////////////// /// Static method returning the method corresponding to idx. -const char *TAuthenticate::GetAuthMethod(Int_t idx) +const char *ROOT::Deprecated::TAuthenticate::GetAuthMethod(Int_t idx) { R__LOCKGUARD2(gAuthenticateMutex); @@ -1051,7 +1054,7 @@ const char *TAuthenticate::GetAuthMethod(Int_t idx) /// Static method returning the method index (which can be used to find /// the method in GetAuthMethod()). Returns -1 in case meth is not found. -Int_t TAuthenticate::GetAuthMethodIdx(const char *meth) +Int_t ROOT::Deprecated::TAuthenticate::GetAuthMethodIdx(const char *meth) { R__LOCKGUARD2(gAuthenticateMutex); @@ -1071,7 +1074,7 @@ Int_t TAuthenticate::GetAuthMethodIdx(const char *meth) /// Returns user name (which must be deleted by caller) or 0. /// If non-interactive run returns default user. -char *TAuthenticate::PromptUser(const char *remote) +char *ROOT::Deprecated::TAuthenticate::PromptUser(const char *remote) { R__LOCKGUARD2(gAuthenticateMutex); @@ -1111,7 +1114,7 @@ char *TAuthenticate::PromptUser(const char *remote) /// to get passwd. Returns passwd (which must de deleted by caller) or 0. /// If non-interactive run returns -1 -char *TAuthenticate::PromptPasswd(const char *prompt) +char *ROOT::Deprecated::TAuthenticate::PromptPasswd(const char *prompt) { if (isatty(0) == 0 || isatty(1) == 0) { ::Warning("TAuthenticate::PromptPasswd", @@ -1163,7 +1166,7 @@ char *TAuthenticate::PromptPasswd(const char *prompt) //////////////////////////////////////////////////////////////////////////////// /// Static method returning the globus authorization hook (no longer supported) -GlobusAuth_t TAuthenticate::GetGlobusAuthHook() +ROOT::Deprecated::GlobusAuth_t ROOT::Deprecated::TAuthenticate::GetGlobusAuthHook() { return nullptr; } @@ -1171,7 +1174,7 @@ GlobusAuth_t TAuthenticate::GetGlobusAuthHook() //////////////////////////////////////////////////////////////////////////////// /// Static method returning the RSA public keys. -const char *TAuthenticate::GetRSAPubExport(Int_t key) +const char *ROOT::Deprecated::TAuthenticate::GetRSAPubExport(Int_t key) { key = (key >= 0 && key <= 1) ? key : 0; return fgRSAPubExport[key].keys; @@ -1180,7 +1183,7 @@ const char *TAuthenticate::GetRSAPubExport(Int_t key) //////////////////////////////////////////////////////////////////////////////// /// Static method returning the RSA initialization flag. -Int_t TAuthenticate::GetRSAInit() +Int_t ROOT::Deprecated::TAuthenticate::GetRSAInit() { return fgRSAInit; } @@ -1188,7 +1191,7 @@ Int_t TAuthenticate::GetRSAInit() //////////////////////////////////////////////////////////////////////////////// /// Static method setting the default type of RSA key. -void TAuthenticate::SetDefaultRSAKeyType(Int_t key) +void ROOT::Deprecated::TAuthenticate::SetDefaultRSAKeyType(Int_t key) { if (key >= 0 && key <= 1) fgRSAKey = key; @@ -1197,7 +1200,7 @@ void TAuthenticate::SetDefaultRSAKeyType(Int_t key) //////////////////////////////////////////////////////////////////////////////// /// Static method setting RSA initialization flag. -void TAuthenticate::SetRSAInit(Int_t init) +void ROOT::Deprecated::TAuthenticate::SetRSAInit(Int_t init) { fgRSAInit = init; } @@ -1205,7 +1208,7 @@ void TAuthenticate::SetRSAInit(Int_t init) //////////////////////////////////////////////////////////////////////////////// /// Static method returning the list with authentication details. -TList *TAuthenticate::GetAuthInfo() +TList *ROOT::Deprecated::TAuthenticate::GetAuthInfo() { R__LOCKGUARD2(gAuthenticateMutex); @@ -1217,7 +1220,7 @@ TList *TAuthenticate::GetAuthInfo() //////////////////////////////////////////////////////////////////////////////// /// Print error string depending on error code. -void TAuthenticate::AuthError(const char *where, Int_t err) +void ROOT::Deprecated::TAuthenticate::AuthError(const char *where, Int_t err) { R__LOCKGUARD2(gAuthenticateMutex); @@ -1251,7 +1254,7 @@ void TAuthenticate::AuthError(const char *where, Int_t err) //////////////////////////////////////////////////////////////////////////////// /// Set global user name to be used for authentication to rootd. -void TAuthenticate::SetGlobalUser(const char *user) +void ROOT::Deprecated::TAuthenticate::SetGlobalUser(const char *user) { R__LOCKGUARD2(gAuthenticateMutex); @@ -1265,7 +1268,7 @@ void TAuthenticate::SetGlobalUser(const char *user) //////////////////////////////////////////////////////////////////////////////// /// Set global passwd to be used for authentication to rootd. -void TAuthenticate::SetGlobalPasswd(const char *passwd) +void ROOT::Deprecated::TAuthenticate::SetGlobalPasswd(const char *passwd) { R__LOCKGUARD2(gAuthenticateMutex); @@ -1279,7 +1282,7 @@ void TAuthenticate::SetGlobalPasswd(const char *passwd) //////////////////////////////////////////////////////////////////////////////// /// Set global passwd hash flag to be used for authentication to rootd. -void TAuthenticate::SetGlobalPwHash(Bool_t pwhash) +void ROOT::Deprecated::TAuthenticate::SetGlobalPwHash(Bool_t pwhash) { fgPwHash = pwhash; } @@ -1287,7 +1290,7 @@ void TAuthenticate::SetGlobalPwHash(Bool_t pwhash) //////////////////////////////////////////////////////////////////////////////// /// Set global SRP passwd flag to be used for authentication to rootd. -void TAuthenticate::SetGlobalSRPPwd(Bool_t) +void ROOT::Deprecated::TAuthenticate::SetGlobalSRPPwd(Bool_t) { ::Error("SetGlobalSRPPwd", "SRP no longer supported by ROOT"); } @@ -1295,7 +1298,7 @@ void TAuthenticate::SetGlobalSRPPwd(Bool_t) //////////////////////////////////////////////////////////////////////////////// /// Set default expiring date for new validity contexts -void TAuthenticate::SetGlobalExpDate(TDatime expdate) +void ROOT::Deprecated::TAuthenticate::SetGlobalExpDate(TDatime expdate) { fgExpDate = expdate; } @@ -1303,7 +1306,7 @@ void TAuthenticate::SetGlobalExpDate(TDatime expdate) //////////////////////////////////////////////////////////////////////////////// /// Set default user name. -void TAuthenticate::SetDefaultUser(const char *defaultuser) +void ROOT::Deprecated::TAuthenticate::SetDefaultUser(const char *defaultuser) { if (fgDefaultUser != "") fgDefaultUser = ""; @@ -1315,7 +1318,7 @@ void TAuthenticate::SetDefaultUser(const char *defaultuser) //////////////////////////////////////////////////////////////////////////////// /// Set timeout (active if > 0) -void TAuthenticate::SetTimeOut(Int_t to) +void ROOT::Deprecated::TAuthenticate::SetTimeOut(Int_t to) { fgAuthTO = (to <= 0) ? -1 : to; } @@ -1323,7 +1326,7 @@ void TAuthenticate::SetTimeOut(Int_t to) //////////////////////////////////////////////////////////////////////////////// /// Set global AuthReUse flag -void TAuthenticate::SetAuthReUse(Bool_t authreuse) +void ROOT::Deprecated::TAuthenticate::SetAuthReUse(Bool_t authreuse) { fgAuthReUse = authreuse; } @@ -1331,7 +1334,7 @@ void TAuthenticate::SetAuthReUse(Bool_t authreuse) //////////////////////////////////////////////////////////////////////////////// /// Set global PromptUser flag -void TAuthenticate::SetPromptUser(Bool_t promptuser) +void ROOT::Deprecated::TAuthenticate::SetPromptUser(Bool_t promptuser) { fgPromptUser = promptuser; } @@ -1339,7 +1342,7 @@ void TAuthenticate::SetPromptUser(Bool_t promptuser) //////////////////////////////////////////////////////////////////////////////// /// Set secure authorization function. -void TAuthenticate::SetSecureAuthHook(SecureAuth_t func) +void ROOT::Deprecated::TAuthenticate::SetSecureAuthHook(SecureAuth_t func) { fgSecAuthHook = func; } @@ -1348,7 +1351,7 @@ void TAuthenticate::SetSecureAuthHook(SecureAuth_t func) /// Set kerberos5 authorization function. Automatically called when /// libKrb5Auth is loaded. -void TAuthenticate::SetKrb5AuthHook(Krb5Auth_t) +void ROOT::Deprecated::TAuthenticate::SetKrb5AuthHook(Krb5Auth_t) { ::Error("Krb5Auth", "Kerberos5 is no longer supported by ROOT"); } @@ -1357,7 +1360,7 @@ void TAuthenticate::SetKrb5AuthHook(Krb5Auth_t) /// Set Globus authorization function. Automatically called when /// libGlobusAuth is loaded. -void TAuthenticate::SetGlobusAuthHook(GlobusAuth_t) +void ROOT::Deprecated::TAuthenticate::SetGlobusAuthHook(GlobusAuth_t) { ::Error("GlobusAuth", "Globus is no longer supported by ROOT"); } @@ -1365,7 +1368,7 @@ void TAuthenticate::SetGlobusAuthHook(GlobusAuth_t) //////////////////////////////////////////////////////////////////////////////// /// SSH client authentication code (no longer supported) -Int_t TAuthenticate::SshAuth(TString & /* user */) +Int_t ROOT::Deprecated::TAuthenticate::SshAuth(TString & /* user */) { ::Error("SshAuth", "SSH is no longer supported by ROOT"); return 1; @@ -1374,7 +1377,7 @@ Int_t TAuthenticate::SshAuth(TString & /* user */) //////////////////////////////////////////////////////////////////////////////// /// Method returning the user to be used for the ssh login (no longer supported) -const char *TAuthenticate::GetSshUser(TString /* user */) const +const char *ROOT::Deprecated::TAuthenticate::GetSshUser(TString /* user */) const { ::Error("GetSshUser", "SSH is no longer supported by ROOT"); return nullptr; @@ -1386,7 +1389,7 @@ const char *TAuthenticate::GetSshUser(TString /* user */) const /// in the first field (in the case 'href' is a name, ie not IP address) /// Returns kTRUE if the two matches. -Bool_t TAuthenticate::CheckHost(const char *host, const char *href) +Bool_t ROOT::Deprecated::TAuthenticate::CheckHost(const char *host, const char *href) { R__LOCKGUARD2(gAuthenticateMutex); @@ -1444,7 +1447,7 @@ Bool_t TAuthenticate::CheckHost(const char *host, const char *href) //////////////////////////////////////////////////////////////////////////////// /// RFIO authentication (no longer supported) -Int_t TAuthenticate::RfioAuth(TString &) +Int_t ROOT::Deprecated::TAuthenticate::RfioAuth(TString &) { ::Error("RfioAuth", "RfioAuth is no longer supported by ROOT"); return -1; @@ -1455,7 +1458,7 @@ Int_t TAuthenticate::RfioAuth(TString &) /// Returns 0 in case authentication failed /// 1 in case of success -Int_t TAuthenticate::ClearAuth(TString &user, TString &passwd, Bool_t &pwdhash) +Int_t ROOT::Deprecated::TAuthenticate::ClearAuth(TString &user, TString &passwd, Bool_t &pwdhash) { R__LOCKGUARD2(gAuthenticateMutex); @@ -1907,8 +1910,8 @@ Int_t TAuthenticate::ClearAuth(TString &user, TString &passwd, Bool_t &pwdhash) /// (host,user), setting fHostAuth accordingly. /// If no entry is found fHostAuth is not changed -THostAuth *TAuthenticate::GetHostAuth(const char *host, const char *user, - Option_t */*opt*/, Int_t *exact) +ROOT::Deprecated::THostAuth * +ROOT::Deprecated::TAuthenticate::GetHostAuth(const char *host, const char *user, Option_t */*opt*/, Int_t *exact) { if (exact) *exact = 0; @@ -1979,8 +1982,8 @@ THostAuth *TAuthenticate::GetHostAuth(const char *host, const char *user, /// in the fgAuthInfo list /// Returns pointer to it or 0 -THostAuth *TAuthenticate::HasHostAuth(const char *host, const char *user, - Option_t */*opt*/) +ROOT::Deprecated::THostAuth * +ROOT::Deprecated::TAuthenticate::HasHostAuth(const char *host, const char *user, Option_t */*opt*/) { if (gDebug > 2) ::Info("TAuthenticate::HasHostAuth", "enter ... %s ... %s", host, user); @@ -2019,7 +2022,7 @@ THostAuth *TAuthenticate::HasHostAuth(const char *host, const char *user, /// The expanded, temporary file, is pointed to by 'ftmp' /// and should be already open. To be called recursively. -void TAuthenticate::FileExpand(const char *fexp, FILE *ftmp) +void ROOT::Deprecated::TAuthenticate::FileExpand(const char *fexp, FILE *ftmp) { FILE *fin; char line[kMAXPATHLEN]; @@ -2098,7 +2101,7 @@ void TAuthenticate::FileExpand(const char *fexp, FILE *ftmp) /// Determine default authentication details for method 'sec' and user 'usr'. /// Checks .rootrc family files. Returned string must be deleted by the user. -char *TAuthenticate::GetDefaultDetails(int sec, int opt, const char *usr) +char *ROOT::Deprecated::TAuthenticate::GetDefaultDetails(int sec, int opt, const char *usr) { char temp[kMAXPATHLEN] = { 0 }; const char copt[2][5] = { "no", "yes" }; @@ -2129,7 +2132,7 @@ char *TAuthenticate::GetDefaultDetails(int sec, int opt, const char *usr) //////////////////////////////////////////////////////////////////////////////// /// Remove THostAuth instance from the list -void TAuthenticate::RemoveHostAuth(THostAuth * ha, Option_t */*opt*/) +void ROOT::Deprecated::TAuthenticate::RemoveHostAuth(THostAuth * ha, Option_t */*opt*/) { GetAuthInfo()->Remove(ha); // ... destroy it @@ -2141,14 +2144,14 @@ void TAuthenticate::RemoveHostAuth(THostAuth * ha, Option_t */*opt*/) /// If 'opt' contains 's' or 'S' prints information about established TSecContext, /// else prints information about THostAuth -void TAuthenticate::Show(Option_t *opt) +void ROOT::Deprecated::TAuthenticate::Show(Option_t *opt) { TString sopt(opt); if (sopt.Contains("s", TString::kIgnoreCase)) { // Print established security contexts - TIter next(gROOT->GetListOfSecContexts()); + TIter next(ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)); TSecContext *sc = 0; while ((sc = (TSecContext *)next())) sc->Print(); @@ -2177,9 +2180,9 @@ void TAuthenticate::Show(Option_t *opt) /// options = "Opt,strlen(username),username.Data()" /// message = kROOTD_USER, ... -Int_t TAuthenticate::AuthExists(TString username, Int_t method, const char *options, - Int_t *message, Int_t *rflag, - CheckSecCtx_t checksecctx) +Int_t ROOT::Deprecated::TAuthenticate::AuthExists(TString username, Int_t method, const char *options, + Int_t *message, Int_t *rflag, + CheckSecCtx_t checksecctx) { // Welcome message, if requested ... if (gDebug > 2) @@ -2204,7 +2207,7 @@ Int_t TAuthenticate::AuthExists(TString username, Int_t method, const char *opti // If nothing found, try the all list if (!secctx) { - next = TIter(gROOT->GetListOfSecContexts()); + next = TIter(ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)); while ((secctx = (TRootSecContext *)next())) { if (secctx->GetMethod() == method) { if (fRemote == secctx->GetHost()) { @@ -2371,7 +2374,7 @@ Int_t TAuthenticate::AuthExists(TString username, Int_t method, const char *opti /// Initialize random machine using seed from /dev/urandom /// (or current time if /dev/urandom not available). -void TAuthenticate::InitRandom() +void ROOT::Deprecated::TAuthenticate::InitRandom() { static Bool_t notinit = kTRUE; @@ -2399,7 +2402,7 @@ void TAuthenticate::InitRandom() /// Generate a valid pair of private/public RSA keys to protect for /// authentication token exchange -Int_t TAuthenticate::GenRSAKeys() +Int_t ROOT::Deprecated::TAuthenticate::GenRSAKeys() { if (gDebug > 2) Info("GenRSAKeys", "enter"); @@ -2643,7 +2646,7 @@ Int_t TAuthenticate::GenRSAKeys() /// 1 letters and numbers (upper and lower case) /// 2 hex characters (upper and lower case) -char *TAuthenticate::GetRandString(Int_t opt, Int_t len) +char *ROOT::Deprecated::TAuthenticate::GetRandString(Int_t opt, Int_t len) { unsigned int iimx[4][4] = { {0x0, 0xffffff08, 0xafffffff, 0x2ffffffe}, // opt = 0 @@ -2701,8 +2704,7 @@ char *TAuthenticate::GetRandString(Int_t opt, Int_t len) /// Returns number of bytes sent, or -1 in case of error. /// enc = 1 for private encoding, enc = 2 for public encoding -Int_t TAuthenticate::SecureSend(TSocket *sock, Int_t enc, - Int_t key, const char *str) +Int_t ROOT::Deprecated::TAuthenticate::SecureSend(TSocket *sock, Int_t enc, Int_t key, const char *str) { char buftmp[kMAXSECBUF]; char buflen[20]; @@ -2762,7 +2764,7 @@ Int_t TAuthenticate::SecureSend(TSocket *sock, Int_t enc, /// Return number of received bytes or -1 in case of error. /// dec = 1 for private decoding, dec = 2 for public decoding -Int_t TAuthenticate::SecureRecv(TSocket *sock, Int_t dec, Int_t key, char **str) +Int_t ROOT::Deprecated::TAuthenticate::SecureRecv(TSocket *sock, Int_t dec, Int_t key, char **str) { char buftmp[kMAXSECBUF]; @@ -2835,8 +2837,8 @@ Int_t TAuthenticate::SecureRecv(TSocket *sock, Int_t dec, Int_t key, char **str) //////////////////////////////////////////////////////////////////////////////// /// Store RSA public keys from export string rsaPubExport. -Int_t TAuthenticate::DecodeRSAPublic(const char *rsaPubExport, R__rsa_NUMBER &rsa_n, - R__rsa_NUMBER &rsa_d, char **rsassl) +Int_t ROOT::Deprecated::TAuthenticate::DecodeRSAPublic(const char *rsaPubExport, R__rsa_NUMBER &rsa_n, + R__rsa_NUMBER &rsa_d, char **rsassl) { if (!rsaPubExport) return -1; @@ -2938,7 +2940,7 @@ Int_t TAuthenticate::DecodeRSAPublic(const char *rsaPubExport, R__rsa_NUMBER &rs /// Store RSA public keys from export string rsaPubExport. /// Returns type of stored key, or -1 is not recognized -Int_t TAuthenticate::SetRSAPublic(const char *rsaPubExport, Int_t klen) +Int_t ROOT::Deprecated::TAuthenticate::SetRSAPublic(const char *rsaPubExport, Int_t klen) { if (gDebug > 2) ::Info("TAuthenticate::SetRSAPublic", @@ -3016,7 +3018,7 @@ Int_t TAuthenticate::SetRSAPublic(const char *rsaPubExport, Int_t klen) /// Receives server RSA Public key /// Sends local RSA public key encoded -Int_t TAuthenticate::SendRSAPublicKey(TSocket *socket, Int_t key) +Int_t ROOT::Deprecated::TAuthenticate::SendRSAPublicKey(TSocket *socket, Int_t key) { // Receive server public key char serverPubKey[kMAXSECBUF]; @@ -3110,7 +3112,7 @@ Int_t TAuthenticate::SendRSAPublicKey(TSocket *socket, Int_t key) /// `/system.rootauthrc` and create related THostAuth objects. /// Files are read only if they changed since last reading -Int_t TAuthenticate::ReadRootAuthrc() +Int_t ROOT::Deprecated::TAuthenticate::ReadRootAuthrc() { // rootauthrc family TString tRootAuthrc; @@ -3329,7 +3331,7 @@ Int_t TAuthenticate::ReadRootAuthrc() /// Returns: 1 if ok, 0 if not /// Deactivates Ctx is not valid -Int_t StdCheckSecCtx(const char *user, TRootSecContext *ctx) +static Int_t StdCheckSecCtx(const char *user, ROOT::Deprecated::TRootSecContext *ctx) { Int_t rc = 0; @@ -3349,7 +3351,7 @@ Int_t StdCheckSecCtx(const char *user, TRootSecContext *ctx) /// 'nin' members used to update existing members in 'std' are /// removed from 'nin', do that they do not leak -void TAuthenticate::MergeHostAuthList(TList *std, TList *nin, Option_t *opt) +void ROOT::Deprecated::TAuthenticate::MergeHostAuthList(TList *std, TList *nin, Option_t *opt) { // Remove inactive from the 'std' TIter nxstd(std); @@ -3363,7 +3365,7 @@ void TAuthenticate::MergeHostAuthList(TList *std, TList *nin, Option_t *opt) // Merge 'nin' info in 'std' TIter nxnew(nin); - THostAuth *hanew; + ROOT::Deprecated::THostAuth *hanew; while ((hanew = (THostAuth *)nxnew())) { if (hanew->NumMethods()) { TString hostsrv; @@ -3399,9 +3401,9 @@ void TAuthenticate::MergeHostAuthList(TList *std, TList *nin, Option_t *opt) /// Tool for removing SecContext ctx from THostAuth listed in /// fgAuthInfo -void TAuthenticate::RemoveSecContext(TRootSecContext *ctx) +void ROOT::Deprecated::TAuthenticate::RemoveSecContext(TRootSecContext *ctx) { - THostAuth *ha = 0; + ROOT::Deprecated::THostAuth *ha = 0; // authinfo first TIter nxai(GetAuthInfo()); @@ -3420,7 +3422,7 @@ void TAuthenticate::RemoveSecContext(TRootSecContext *ctx) //////////////////////////////////////////////////////////////////////////////// /// Static method returning supported client protocol. -Int_t TAuthenticate::GetClientProtocol() +Int_t ROOT::Deprecated::TAuthenticate::GetClientProtocol() { return TSocket::GetClientProtocol(); } diff --git a/net/auth/src/THostAuth.cxx b/net/auth/src/THostAuth.cxx index f776e65fa05e4..21b979b5820d6 100644 --- a/net/auth/src/THostAuth.cxx +++ b/net/auth/src/THostAuth.cxx @@ -33,7 +33,7 @@ //////////////////////////////////////////////////////////////////////////////// /// Default constructor. - THostAuth::THostAuth() : TObject() + ROOT::Deprecated::THostAuth::THostAuth() : TObject() { Create(0, 0); } @@ -45,8 +45,8 @@ /// with server either "sock[d]", "root[d]" or /// 0, 1, respectively. -THostAuth::THostAuth(const char *host, const char *user, Int_t nmeth, - Int_t *authmeth, char **details) : TObject() +ROOT::Deprecated::THostAuth::THostAuth(const char *host, const char *user, Int_t nmeth, + Int_t *authmeth, char **details) : TObject() { Create(host, user, nmeth, authmeth, details); } @@ -58,8 +58,8 @@ THostAuth::THostAuth(const char *host, const char *user, Int_t nmeth, /// with server either "sock[d]", "root[d]" or /// 0, 1, respectively. -THostAuth::THostAuth(const char *host, Int_t server, const char *user, - Int_t nmeth, Int_t *authmeth, char **details) : TObject() +ROOT::Deprecated::THostAuth::THostAuth(const char *host, Int_t server, const char *user, + Int_t nmeth, Int_t *authmeth, char **details) : TObject() { Create(host, user, nmeth, authmeth, details); @@ -71,8 +71,8 @@ THostAuth::THostAuth(const char *host, Int_t server, const char *user, /// 'host' may contain also the server for whicb these directives /// are valid in the form 'host:server' or 'server://host' -THostAuth::THostAuth(const char *host, const char *user, Int_t authmeth, - const char *details) : TObject() +ROOT::Deprecated::THostAuth::THostAuth(const char *host, const char *user, Int_t authmeth, + const char *details) : TObject() { Create(host, user, 1, &authmeth, (char **)&details); } @@ -82,8 +82,8 @@ THostAuth::THostAuth(const char *host, const char *user, Int_t authmeth, /// 'host' may contain also the server for whicb these directives /// are valid in the form 'host:server' or 'server://host' -THostAuth::THostAuth(const char *host, Int_t server, const char *user, - Int_t authmeth, const char *details) : TObject() +ROOT::Deprecated::THostAuth::THostAuth(const char *host, Int_t server, const char *user, + Int_t authmeth, const char *details) : TObject() { Create(host, user, 1, &authmeth, (char **)&details); fServer = server; @@ -96,8 +96,8 @@ THostAuth::THostAuth(const char *host, Int_t server, const char *user, /// with server either "sock[d]", "root[d]" or /// 0, 1, respectively. -void THostAuth::Create(const char *host, const char *user, Int_t nmeth, - Int_t *authmeth, char **details) +void ROOT::Deprecated::THostAuth::Create(const char *host, const char *user, Int_t nmeth, + Int_t *authmeth, char **details) { int i; @@ -184,7 +184,7 @@ void THostAuth::Create(const char *host, const char *user, Int_t nmeth, //////////////////////////////////////////////////////////////////////////////// /// Copy ctor ... -THostAuth::THostAuth(THostAuth &ha) : TObject() +ROOT::Deprecated::THostAuth::THostAuth(THostAuth &ha) : TObject() { fHost = ha.fHost; fServer = ha.fServer; @@ -205,7 +205,7 @@ THostAuth::THostAuth(THostAuth &ha) : TObject() /// Add method to the list. If already there, change its /// details to 'details' -void THostAuth::AddMethod(Int_t meth, const char *details) +void ROOT::Deprecated::THostAuth::AddMethod(Int_t meth, const char *details) { // Check 'meth' if (meth < 0 || meth >= kMAXSEC) return; @@ -238,7 +238,7 @@ void THostAuth::AddMethod(Int_t meth, const char *details) //////////////////////////////////////////////////////////////////////////////// /// Remove method 'meth' from the list, if there ... -void THostAuth::RemoveMethod(Int_t meth) +void ROOT::Deprecated::THostAuth::RemoveMethod(Int_t meth) { // If we don't have it, nothing to do Int_t pos = -1; @@ -272,7 +272,7 @@ void THostAuth::RemoveMethod(Int_t meth) /// Remove all methods, leaving Active status and /// list of associted TSceContexts unchanged -void THostAuth::Reset() +void ROOT::Deprecated::THostAuth::Reset() { // Free all filled positions Int_t i = 0; @@ -290,7 +290,7 @@ void THostAuth::Reset() //////////////////////////////////////////////////////////////////////////////// /// The dtor. -THostAuth::~THostAuth() +ROOT::Deprecated::THostAuth::~THostAuth() { delete fSecContexts; } @@ -299,7 +299,7 @@ THostAuth::~THostAuth() /// Return authentication details for specified level /// or "" if the specified level does not exist for this host. -const char *THostAuth::GetDetails(Int_t level) +const char *ROOT::Deprecated::THostAuth::GetDetails(Int_t level) { Int_t i = -1; if (HasMethod(level,&i)) { @@ -315,7 +315,7 @@ const char *THostAuth::GetDetails(Int_t level) //////////////////////////////////////////////////////////////////////////////// /// Return kTRUE if method 'level' is in the list -Bool_t THostAuth::HasMethod(Int_t level, Int_t *pos) +Bool_t ROOT::Deprecated::THostAuth::HasMethod(Int_t level, Int_t *pos) { int i; for (i = 0; i < fNumMethods; i++) { @@ -331,7 +331,7 @@ Bool_t THostAuth::HasMethod(Int_t level, Int_t *pos) //////////////////////////////////////////////////////////////////////////////// /// Set authentication details for specified level. -void THostAuth::SetDetails(Int_t level, const char *details) +void ROOT::Deprecated::THostAuth::SetDetails(Int_t level, const char *details) { Int_t i = -1; if (HasMethod(level,&i)) { @@ -352,7 +352,7 @@ void THostAuth::SetDetails(Int_t level, const char *details) //////////////////////////////////////////////////////////////////////////////// /// Print object content. -void THostAuth::Print(Option_t *proc) const +void ROOT::Deprecated::THostAuth::Print(Option_t *proc) const { char srvnam[4][8] = { "any", "sockd", "rootd", "???" }; @@ -376,7 +376,7 @@ void THostAuth::Print(Option_t *proc) const //////////////////////////////////////////////////////////////////////////////// /// Print info about established authentication vis-a-vis of this Host. -void THostAuth::PrintEstablished() const +void ROOT::Deprecated::THostAuth::PrintEstablished() const { Info("PrintEstablished", "+------------------------------------------------------------------------------+"); @@ -401,7 +401,7 @@ void THostAuth::PrintEstablished() const //////////////////////////////////////////////////////////////////////////////// /// Reorder nmet methods according fmet[nmet] -void THostAuth::ReOrder(Int_t nmet, Int_t *fmet) +void ROOT::Deprecated::THostAuth::ReOrder(Int_t nmet, Int_t *fmet) { // Temporary arrays Int_t tMethods[kMAXSEC] = {0}; @@ -461,7 +461,7 @@ void THostAuth::ReOrder(Int_t nmet, Int_t *fmet) /// Update info with the one in ha /// Remaining methods, if any, get lower priority -void THostAuth::Update(THostAuth *ha) +void ROOT::Deprecated::THostAuth::Update(THostAuth *ha) { // Temporary arrays Int_t tNumMethods = fNumMethods; @@ -511,7 +511,7 @@ void THostAuth::Update(THostAuth *ha) //////////////////////////////////////////////////////////////////////////////// /// Set 'method' to be the first used (if in the list ...). -void THostAuth::SetFirst(Int_t method) +void ROOT::Deprecated::THostAuth::SetFirst(Int_t method) { Int_t i = -1; if (HasMethod(method,&i)) { @@ -543,7 +543,7 @@ void THostAuth::SetFirst(Int_t method) //////////////////////////////////////////////////////////////////////////////// /// Set 'method' to be the last used (if in the list ...). -void THostAuth::SetLast(Int_t method) +void ROOT::Deprecated::THostAuth::SetLast(Int_t method) { Int_t i = -1; if (HasMethod(method,&i)) { @@ -579,7 +579,7 @@ void THostAuth::SetLast(Int_t method) /// authentication 'details'. /// Faster then AddMethod(method,details)+SetFirst(method). -void THostAuth::AddFirst(Int_t level, const char *details) +void ROOT::Deprecated::THostAuth::AddFirst(Int_t level, const char *details) { Int_t i = -1; if (HasMethod(level,&i)) { @@ -622,7 +622,7 @@ void THostAuth::AddFirst(Int_t level, const char *details) //////////////////////////////////////////////////////////////////////////////// /// Count successes for 'method' -void THostAuth::CountSuccess(Int_t method) +void ROOT::Deprecated::THostAuth::CountSuccess(Int_t method) { int i; for (i = 0; i < fNumMethods; i++) { @@ -636,7 +636,7 @@ void THostAuth::CountSuccess(Int_t method) //////////////////////////////////////////////////////////////////////////////// /// Count failures for 'method' -void THostAuth::CountFailure(Int_t method) +void ROOT::Deprecated::THostAuth::CountFailure(Int_t method) { int i; for (i = 0; i < fNumMethods; i++) { @@ -651,13 +651,13 @@ void THostAuth::CountFailure(Int_t method) /// Create a Security context and add it to local list /// Return pointer to it to be stored in TAuthenticate -TRootSecContext *THostAuth::CreateSecContext(const char *user, const char *host, - Int_t meth, Int_t offset, - const char *details, const char *token, - TDatime expdate, void *sctx, Int_t key) +ROOT::Deprecated::TRootSecContext * +ROOT::Deprecated::THostAuth::CreateSecContext(const char *user, const char *host, + Int_t meth, Int_t offset, + const char *details, const char *token, + TDatime expdate, void *sctx, Int_t key) { - TRootSecContext *ctx = new TRootSecContext(user, host, meth, offset, details, - token, expdate, sctx, key); + auto *ctx = new TRootSecContext(user, host, meth, offset, details, token, expdate, sctx, key); // Add it also to the local list if active if (ctx->IsActive()) fSecContexts->Add(ctx); @@ -669,7 +669,7 @@ TRootSecContext *THostAuth::CreateSecContext(const char *user, const char *host, //////////////////////////////////////////////////////////////////////////////// /// Return a static string with all info in a serialized form -void THostAuth::AsString(TString &Out) const +void ROOT::Deprecated::THostAuth::AsString(TString &Out) const { Out = Form("h:%s u:%s n:%d",GetHost(),GetUser(),fNumMethods); diff --git a/net/auth/src/TRootAuth.cxx b/net/auth/src/TRootAuth.cxx index 401ce66034e39..a3b85aa429b8b 100644 --- a/net/auth/src/TRootAuth.cxx +++ b/net/auth/src/TRootAuth.cxx @@ -32,8 +32,8 @@ /// Invoked when dynamic loading is needed. /// Returns 1 on success, 0 on failure. -TSecContext *TRootAuth::Authenticate(TSocket *s, const char *host, - const char *user, Option_t */*opts*/) +ROOT::Deprecated::TSecContext * +ROOT::Deprecated::TRootAuth::Authenticate(TSocket *s, const char *host, const char *user, Option_t */*opts*/) { TSecContext *ctx = 0; @@ -76,7 +76,7 @@ TSecContext *TRootAuth::Authenticate(TSocket *s, const char *host, } else { // Search pointer to relevant TSecContext ctx = auth->GetSecContext(); - s->SetSecContext(ctx); + ROOT::Deprecated::TSocketFriend::SetSecContext(*s, ctx); } // Cleanup delete auth; @@ -88,7 +88,7 @@ TSecContext *TRootAuth::Authenticate(TSocket *s, const char *host, //////////////////////////////////////////////////////////////////////////////// /// Return client version; -Int_t TRootAuth::ClientVersion() +Int_t ROOT::Deprecated::TRootAuth::ClientVersion() { return TSocket::GetClientProtocol(); } @@ -96,7 +96,7 @@ Int_t TRootAuth::ClientVersion() //////////////////////////////////////////////////////////////////////////////// /// Print error string corresponding to ecode, prepending location -void TRootAuth::ErrorMsg(const char *where, Int_t ecode) +void ROOT::Deprecated::TRootAuth::ErrorMsg(const char *where, Int_t ecode) { TAuthenticate::AuthError(where, ecode); } diff --git a/net/auth/src/TRootSecContext.cxx b/net/auth/src/TRootSecContext.cxx index 41b1f123b7a47..35dea54215b1a 100644 --- a/net/auth/src/TRootSecContext.cxx +++ b/net/auth/src/TRootSecContext.cxx @@ -32,10 +32,10 @@ //////////////////////////////////////////////////////////////////////////////// /// Ctor for SecContext object. - TRootSecContext::TRootSecContext(const char *user, const char *host, Int_t meth, - Int_t offset, const char *id, - const char *token, TDatime expdate, - void *ctx, Int_t key) +ROOT::Deprecated::TRootSecContext::TRootSecContext(const char *user, const char *host, Int_t meth, + Int_t offset, const char *id, + const char *token, TDatime expdate, + void *ctx, Int_t key) : TSecContext(user, host, meth, offset, id, token, expdate, ctx) { R__ASSERT(gROOT); @@ -48,9 +48,9 @@ /// Ctor for SecContext object. /// User and host from url = `user@host` . -TRootSecContext::TRootSecContext(const char *url, Int_t meth, Int_t offset, - const char *id, const char *token, - TDatime expdate, void *ctx, Int_t key) +ROOT::Deprecated::TRootSecContext::TRootSecContext(const char *url, Int_t meth, Int_t offset, + const char *id, const char *token, + TDatime expdate, void *ctx, Int_t key) : TSecContext(url, meth, offset, id, token, expdate, ctx) { R__ASSERT(gROOT); @@ -63,7 +63,7 @@ TRootSecContext::TRootSecContext(const char *url, Int_t meth, Int_t offset, /// Dtor: delete (deActivate, local/remote cleanup, list removal) /// all what is still active -TRootSecContext::~TRootSecContext() +ROOT::Deprecated::TRootSecContext::~TRootSecContext() { TSecContext::Cleanup(); } @@ -75,7 +75,7 @@ TRootSecContext::~TRootSecContext() /// If Opt contains "R" or "r", remove from the list /// Default Opt="CR" -void TRootSecContext::DeActivate(Option_t *Opt) +void ROOT::Deprecated::TRootSecContext::DeActivate(Option_t *Opt) { // Ask remote cleanup of this context Bool_t clean = (strstr(Opt,"C") || strstr(Opt,"c")); @@ -93,7 +93,7 @@ void TRootSecContext::DeActivate(Option_t *Opt) if (remove && fOffSet > -1){ R__LOCKGUARD(gROOTMutex); // Remove from the global list - gROOT->GetListOfSecContexts()->Remove(this); + ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)->Remove(this); // Remove also from local lists in THostAuth objects TAuthenticate::RemoveSecContext(this); } @@ -109,7 +109,7 @@ void TRootSecContext::DeActivate(Option_t *Opt) /// If 'all', all sec context with the same host as ctx /// are cleaned. -Bool_t TRootSecContext::CleanupSecContext(Bool_t all) +Bool_t ROOT::Deprecated::TRootSecContext::CleanupSecContext(Bool_t all) { Bool_t cleaned = kFALSE; @@ -182,7 +182,7 @@ Bool_t TRootSecContext::CleanupSecContext(Bool_t all) /// If opt is "S" prints short in-line form for calls within TFTP, /// TSlave ... -void TRootSecContext::Print(Option_t *opt) const +void ROOT::Deprecated::TRootSecContext::Print(Option_t *opt) const { // Check if option is numeric Int_t ord = -1, i = 0; @@ -237,7 +237,7 @@ void TRootSecContext::Print(Option_t *opt) const /// Returns short string with relevant information about this /// security context -const char *TRootSecContext::AsString(TString &out) +const char *ROOT::Deprecated::TRootSecContext::AsString(TString &out) { if (fOffSet > -1) { if (fID.BeginsWith("AFS")) diff --git a/net/net/inc/LinkDef.h b/net/net/inc/LinkDef.h index d4b6ab552adab..1488edfd5c7e9 100644 --- a/net/net/inc/LinkDef.h +++ b/net/net/inc/LinkDef.h @@ -17,21 +17,18 @@ #pragma link C++ global gGrid; #pragma link C++ global gGridJobStatusList; -#pragma link C++ global kSrvAuth; -#pragma link C++ global kSrvNoAuth; - #pragma link C++ class TServerSocket; #pragma link C++ class TSocket; #pragma link C++ class TPServerSocket; #pragma link C++ class TPSocket; #pragma link C++ class TMessage; #pragma link C++ class TMonitor; -#pragma link C++ class TNetFile; -#pragma link C++ class TNetFileStager; -#pragma link C++ class TNetSystem; +#pragma link C++ class ROOT::Deprecated::TNetFile; +#pragma link C++ class ROOT::Deprecated::TNetFileStager; +#pragma link C++ class ROOT::Deprecated::TNetSystem; #pragma link C++ class ROOT::Deprecated::TWebFile; #pragma link C++ class ROOT::Deprecated::TWebSystem; -#pragma link C++ class TFTP; +#pragma link C++ class ROOT::Deprecated::TFTP; #pragma link C++ class TSQLServer; #pragma link C++ class TSQLResult; #pragma link C++ class TSQLRow; @@ -46,8 +43,8 @@ #pragma link C++ class TGridJobStatus+; #pragma link C++ class TGridJobStatusList+; #pragma link C++ class TGridCollection+; -#pragma link C++ class TSecContext; -#pragma link C++ class TSecContextCleanup; +#pragma link C++ class ROOT::Deprecated::TSecContext; +#pragma link C++ class ROOT::Deprecated::TSecContextCleanup; #pragma link C++ class TFileStager; #pragma link C++ class TApplicationRemote; #pragma link C++ class TApplicationServer; diff --git a/net/net/inc/TFTP.h b/net/net/inc/TFTP.h index fa62d0ad56302..e0d00169f908c 100644 --- a/net/net/inc/TFTP.h +++ b/net/net/inc/TFTP.h @@ -30,6 +30,7 @@ class TSocket; +namespace ROOT::Deprecated { class TFTP : public TObject { @@ -125,4 +126,8 @@ class TFTP : public TObject { ClassDefOverride(TFTP, 1) // File Transfer Protocol class using rootd }; +} // namespace ROOT::Deprecated + +using TFTP R__DEPRECATED(6, 42, "TFTP is deprecated") = ROOT::Deprecated::TFTP; + #endif diff --git a/net/net/inc/TMessage.h b/net/net/inc/TMessage.h index 90f4f377d1577..43ffc5f14cd1e 100644 --- a/net/net/inc/TMessage.h +++ b/net/net/inc/TMessage.h @@ -32,7 +32,6 @@ class TVirtualStreamerInfo; class TMessage : public TBufferFile { -friend class TAuthenticate; friend class TSocket; friend class TUDPSocket; friend class TPSocket; diff --git a/net/net/inc/TNetFile.h b/net/net/inc/TNetFile.h index f21fb07f48107..1f2ae9eafd1f0 100644 --- a/net/net/inc/TNetFile.h +++ b/net/net/inc/TNetFile.h @@ -30,6 +30,7 @@ class TSocket; +namespace ROOT::Deprecated { class TNetFile : public TFile { @@ -81,7 +82,6 @@ class TNetFile : public TFile { ClassDefOverride(TNetFile,1) //A ROOT file that reads/writes via a rootd server }; - class TNetSystem : public TSystem { private: @@ -122,4 +122,9 @@ class TNetSystem : public TSystem { ClassDefOverride(TNetSystem,0) // Directory handler for NetSystem }; +} // namespace ROOT::Deprecated + +using TNetFile R__DEPRECATED(6, 42, "TNetFile is deprecated") = ROOT::Deprecated::TNetFile; +using TNetSystem R__DEPRECATED(6, 42, "TNetSystem is deprecated") = ROOT::Deprecated::TNetSystem; + #endif diff --git a/net/net/inc/TNetFileStager.h b/net/net/inc/TNetFileStager.h index 5f73f67a96765..ee8db18b17ccb 100644 --- a/net/net/inc/TNetFileStager.h +++ b/net/net/inc/TNetFileStager.h @@ -23,6 +23,9 @@ #include "TFileStager.h" class TCollection; + +namespace ROOT::Deprecated { + class TNetSystem; class TNetFileStager : public TFileStager { @@ -48,4 +51,8 @@ class TNetFileStager : public TFileStager { ClassDefOverride(TNetFileStager,0) // Implementation for a 'rootd' backend }; +} // namespace ROOT::Deprecated + +using TNetFileStager R__DEPRECATED(6, 42, "TNetFileStager is deprecated") = ROOT::Deprecated::TNetFileStager; + #endif diff --git a/net/net/inc/TPServerSocket.h b/net/net/inc/TPServerSocket.h index 4cc83a489256a..5272b6ad307c4 100644 --- a/net/net/inc/TPServerSocket.h +++ b/net/net/inc/TPServerSocket.h @@ -46,7 +46,7 @@ class TPServerSocket : public TServerSocket { virtual ~TPServerSocket() {} - TPSocket *Accept(UChar_t Opt = kSrvNoAuth) override; + TPSocket *Accept(UChar_t Opt = ROOT::Deprecated::kSrvNoAuth) override; ClassDefOverride(TPServerSocket,0) // Parallel server socket }; diff --git a/net/net/inc/TSecContext.h b/net/net/inc/TSecContext.h index 7b427d3ae7ef1..1dde1a5cd9e4c 100644 --- a/net/net/inc/TSecContext.h +++ b/net/net/inc/TSecContext.h @@ -29,13 +29,13 @@ // Jan 1, 1995, 00:00:00 in sec from EPOCH (Jan 1, 1970) R__EXTERN const TDatime kROOTTZERO; -// Small class with information for final cleanup -class TSecContextCleanup; -class TPwdCtx; +namespace ROOT::Deprecated { + +class TRootSecContext; class TSecContext : public TObject { -friend class TRootSecContext; +friend class ROOT::Deprecated::TRootSecContext; private: void *fContext; // ptr to specific sec context @@ -144,5 +144,10 @@ class TPwdCtx { }; +} // namespace ROOT::Deprecated + +using TSecContext R__DEPRECATED(6, 42, "TSecContext is deprecated") = ROOT::Deprecated::TSecContext; +using TSecContextCleanup R__DEPRECATED(6, 42, "TPwdCtx is deprecated") = ROOT::Deprecated::TSecContextCleanup; +using TPwdCtx R__DEPRECATED(6, 42, "TPwdCtx is deprecated") = ROOT::Deprecated::TPwdCtx; #endif diff --git a/net/net/inc/TServerSocket.h b/net/net/inc/TServerSocket.h index afe48b7d120d7..7a223b7723e89 100644 --- a/net/net/inc/TServerSocket.h +++ b/net/net/inc/TServerSocket.h @@ -30,6 +30,8 @@ class TSeqCollection; +namespace ROOT::Deprecated { + typedef Int_t (*SrvAuth_t)(TSocket *sock, const char *, const char *, std::string&, Int_t &, Int_t &, std::string &, TSeqCollection *); @@ -39,13 +41,20 @@ typedef Int_t (*SrvClup_t)(TSeqCollection *); const UChar_t kSrvAuth = 0x1; // Require client authentication const UChar_t kSrvNoAuth = (kSrvAuth<<4); // Force no client authentication +} // namespace ROOT::Deprecated + +using SrvAuth_t R__DEPRECATED(6, 42, "Socket authentication is deprecated") = ROOT::Deprecated::SrvAuth_t; +using SrvClup_t R__DEPRECATED(6, 42, "Socket authentication is deprecated") = ROOT::Deprecated::SrvClup_t; +const UChar_t kSrvAuth R__DEPRECATED(6, 42, "Socket authentication is deprecated") = ROOT::Deprecated::kSrvAuth; +const UChar_t kSrvNoAuth R__DEPRECATED(6, 42, "Socket authentication is deprecated") = ROOT::Deprecated::kSrvNoAuth; + class TServerSocket : public TSocket { private: TSeqCollection *fSecContexts; // List of TSecContext with cleanup info - static SrvAuth_t fgSrvAuthHook; - static SrvClup_t fgSrvAuthClupHook; - static UChar_t fgAcceptOpt; // Default accept options + static ROOT::Deprecated::SrvAuth_t fgSrvAuthHook; + static ROOT::Deprecated::SrvClup_t fgSrvAuthClupHook; + static UChar_t fgAcceptOpt; // Default accept options (DEPRECATED) TServerSocket() : fSecContexts(nullptr) {} TServerSocket(const TServerSocket &); @@ -88,9 +97,9 @@ class TServerSocket : public TSocket { Int_t RecvRaw(void *, Int_t, ESendRecvOptions = kDefault) override { MayNotUse("RecvRaw(void *, Int_t, ESendRecvOptions)"); return 0; } - static UChar_t GetAcceptOptions(); - static void SetAcceptOptions(UChar_t Opt); - static void ShowAcceptOptions(); + static UChar_t GetAcceptOptions() R__DEPRECATED(6, 42, "Socket authentication is deprecated"); + static void SetAcceptOptions(UChar_t Opt) R__DEPRECATED(6, 42, "Socket authentication is deprecated"); + static void ShowAcceptOptions() R__DEPRECATED(6, 42, "Socket authentication is deprecated"); ClassDefOverride(TServerSocket, 0); //This class implements server sockets }; diff --git a/net/net/inc/TSocket.h b/net/net/inc/TSocket.h index aaa463ccf8f7d..3bea06d01a834 100644 --- a/net/net/inc/TSocket.h +++ b/net/net/inc/TSocket.h @@ -30,17 +30,31 @@ #include "TBits.h" #include "TInetAddress.h" #include "MessageTypes.h" -#include "TVirtualAuth.h" #include "TSecContext.h" #include "TTimeStamp.h" #include "TVirtualMutex.h" class TMessage; -class THostAuth; +class TSocket; + +namespace ROOT::Deprecated { +struct TSocketFriend { + static Bool_t IsAuthenticated(const TSocket &s); + static void SetSecContext(TSocket &s, TSecContext *ctx); + static TSecContext *GetSecContext(const TSocket &s); + + static TSocket *CreateAuthSocket(const char *user, const char *host, + Int_t port, Int_t size = 0, + Int_t tcpwindowsize = -1, TSocket *s = nullptr, Int_t *err = nullptr); + static TSocket *CreateAuthSocket(const char *url, Int_t size = 0, + Int_t tcpwindowsize = -1, TSocket *s = nullptr, Int_t *err = nullptr); +}; +} // namespace ROOT::Deprecated class TSocket : public TNamed { friend class TServerSocket; +friend struct ROOT::Deprecated::TSocketFriend; public: enum EStatusBits { kIsUnix = BIT(16), // set if unix socket @@ -68,8 +82,8 @@ friend class TServerSocket; Int_t fCompress; // Compression level and algorithm TInetAddress fLocalAddress; // local internet address and port # Int_t fRemoteProtocol; // protocol of remote daemon - TSecContext *fSecContext; // after a successful Authenticate call - // points to related security context + ROOT::Deprecated::TSecContext *fSecContext; // after a successful Authenticate call + // points to related security context TString fService; // name of service (matches remote port #) EServiceType fServType; // remote service type Int_t fSocket; // socket descriptor @@ -130,11 +144,15 @@ friend class TServerSocket; Int_t GetErrorCode() const; virtual Int_t GetOption(ESockOptions opt, Int_t &val); Int_t GetRemoteProtocol() const { return fRemoteProtocol; } - TSecContext *GetSecContext() const { return fSecContext; } + ROOT::Deprecated::TSecContext *GetSecContext() const + R__DEPRECATED(6, 42, "TSocket::GetSecContext is deprecated") + { return ROOT::Deprecated::TSocketFriend::GetSecContext(*this); } Int_t GetTcpWindowSize() const { return fTcpWindowSize; } TTimeStamp GetLastUsage() { R__LOCKGUARD2(fLastUsageMtx); return fLastUsage; } const char *GetUrl() const { return fUrl.Data(); } - virtual Bool_t IsAuthenticated() const { return fSecContext ? kTRUE : kFALSE; } + virtual Bool_t IsAuthenticated() const + R__DEPRECATED(6, 42, "TSocket::IsAuthenticated is deprecated") + { return ROOT::Deprecated::TSocketFriend::IsAuthenticated(*this); } virtual Bool_t IsValid() const { return fSocket < 0 ? kFALSE : kTRUE; } virtual Int_t Recv(TMessage *&mess); virtual Int_t Recv(Int_t &status, Int_t &kind); @@ -155,7 +173,9 @@ friend class TServerSocket; void SetCompressionSettings(Int_t settings = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault); virtual Int_t SetOption(ESockOptions opt, Int_t val); void SetRemoteProtocol(Int_t rproto) { fRemoteProtocol = rproto; } - void SetSecContext(TSecContext *ctx) { fSecContext = ctx; } + void SetSecContext(ROOT::Deprecated::TSecContext *ctx) + R__DEPRECATED(6, 42, "TSocket::SetSecContext is deprecated") + { ROOT::Deprecated::TSocketFriend::SetSecContext(*this, ctx); } void SetService(const char *service) { fService = service; } void SetServType(Int_t st) { fServType = (EServiceType)st; } void SetUrl(const char *url) { fUrl = url; } @@ -169,9 +189,15 @@ friend class TServerSocket; static TSocket *CreateAuthSocket(const char *user, const char *host, Int_t port, Int_t size = 0, - Int_t tcpwindowsize = -1, TSocket *s = nullptr, Int_t *err = nullptr); + Int_t tcpwindowsize = -1, TSocket *s = nullptr, Int_t *err = nullptr) + R__DEPRECATED(6, 42, "Socket authentication is deprecated. See README.AUTH for details.") + { return ROOT::Deprecated::TSocketFriend::CreateAuthSocket( + user, host, port, size, tcpwindowsize, s, err); } static TSocket *CreateAuthSocket(const char *url, Int_t size = 0, - Int_t tcpwindowsize = -1, TSocket *s = nullptr, Int_t *err = nullptr); + Int_t tcpwindowsize = -1, TSocket *s = nullptr, Int_t *err = nullptr) + R__DEPRECATED(6, 42, "Socket authentication is deprecated. See README.AUTH for details.") + { return ROOT::Deprecated::TSocketFriend::CreateAuthSocket(url, size, tcpwindowsize, s, err); } + static void NetError(const char *where, Int_t error); ClassDefOverride(TSocket,0) //This class implements client sockets diff --git a/net/net/inc/TUDPSocket.h b/net/net/inc/TUDPSocket.h index 36606633985b7..d29c09459ef05 100644 --- a/net/net/inc/TUDPSocket.h +++ b/net/net/inc/TUDPSocket.h @@ -28,7 +28,6 @@ #include "TBits.h" #include "TInetAddress.h" #include "MessageTypes.h" -#include "TVirtualAuth.h" #include "TSecContext.h" #include "TTimeStamp.h" #include "TVirtualMutex.h" @@ -52,8 +51,8 @@ friend class TServerSocket; Int_t fCompress; // Compression level and algorithm TInetAddress fLocalAddress; // local internet address and port # Int_t fRemoteProtocol; // protocol of remote daemon - TSecContext *fSecContext; // after a successful Authenticate call - // points to related security context + ROOT::Deprecated::TSecContext *fSecContext; // after a successful Authenticate call + // points to related security context TString fService; // name of service (matches remote port #) EServiceType fServType; // remote service type Int_t fSocket; // socket descriptor @@ -111,7 +110,8 @@ friend class TServerSocket; Int_t GetErrorCode() const; virtual Int_t GetOption(ESockOptions opt, Int_t &val); Int_t GetRemoteProtocol() const { return fRemoteProtocol; } - TSecContext *GetSecContext() const { return fSecContext; } + ROOT::Deprecated::TSecContext *GetSecContext() const + R__DEPRECATED(6, 42, "TUDPSocket::GetSecContext is deprecated") { return fSecContext; } TTimeStamp GetLastUsage() { R__LOCKGUARD2(fLastUsageMtx); return fLastUsage; } const char *GetUrl() const { return fUrl; } @@ -136,7 +136,8 @@ friend class TServerSocket; void SetCompressionSettings(Int_t settings = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault); virtual Int_t SetOption(ESockOptions opt, Int_t val); void SetRemoteProtocol(Int_t rproto) { fRemoteProtocol = rproto; } - void SetSecContext(TSecContext *ctx) { fSecContext = ctx; } + void SetSecContext(ROOT::Deprecated::TSecContext *ctx) + R__DEPRECATED(6, 42, "TUDPSocket::SetSecContext is deprecated"){ fSecContext = ctx; } void SetService(const char *service) { fService = service; } void SetServType(Int_t st) { fServType = (EServiceType)st; } void SetUrl(const char *url) { fUrl = url; } diff --git a/net/net/src/TFTP.cxx b/net/net/src/TFTP.cxx index e87a623f6bf12..6d9701d77aae2 100644 --- a/net/net/src/TFTP.cxx +++ b/net/net/src/TFTP.cxx @@ -56,8 +56,8 @@ #endif -Long64_t TFTP::fgBytesWrite = 0; -Long64_t TFTP::fgBytesRead = 0; +Long64_t ROOT::Deprecated::TFTP::fgBytesWrite = 0; +Long64_t ROOT::Deprecated::TFTP::fgBytesRead = 0; @@ -70,7 +70,7 @@ Long64_t TFTP::fgBytesRead = 0; /// An existing connection (TSocket *sock) can also be used to establish /// the FTP session. -TFTP::TFTP(const char *url, Int_t par, Int_t wsize, TSocket *sock) +ROOT::Deprecated::TFTP::TFTP(const char *url, Int_t par, Int_t wsize, TSocket *sock) { fSocket = sock; @@ -91,7 +91,7 @@ TFTP::TFTP(const char *url, Int_t par, Int_t wsize, TSocket *sock) //////////////////////////////////////////////////////////////////////////////// /// Set up the actual connection. -void TFTP::Init(const char *surl, Int_t par, Int_t wsize) +void ROOT::Deprecated::TFTP::Init(const char *surl, Int_t par, Int_t wsize) { TUrl url(surl); TString hurl(url.GetProtocol()); @@ -102,8 +102,8 @@ void TFTP::Init(const char *surl, Int_t par, Int_t wsize) } hurl += TString(Form("://%s@%s:%d", url.GetUser(), url.GetHost(), url.GetPort())); - fSocket = TSocket::CreateAuthSocket(hurl, par, wsize, fSocket); - if (!fSocket || !fSocket->IsAuthenticated()) { + fSocket = ROOT::Deprecated::TSocketFriend::CreateAuthSocket(hurl, par, wsize, fSocket); + if (!fSocket || !ROOT::Deprecated::TSocketFriend::IsAuthenticated(*fSocket)) { if (par > 1) Error("TFTP", "can't open %d-stream connection to rootd on " "host %s at port %d", par, url.GetHost(), url.GetPort()); @@ -114,7 +114,7 @@ void TFTP::Init(const char *surl, Int_t par, Int_t wsize) } fProtocol = fSocket->GetRemoteProtocol(); - fUser = fSocket->GetSecContext()->GetUser(); + fUser = ROOT::Deprecated::TSocketFriend::GetSecContext(*fSocket)->GetUser(); fHost = url.GetHost(); fPort = url.GetPort(); @@ -145,7 +145,7 @@ void TFTP::Init(const char *surl, Int_t par, Int_t wsize) //////////////////////////////////////////////////////////////////////////////// /// TFTP dtor. Send close message and close socket. -TFTP::~TFTP() +ROOT::Deprecated::TFTP::~TFTP() { Close(); } @@ -153,16 +153,17 @@ TFTP::~TFTP() //////////////////////////////////////////////////////////////////////////////// /// Print some info about the FTP connection. -void TFTP::Print(Option_t *) const +void ROOT::Deprecated::TFTP::Print(Option_t *) const { TString secCont; Printf("Local host: %s", gSystem->HostName()); Printf("Remote host: %s [%d]", fHost.Data(), fPort); Printf("Remote user: %s", fUser.Data()); - if (fSocket->IsAuthenticated()) + if (ROOT::Deprecated::TSocketFriend::IsAuthenticated(*fSocket)) { Printf("Security context: %s", - fSocket->GetSecContext()->AsString(secCont)); + ROOT::Deprecated::TSocketFriend::GetSecContext(*fSocket)->AsString(secCont)); + } Printf("Rootd protocol vers.: %d", fSocket->GetRemoteProtocol()); if (fParallel > 1) { Printf("Parallel sockets: %d", fParallel); @@ -178,7 +179,7 @@ void TFTP::Print(Option_t *) const //////////////////////////////////////////////////////////////////////////////// /// Print error string depending on error code. -void TFTP::PrintError(const char *where, Int_t err) const +void ROOT::Deprecated::TFTP::PrintError(const char *where, Int_t err) const { Error(where, "%s", gRootdErrStr[err]); } @@ -187,7 +188,7 @@ void TFTP::PrintError(const char *where, Int_t err) const /// Return status from rootd server and message kind. Returns -1 in /// case of error otherwise 8 (sizeof 2 words, status and kind). -Int_t TFTP::Recv(Int_t &status, EMessageTypes &kind) const +Int_t ROOT::Deprecated::TFTP::Recv(Int_t &status, EMessageTypes &kind) const { kind = kROOTD_ERR; status = 0; @@ -203,7 +204,7 @@ Int_t TFTP::Recv(Int_t &status, EMessageTypes &kind) const //////////////////////////////////////////////////////////////////////////////// /// Make sure the block size is a power of two, with a minimum of 32768. -void TFTP::SetBlockSize(Int_t blockSize) +void ROOT::Deprecated::TFTP::SetBlockSize(Int_t blockSize) { if (blockSize < 32768) { fBlockSize = 32768; @@ -229,7 +230,7 @@ void TFTP::SetBlockSize(Int_t blockSize) /// the case (e.g. due to a crash), you can force unlock it by prepending /// the remoteName with a '-'. -Long64_t TFTP::PutFile(const char *file, const char *remoteName) +Long64_t ROOT::Deprecated::TFTP::PutFile(const char *file, const char *remoteName) { if (!IsOpen() || !file || !*file) return -1; @@ -402,7 +403,7 @@ Long64_t TFTP::PutFile(const char *file, const char *remoteName) /// the case (e.g. due to a crash), you can force unlock it by prepending /// the file name with a '-'. -Long64_t TFTP::GetFile(const char *file, const char *localName) +Long64_t ROOT::Deprecated::TFTP::GetFile(const char *file, const char *localName) { if (!IsOpen() || !file || !*file) return -1; @@ -624,7 +625,7 @@ Long64_t TFTP::GetFile(const char *file, const char *localName) /// file and it is < 1024 characters then the contents is echoed back. /// Returns 0 in case of success and -1 in case of failure. -Int_t TFTP::ChangeDirectory(const char *dir) const +Int_t ROOT::Deprecated::TFTP::ChangeDirectory(const char *dir) const { if (!IsOpen()) return -1; @@ -663,7 +664,7 @@ Int_t TFTP::ChangeDirectory(const char *dir) const /// Make a remote directory. Anonymous users may not create directories. /// Returns 0 in case of success and -1 in case of failure. -Int_t TFTP::MakeDirectory(const char *dir, Bool_t print) const +Int_t ROOT::Deprecated::TFTP::MakeDirectory(const char *dir, Bool_t print) const { if (!IsOpen()) return -1; @@ -698,7 +699,7 @@ Int_t TFTP::MakeDirectory(const char *dir, Bool_t print) const /// Delete a remote directory. Anonymous users may not delete directories. /// Returns 0 in case of success and -1 in case of failure. -Int_t TFTP::DeleteDirectory(const char *dir) const +Int_t ROOT::Deprecated::TFTP::DeleteDirectory(const char *dir) const { if (!IsOpen()) return -1; @@ -730,7 +731,7 @@ Int_t TFTP::DeleteDirectory(const char *dir) const /// to be listed to ls. Returns 0 in case of success and -1 in case of /// failure. -Int_t TFTP::ListDirectory(Option_t *cmd) const +Int_t ROOT::Deprecated::TFTP::ListDirectory(Option_t *cmd) const { if (!IsOpen()) return -1; @@ -760,7 +761,7 @@ Int_t TFTP::ListDirectory(Option_t *cmd) const /// Print path of remote working directory. Returns 0 in case of succes and /// -1 in cse of failure. -Int_t TFTP::PrintDirectory() const +Int_t ROOT::Deprecated::TFTP::PrintDirectory() const { if (!IsOpen()) return -1; @@ -786,7 +787,7 @@ Int_t TFTP::PrintDirectory() const /// Rename a remote file. Anonymous users may not rename files. /// Returns 0 in case of success and -1 in case of failure. -Int_t TFTP::RenameFile(const char *file1, const char *file2) const +Int_t ROOT::Deprecated::TFTP::RenameFile(const char *file1, const char *file2) const { if (!IsOpen()) return -1; @@ -817,7 +818,7 @@ Int_t TFTP::RenameFile(const char *file1, const char *file2) const /// Delete a remote file. Anonymous users may not delete files. /// Returns 0 in case of success and -1 in case of failure. -Int_t TFTP::DeleteFile(const char *file) const +Int_t ROOT::Deprecated::TFTP::DeleteFile(const char *file) const { if (!IsOpen()) return -1; @@ -849,7 +850,7 @@ Int_t TFTP::DeleteFile(const char *file) const /// chnage permissions. Returns 0 in case of success and -1 in case /// of failure. -Int_t TFTP::ChangePermission(const char *file, Int_t mode) const +Int_t ROOT::Deprecated::TFTP::ChangePermission(const char *file, Int_t mode) const { if (!IsOpen()) return -1; @@ -880,7 +881,7 @@ Int_t TFTP::ChangePermission(const char *file, Int_t mode) const /// Close ftp connection. Returns 0 in case of success and -1 in case of /// failure. -Int_t TFTP::Close() +Int_t ROOT::Deprecated::TFTP::Close() { if (!IsOpen()) return -1; @@ -910,7 +911,7 @@ Int_t TFTP::Close() /// Returns kTRUE in case of success. /// Returns kFALSE in case of error. -Bool_t TFTP::OpenDirectory(const char *dir, Bool_t print) +Bool_t ROOT::Deprecated::TFTP::OpenDirectory(const char *dir, Bool_t print) { fDir = kFALSE; @@ -952,7 +953,7 @@ Bool_t TFTP::OpenDirectory(const char *dir, Bool_t print) //////////////////////////////////////////////////////////////////////////////// /// Free a remotely open directory via rootd. -void TFTP::FreeDirectory(Bool_t print) +void ROOT::Deprecated::TFTP::FreeDirectory(Bool_t print) { if (!IsOpen() || !fDir) return; @@ -984,7 +985,7 @@ void TFTP::FreeDirectory(Bool_t print) /// Get directory entry via rootd. /// Returns 0 in case no more entries or in case of error. -const char *TFTP::GetDirEntry(Bool_t print) +const char *ROOT::Deprecated::TFTP::GetDirEntry(Bool_t print) { static char dirent[1024] = {0}; @@ -1025,7 +1026,7 @@ const char *TFTP::GetDirEntry(Bool_t print) /// The function returns 0 in case of success and 1 if the file could /// not be stat'ed. -Int_t TFTP::GetPathInfo(const char *path, FileStat_t &buf, Bool_t print) +Int_t ROOT::Deprecated::TFTP::GetPathInfo(const char *path, FileStat_t &buf, Bool_t print) { TUrl url(path); @@ -1107,7 +1108,7 @@ Int_t TFTP::GetPathInfo(const char *path, FileStat_t &buf, Bool_t print) /// Mode is the same as for the Unix access(2) function. /// Attention, bizarre convention of return value!! -Bool_t TFTP::AccessPathName(const char *path, EAccessMode mode, Bool_t print) +Bool_t ROOT::Deprecated::TFTP::AccessPathName(const char *path, EAccessMode mode, Bool_t print) { if (!IsOpen()) return kTRUE; diff --git a/net/net/src/TNetFile.cxx b/net/net/src/TNetFile.cxx index 5ce7bbd0d77f7..7a2a89c84a693 100644 --- a/net/net/src/TNetFile.cxx +++ b/net/net/src/TNetFile.cxx @@ -70,7 +70,8 @@ to be super user). /// for a description of the options and other arguments see Create(). /// Normally a TNetFile is created via TFile::Open(). -TNetFile::TNetFile(const char *url, Option_t *option, const char *ftitle, Int_t compress, Int_t netopt) +ROOT::Deprecated::TNetFile::TNetFile(const char *url, Option_t *option, const char *ftitle, Int_t compress, + Int_t netopt) : TFile(url, strstr(option, "_WITHOUT_GLOBALREGISTRATION") != nullptr ? "NET_WITHOUT_GLOBALREGISTRATION" : "NET", ftitle, compress), fEndpointUrl(url) @@ -84,7 +85,7 @@ TNetFile::TNetFile(const char *url, Option_t *option, const char *ftitle, Int_t /// to initialize the TFile base class but not open a connection at this /// moment. -TNetFile::TNetFile(const char *url, const char *ftitle, Int_t compress, Bool_t) +ROOT::Deprecated::TNetFile::TNetFile(const char *url, const char *ftitle, Int_t compress, Bool_t) : TFile(url, "NET", ftitle, compress), fEndpointUrl(url) { fSocket = 0; @@ -96,7 +97,7 @@ TNetFile::TNetFile(const char *url, const char *ftitle, Int_t compress, Bool_t) //////////////////////////////////////////////////////////////////////////////// /// TNetFile dtor. Send close message and close socket. -TNetFile::~TNetFile() +ROOT::Deprecated::TNetFile::~TNetFile() { Close(); } @@ -104,7 +105,7 @@ TNetFile::~TNetFile() //////////////////////////////////////////////////////////////////////////////// /// Open a remote file. Requires fOption to be set correctly. -Int_t TNetFile::SysOpen(const char * /*file*/, Int_t /*flags*/, UInt_t /*mode*/) +Int_t ROOT::Deprecated::TNetFile::SysOpen(const char * /*file*/, Int_t /*flags*/, UInt_t /*mode*/) { if (!fSocket) { @@ -139,7 +140,7 @@ Int_t TNetFile::SysOpen(const char * /*file*/, Int_t /*flags*/, UInt_t /*mode*/) //////////////////////////////////////////////////////////////////////////////// /// Close currently open file. -Int_t TNetFile::SysClose(Int_t /*fd*/) +Int_t ROOT::Deprecated::TNetFile::SysClose(Int_t /*fd*/) { if (fSocket) fSocket->Send(kROOTD_CLOSE); @@ -151,7 +152,7 @@ Int_t TNetFile::SysClose(Int_t /*fd*/) /// Return file stat information. The interface and return value is /// identical to TSystem::GetPathInfo(). -Int_t TNetFile::SysStat(Int_t, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime) +Int_t ROOT::Deprecated::TNetFile::SysStat(Int_t, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime) { if (fProtocol < 3) return 1; @@ -203,7 +204,7 @@ Int_t TNetFile::SysStat(Int_t, Long_t *id, Long64_t *size, Long_t *flags, Long_t //////////////////////////////////////////////////////////////////////////////// /// Close remote file. -void TNetFile::Close(Option_t *opt) +void ROOT::Deprecated::TNetFile::Close(Option_t *opt) { if (!fSocket) return; @@ -220,7 +221,7 @@ void TNetFile::Close(Option_t *opt) //////////////////////////////////////////////////////////////////////////////// /// Flush file to disk. -void TNetFile::Flush() +void ROOT::Deprecated::TNetFile::Flush() { FlushWriteCache(); @@ -231,7 +232,7 @@ void TNetFile::Flush() //////////////////////////////////////////////////////////////////////////////// /// Initialize a TNetFile object. -void TNetFile::Init(Bool_t create) +void ROOT::Deprecated::TNetFile::Init(Bool_t create) { Seek(0); @@ -242,7 +243,7 @@ void TNetFile::Init(Bool_t create) //////////////////////////////////////////////////////////////////////////////// /// Retruns kTRUE if file is open, kFALSE otherwise. -Bool_t TNetFile::IsOpen() const +Bool_t ROOT::Deprecated::TNetFile::IsOpen() const { return fSocket == 0 ? kFALSE : kTRUE; } @@ -250,7 +251,7 @@ Bool_t TNetFile::IsOpen() const //////////////////////////////////////////////////////////////////////////////// /// Print some info about the net file. -void TNetFile::Print(Option_t *) const +void ROOT::Deprecated::TNetFile::Print(Option_t *) const { const char *fname = fUrl.GetFile(); Printf("URL: %s", ((TUrl*)&fUrl)->GetUrl()); @@ -265,7 +266,7 @@ void TNetFile::Print(Option_t *) const //////////////////////////////////////////////////////////////////////////////// /// Print error string depending on error code. -void TNetFile::PrintError(const char *where, Int_t err) +void ROOT::Deprecated::TNetFile::PrintError(const char *where, Int_t err) { fErrorCode = err; Error(where, "%s", gRootdErrStr[err]); @@ -280,7 +281,7 @@ void TNetFile::PrintError(const char *where, Int_t err) /// and -1 in case of failure, in which case the file cannot be used /// anymore. -Int_t TNetFile::ReOpen(Option_t *mode) +Int_t ROOT::Deprecated::TNetFile::ReOpen(Option_t *mode) { if (fProtocol < 7) { Error("ReOpen", "operation not supported by remote rootd (protocol = %d)", @@ -295,7 +296,7 @@ Int_t TNetFile::ReOpen(Option_t *mode) /// Read specified byte range from remote file via rootd daemon. /// Returns kTRUE in case of error. -Bool_t TNetFile::ReadBuffer(char *buf, Int_t len) +Bool_t ROOT::Deprecated::TNetFile::ReadBuffer(char *buf, Int_t len) { if (!fSocket) return kTRUE; if (len == 0) @@ -368,7 +369,7 @@ Bool_t TNetFile::ReadBuffer(char *buf, Int_t len) /// Read specified byte range from remote file via rootd daemon. /// Returns kTRUE in case of error. -Bool_t TNetFile::ReadBuffer(char *buf, Long64_t pos, Int_t len) +Bool_t ROOT::Deprecated::TNetFile::ReadBuffer(char *buf, Long64_t pos, Int_t len) { SetOffset(pos); return ReadBuffer(buf, len); @@ -379,7 +380,7 @@ Bool_t TNetFile::ReadBuffer(char *buf, Long64_t pos, Int_t len) /// buffer. /// Returns kTRUE in case of error. -Bool_t TNetFile::ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf) +Bool_t ROOT::Deprecated::TNetFile::ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf) { if (!fSocket) return kTRUE; @@ -483,7 +484,7 @@ Bool_t TNetFile::ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf) /// Write specified byte range to remote file via rootd daemon. /// Returns kTRUE in case of error. -Bool_t TNetFile::WriteBuffer(const char *buf, Int_t len) +Bool_t ROOT::Deprecated::TNetFile::WriteBuffer(const char *buf, Int_t len) { if (!fSocket || !fWritable) return kTRUE; @@ -541,7 +542,7 @@ Bool_t TNetFile::WriteBuffer(const char *buf, Int_t len) /// Return status from rootd server and message kind. Returns -1 in /// case of error otherwise 8 (sizeof 2 words, status and kind). -Int_t TNetFile::Recv(Int_t &status, EMessageTypes &kind) +Int_t ROOT::Deprecated::TNetFile::Recv(Int_t &status, EMessageTypes &kind) { kind = kROOTD_ERR; status = 0; @@ -557,7 +558,7 @@ Int_t TNetFile::Recv(Int_t &status, EMessageTypes &kind) //////////////////////////////////////////////////////////////////////////////// /// Set position from where to start reading. -void TNetFile::Seek(Long64_t offset, ERelativeTo pos) +void ROOT::Deprecated::TNetFile::Seek(Long64_t offset, ERelativeTo pos) { SetOffset(offset, pos); } @@ -565,9 +566,9 @@ void TNetFile::Seek(Long64_t offset, ERelativeTo pos) //////////////////////////////////////////////////////////////////////////////// /// Connect to remote rootd server. -void TNetFile::ConnectServer(Int_t *stat, EMessageTypes *kind, Int_t netopt, - Int_t tcpwindowsize, Bool_t forceOpen, - Bool_t forceRead) +void ROOT::Deprecated::TNetFile::ConnectServer(Int_t *stat, EMessageTypes *kind, Int_t netopt, + Int_t tcpwindowsize, Bool_t forceOpen, + Bool_t forceRead) { TString fn = fUrl.GetFile(); @@ -581,8 +582,8 @@ void TNetFile::ConnectServer(Int_t *stat, EMessageTypes *kind, Int_t netopt, } url += TString(Form("://%s@%s:%d", fUrl.GetUser(), fUrl.GetHost(), fUrl.GetPort())); - fSocket = TSocket::CreateAuthSocket(url, sSize, tcpwindowsize, fSocket, stat); - if (!fSocket || (fSocket && !fSocket->IsAuthenticated())) { + fSocket = ROOT::Deprecated::TSocketFriend::CreateAuthSocket(url, sSize, tcpwindowsize, fSocket, stat); + if (!fSocket || (fSocket && !ROOT::Deprecated::TSocketFriend::IsAuthenticated(*fSocket))) { if (sSize > 1) Error("TNetFile", "can't open %d-stream connection to rootd on " "host %s at port %d", sSize, fUrl.GetHost(), fUrl.GetPort()); @@ -654,7 +655,7 @@ void TNetFile::ConnectServer(Int_t *stat, EMessageTypes *kind, Int_t netopt, /// For a description of the option and other arguments see the TFile ctor. /// The preferred interface to this constructor is via TFile::Open(). -void TNetFile::Create(const char * /*url*/, Option_t *option, Int_t netopt) +void ROOT::Deprecated::TNetFile::Create(const char * /*url*/, Option_t *option, Int_t netopt) { Int_t tcpwindowsize = 65535; @@ -743,7 +744,7 @@ void TNetFile::Create(const char * /*url*/, Option_t *option, Int_t netopt) /// TNetFile::Create(const char *url, Option_t *option, Int_t netopt) /// for details about the arguments. -void TNetFile::Create(TSocket *s, Option_t *option, Int_t netopt) +void ROOT::Deprecated::TNetFile::Create(TSocket *s, Option_t *option, Int_t netopt) { // Import socket fSocket = s; @@ -756,7 +757,7 @@ void TNetFile::Create(TSocket *s, Option_t *option, Int_t netopt) /// Return kTRUE if 'url' matches the coordinates of this file. /// Check the full URL, including port and FQDN. -Bool_t TNetFile::Matches(const char *url) +Bool_t ROOT::Deprecated::TNetFile::Matches(const char *url) { // Run standard check on fUrl, first Bool_t rc = TFile::Matches(url); @@ -793,7 +794,7 @@ Bool_t TNetFile::Matches(const char *url) /// for cleaning of the underlying TFTP connection; this allows /// to have control on the order of the final cleaning. -TNetSystem::TNetSystem(Bool_t ftpowner) +ROOT::Deprecated::TNetSystem::TNetSystem(Bool_t ftpowner) : TSystem("-root", "Net file Helper System") { // name must start with '-' to bypass the TSystem singleton check @@ -815,7 +816,7 @@ TNetSystem::TNetSystem(Bool_t ftpowner) /// for cleaning of the underlying TFTP connection; this allows /// to have control on the order of the final cleaning. -TNetSystem::TNetSystem(const char *url, Bool_t ftpowner) +ROOT::Deprecated::TNetSystem::TNetSystem(const char *url, Bool_t ftpowner) : TSystem("-root", "Net file Helper System") { // name must start with '-' to bypass the TSystem singleton check @@ -829,7 +830,7 @@ TNetSystem::TNetSystem(const char *url, Bool_t ftpowner) //////////////////////////////////////////////////////////////////////////////// /// Parse and save coordinates of the remote entity (user, host, port, ...) -void TNetSystem::InitRemoteEntity(const char *url) +void ROOT::Deprecated::TNetSystem::InitRemoteEntity(const char *url) { TUrl turl(url); @@ -853,7 +854,7 @@ void TNetSystem::InitRemoteEntity(const char *url) //////////////////////////////////////////////////////////////////////////////// /// Create a TNetSystem object. -void TNetSystem::Create(const char *url, TSocket *sock) +void ROOT::Deprecated::TNetSystem::Create(const char *url, TSocket *sock) { // If we got here protocol must be at least its short form "^root.*:" : // make sure that it is in the full form to avoid problems in TFTP @@ -916,8 +917,8 @@ void TNetSystem::Create(const char *url, TSocket *sock) fFTP->Close(); delete fFTP; } else { - fUser = fFTP->GetSocket()->GetSecContext()->GetUser(); - fHost = fFTP->GetSocket()->GetSecContext()->GetHost(); + fUser = ROOT::Deprecated::TSocketFriend::GetSecContext(*fFTP->GetSocket())->GetUser(); + fHost = ROOT::Deprecated::TSocketFriend::GetSecContext(*fFTP->GetSocket())->GetHost(); // If responsible for the TFTP connection, remove it from the // socket global list to avoid problems with double deletion // at final cleanup @@ -931,7 +932,7 @@ void TNetSystem::Create(const char *url, TSocket *sock) //////////////////////////////////////////////////////////////////////////////// /// Destructor -TNetSystem::~TNetSystem() +ROOT::Deprecated::TNetSystem::~TNetSystem() { // Close FTP connection if (fFTPOwner) { @@ -955,7 +956,7 @@ TNetSystem::~TNetSystem() //////////////////////////////////////////////////////////////////////////////// /// Make a directory via rootd. -Int_t TNetSystem::MakeDirectory(const char *dir) +Int_t ROOT::Deprecated::TNetSystem::MakeDirectory(const char *dir) { // If local, use the local TSystem if (fIsLocal) { @@ -977,7 +978,7 @@ Int_t TNetSystem::MakeDirectory(const char *dir) /// Open a directory and return an opaque pointer to a dir structure. /// Returns nullptr in case of error. -void *TNetSystem::OpenDirectory(const char *dir) +void *ROOT::Deprecated::TNetSystem::OpenDirectory(const char *dir) { // If local, use the local TSystem if (fIsLocal) { @@ -1011,7 +1012,7 @@ void *TNetSystem::OpenDirectory(const char *dir) //////////////////////////////////////////////////////////////////////////////// /// Free directory via rootd. -void TNetSystem::FreeDirectory(void *dirp) +void ROOT::Deprecated::TNetSystem::FreeDirectory(void *dirp) { // If local, use the local TSystem if (fIsLocal) { @@ -1036,7 +1037,7 @@ void TNetSystem::FreeDirectory(void *dirp) //////////////////////////////////////////////////////////////////////////////// /// Get directory entry via rootd. Returns 0 in case no more entries. -const char *TNetSystem::GetDirEntry(void *dirp) +const char *ROOT::Deprecated::TNetSystem::GetDirEntry(void *dirp) { // If local, use the local TSystem if (fIsLocal) { @@ -1060,7 +1061,7 @@ const char *TNetSystem::GetDirEntry(void *dirp) /// The function returns 0 in case of success and 1 if the file could /// not be stat'ed. -Int_t TNetSystem::GetPathInfo(const char *path, FileStat_t &buf) +Int_t ROOT::Deprecated::TNetSystem::GetPathInfo(const char *path, FileStat_t &buf) { // If local, use the local TSystem if (fIsLocal) { @@ -1084,7 +1085,7 @@ Int_t TNetSystem::GetPathInfo(const char *path, FileStat_t &buf) /// Mode is the same as for the Unix access(2) function. /// Attention, bizarre convention of return value!! -Bool_t TNetSystem::AccessPathName(const char *path, EAccessMode mode) +Bool_t ROOT::Deprecated::TNetSystem::AccessPathName(const char *path, EAccessMode mode) { // If local, use the local TSystem if (fIsLocal) { @@ -1106,7 +1107,7 @@ Bool_t TNetSystem::AccessPathName(const char *path, EAccessMode mode) /// Check consistency of this helper with the one required /// by 'path' or 'dirptr'. -Bool_t TNetSystem::ConsistentWith(const char *path, void *dirptr) +Bool_t ROOT::Deprecated::TNetSystem::ConsistentWith(const char *path, void *dirptr) { // Standard check: only the protocol part of 'path' is required to match Bool_t checkstd = TSystem::ConsistentWith(path, dirptr); @@ -1146,7 +1147,7 @@ Bool_t TNetSystem::ConsistentWith(const char *path, void *dirptr) //////////////////////////////////////////////////////////////////////////////// /// Remove a path -Int_t TNetSystem::Unlink(const char *path) +Int_t ROOT::Deprecated::TNetSystem::Unlink(const char *path) { // If local, use the local TSystem if (fIsLocal) { diff --git a/net/net/src/TNetFileStager.cxx b/net/net/src/TNetFileStager.cxx index 74babfbab0b11..3cfc8c9df5f58 100644 --- a/net/net/src/TNetFileStager.cxx +++ b/net/net/src/TNetFileStager.cxx @@ -25,7 +25,7 @@ //////////////////////////////////////////////////////////////////////////////// /// Constructor. Init a TNetSystem instance to the remote rootd. -TNetFileStager::TNetFileStager(const char *url) : TFileStager("net") +ROOT::Deprecated::TNetFileStager::TNetFileStager(const char *url) : TFileStager("net") { fSystem = 0; if (url && strlen(url) > 0) { @@ -38,7 +38,7 @@ TNetFileStager::TNetFileStager(const char *url) : TFileStager("net") //////////////////////////////////////////////////////////////////////////////// /// Destructor -TNetFileStager::~TNetFileStager() +ROOT::Deprecated::TNetFileStager::~TNetFileStager() { SafeDelete(fSystem); fPrefix = ""; @@ -47,7 +47,7 @@ TNetFileStager::~TNetFileStager() //////////////////////////////////////////////////////////////////////////////// /// Check if the file defined by 'path' is ready to be used. -Bool_t TNetFileStager::IsStaged(const char *path) +Bool_t ROOT::Deprecated::TNetFileStager::IsStaged(const char *path) { if (!IsValid()) { GetPrefix(path, fPrefix); @@ -68,7 +68,7 @@ Bool_t TNetFileStager::IsStaged(const char *path) //////////////////////////////////////////////////////////////////////////////// /// Isolate prefix in url -void TNetFileStager::GetPrefix(const char *url, TString &pfx) +void ROOT::Deprecated::TNetFileStager::GetPrefix(const char *url, TString &pfx) { if (gDebug > 1) ::Info("TNetFileStager::GetPrefix", "enter: %s", url); @@ -89,7 +89,7 @@ void TNetFileStager::GetPrefix(const char *url, TString &pfx) //////////////////////////////////////////////////////////////////////////////// /// Print basic info about this stager -void TNetFileStager::Print(Option_t *) const +void ROOT::Deprecated::TNetFileStager::Print(Option_t *) const { Printf("+++ stager: %s %s", GetName(), fPrefix.Data()); } @@ -98,7 +98,7 @@ void TNetFileStager::Print(Option_t *) const /// Get actual end-point url for a path /// Returns 0 in case of success and 1 if any error occurred -Int_t TNetFileStager::Locate(const char *path, TString &eurl) +Int_t ROOT::Deprecated::TNetFileStager::Locate(const char *path, TString &eurl) { if (!IsValid()) { GetPrefix(path, fPrefix); @@ -122,7 +122,7 @@ Int_t TNetFileStager::Locate(const char *path, TString &eurl) /// Returns kTRUE if stager 's' is compatible with current stager. /// Avoids multiple instantiations of the potentially the same TNetSystem. -Bool_t TNetFileStager::Matches(const char *s) +Bool_t ROOT::Deprecated::TNetFileStager::Matches(const char *s) { if (IsValid()) { TString pfx; diff --git a/net/net/src/TPServerSocket.cxx b/net/net/src/TPServerSocket.cxx index 5e019c893043a..0bdce8fb50271 100644 --- a/net/net/src/TPServerSocket.cxx +++ b/net/net/src/TPServerSocket.cxx @@ -138,8 +138,10 @@ TPSocket *TPServerSocket::Accept(UChar_t Opt) } // Transmit authentication information, if any - if (setupSocket->IsAuthenticated()) - newPSocket->SetSecContext(setupSocket->GetSecContext()); + if (ROOT::Deprecated::TSocketFriend::IsAuthenticated(*setupSocket)) { + ROOT::Deprecated::TSocketFriend::SetSecContext(*newPSocket, + ROOT::Deprecated::TSocketFriend::GetSecContext(*setupSocket)); + } // clean up, if needed if (size > 0) diff --git a/net/net/src/TPSocket.cxx b/net/net/src/TPSocket.cxx index a2ae958824d6b..5cef3c0c74623 100644 --- a/net/net/src/TPSocket.cxx +++ b/net/net/src/TPSocket.cxx @@ -195,7 +195,7 @@ TPSocket::TPSocket(const char *host, Int_t port, Int_t size, TSocket *sock) fBytesSent = sock->GetBytesSent(); fBytesRecv = sock->GetBytesRecv(); fCompress = sock->GetCompressionSettings(); - fSecContext = sock->GetSecContext(); + fSecContext = ROOT::Deprecated::TSocketFriend::GetSecContext(*sock); fRemoteProtocol = sock->GetRemoteProtocol(); fServType = (TSocket::EServiceType)sock->GetServType(); fTcpWindowSize = sock->GetTcpWindowSize(); diff --git a/net/net/src/TSecContext.cxx b/net/net/src/TSecContext.cxx index 7d315a786170c..d8c87d5b62f96 100644 --- a/net/net/src/TSecContext.cxx +++ b/net/net/src/TSecContext.cxx @@ -37,10 +37,10 @@ const TDatime kROOTTZERO = 788914800; //////////////////////////////////////////////////////////////////////////////// /// Ctor for SecContext object. -TSecContext::TSecContext(const char *user, const char *host, Int_t meth, - Int_t offset, const char *id, - const char *token, TDatime expdate, void *ctx) - : TObject() +ROOT::Deprecated::TSecContext::TSecContext(const char *user, const char *host, Int_t meth, + Int_t offset, const char *id, + const char *token, TDatime expdate, void *ctx) + : TObject() { R__ASSERT(gROOT); @@ -65,7 +65,7 @@ TSecContext::TSecContext(const char *user, const char *host, Int_t meth, // Keep official list updated with active TSecContexts if (fOffSet > -1) { R__LOCKGUARD(gROOTMutex); - gROOT->GetListOfSecContexts()->Add(this); + ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)->Add(this); } } @@ -73,10 +73,10 @@ TSecContext::TSecContext(const char *user, const char *host, Int_t meth, /// Ctor for SecContext object. /// User and host from url = `user@host` . -TSecContext::TSecContext(const char *url, Int_t meth, Int_t offset, - const char *token, const char *id, - TDatime expdate, void *ctx) - : TObject() +ROOT::Deprecated::TSecContext::TSecContext(const char *url, Int_t meth, Int_t offset, + const char *token, const char *id, + TDatime expdate, void *ctx) + : TObject() { R__ASSERT(gROOT); @@ -101,14 +101,14 @@ TSecContext::TSecContext(const char *url, Int_t meth, Int_t offset, // Keep official list updated with active TSecContexts if (fOffSet > -1) { R__LOCKGUARD(gROOTMutex); - gROOT->GetListOfSecContexts()->Add(this); + ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)->Add(this); } } //////////////////////////////////////////////////////////////////////////////// ///copy constructor -TSecContext::TSecContext(const TSecContext& sc) : +ROOT::Deprecated::TSecContext::TSecContext(const TSecContext& sc) : TObject(sc), fContext(sc.fContext), fCleanup(sc.fCleanup), @@ -126,7 +126,7 @@ TSecContext::TSecContext(const TSecContext& sc) : //////////////////////////////////////////////////////////////////////////////// ///assignement operator -TSecContext& TSecContext::operator=(const TSecContext& sc) +ROOT::Deprecated::TSecContext& ROOT::Deprecated::TSecContext::operator=(const TSecContext& sc) { if(this!=&sc) { TObject::operator=(sc); @@ -148,20 +148,20 @@ TSecContext& TSecContext::operator=(const TSecContext& sc) /// Dtor: delete (deActivate, local/remote cleanup, list removal) /// all what is still active -TSecContext::~TSecContext() +ROOT::Deprecated::TSecContext::~TSecContext() { Cleanup(); } //////////////////////////////////////////////////////////////////////////////// /// Cleanup what is still active -void TSecContext::Cleanup() +void ROOT::Deprecated::TSecContext::Cleanup() { if (IsActive()) { CleanupSecContext(kTRUE); DeActivate("R"); // All have been remotely Deactivated - TIter nxtl(gROOT->GetListOfSecContexts()); + TIter nxtl(ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)); TSecContext *nscl; while ((nscl = (TSecContext *)nxtl())) { if (nscl != this && !strcmp(nscl->GetHost(), fHost.Data())) { @@ -187,7 +187,7 @@ void TSecContext::Cleanup() /// If Opt contains "R" or "r", remove from the list /// Default Opt="CR" -void TSecContext::DeActivate(Option_t *Opt) +void ROOT::Deprecated::TSecContext::DeActivate(Option_t *Opt) { // Ask remote cleanup of this context Bool_t clean = (strstr(Opt,"C") || strstr(Opt,"c")); @@ -198,7 +198,7 @@ void TSecContext::DeActivate(Option_t *Opt) if (remove && fOffSet > -1){ R__LOCKGUARD(gROOTMutex); // Remove from the global list - gROOT->GetListOfSecContexts()->Remove(this); + ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)->Remove(this); } // Set inactive @@ -210,9 +210,9 @@ void TSecContext::DeActivate(Option_t *Opt) /// Create a new TSecContextCleanup /// Internally is added to the list -void TSecContext::AddForCleanup(Int_t port, Int_t proto, Int_t type) +void ROOT::Deprecated::TSecContext::AddForCleanup(Int_t port, Int_t proto, Int_t type) { - TSecContextCleanup *tscc = new TSecContextCleanup(port, proto, type); + auto *tscc = new ROOT::Deprecated::TSecContextCleanup(port, proto, type); fCleanup->Add(tscc); } @@ -221,7 +221,7 @@ void TSecContext::AddForCleanup(Int_t port, Int_t proto, Int_t type) /// Checks if this security context is for method named 'methname' /// Case sensitive. -Bool_t TSecContext::IsA(const char *methname) +Bool_t ROOT::Deprecated::TSecContext::IsA(const char *methname) { return Bool_t(!strcmp(methname, GetMethodName())); } @@ -229,7 +229,7 @@ Bool_t TSecContext::IsA(const char *methname) //////////////////////////////////////////////////////////////////////////////// /// Check remote OffSet and expiring Date -Bool_t TSecContext::IsActive() const +Bool_t ROOT::Deprecated::TSecContext::IsActive() const { if (fOffSet > -1 && fExpDate > TDatime()) return kTRUE; @@ -243,7 +243,7 @@ Bool_t TSecContext::IsActive() const /// with cardinality "" /// If opt is "S" prints short in-line form for calls within TFTP and similar -void TSecContext::Print(Option_t *opt) const +void ROOT::Deprecated::TSecContext::Print(Option_t *opt) const { char aOrd[16] = {0}; char aSpc[16] = {0}; @@ -307,7 +307,7 @@ void TSecContext::Print(Option_t *opt) const /// Returns short string with relevant information about this /// security context -const char *TSecContext::AsString(TString &out) +const char *ROOT::Deprecated::TSecContext::AsString(TString &out) { if (fOffSet > -1) { char expdate[32]; @@ -330,7 +330,7 @@ const char *TSecContext::AsString(TString &out) /// If 'all', all sec context with the same host as ctx /// are cleaned. -Bool_t TSecContext::CleanupSecContext(Bool_t) +Bool_t ROOT::Deprecated::TSecContext::CleanupSecContext(Bool_t) { AbstractMethod("CleanupSecContext"); return kFALSE; diff --git a/net/net/src/TServerSocket.cxx b/net/net/src/TServerSocket.cxx index 8342d45a59962..2a38ddbf2ae33 100644 --- a/net/net/src/TServerSocket.cxx +++ b/net/net/src/TServerSocket.cxx @@ -34,11 +34,11 @@ to the requester. The actual work is done via the TSystem class #include "TVirtualMutex.h" // Hook to server authentication wrapper -SrvAuth_t TServerSocket::fgSrvAuthHook = 0; -SrvClup_t TServerSocket::fgSrvAuthClupHook = 0; +ROOT::Deprecated::SrvAuth_t TServerSocket::fgSrvAuthHook = 0; +ROOT::Deprecated::SrvClup_t TServerSocket::fgSrvAuthClupHook = 0; // Defaul options for accept -UChar_t TServerSocket::fgAcceptOpt = kSrvNoAuth; +UChar_t TServerSocket::fgAcceptOpt = ROOT::Deprecated::kSrvNoAuth; TVirtualMutex *gSrvAuthenticateMutex = 0; @@ -53,8 +53,8 @@ static void SetAuthOpt(UChar_t &opt, UChar_t mod) if (!mod) return; - if ((mod & kSrvAuth)) opt |= kSrvAuth; - if ((mod & kSrvNoAuth)) opt &= ~kSrvAuth; + if ((mod & ROOT::Deprecated::kSrvAuth)) opt |= ROOT::Deprecated::kSrvAuth; + if ((mod & ROOT::Deprecated::kSrvNoAuth)) opt &= ~ROOT::Deprecated::kSrvAuth; } //////////////////////////////////////////////////////////////////////////////// @@ -65,7 +65,7 @@ static void SetAuthOpt(UChar_t &opt, UChar_t mod) /// Use tcpwindowsize to specify the size of the receive buffer, it has /// to be specified here to make sure the window scale option is set (for /// tcpwindowsize > 65KB and for platforms supporting window scaling). -/// The socketBindOption parameter allows to specify how the socket will be +/// The socketBindOption parameter allows to specify how the socket will be /// bound. See the documentation of ESocketBindOption for the details. /// Use IsValid() to check the validity of the /// server socket. In case server socket is not valid use GetErrorCode() @@ -130,7 +130,7 @@ TServerSocket::TServerSocket(const char *service, Bool_t reuse, Int_t backlog, /// Use tcpwindowsize to specify the size of the receive buffer, it has /// to be specified here to make sure the window scale option is set (for /// tcpwindowsize > 65KB and for platforms supporting window scaling). -/// The socketBindOption parameter allows to specify how the socket will be +/// The socketBindOption parameter allows to specify how the socket will be /// bound. See the documentation of ESocketBindOption for the details. /// Use IsValid() to check the validity of the /// server socket. In case server socket is not valid use GetErrorCode() @@ -193,20 +193,6 @@ TServerSocket::~TServerSocket() /// any open sockets are properly closed on program termination. /// In case of error 0 is returned and in case non-blocking I/O is /// enabled and no connections are available -1 is returned. -/// -/// The opt can be used to require client authentication; valid options are -/// -/// kSrvAuth = require client authentication -/// kSrvNoAuth = force no client authentication -/// -/// Example: use Opt = kSrvAuth to require client authentication. -/// -/// Default options are taken from fgAcceptOpt and are initially -/// equivalent to kSrvNoAuth; they can be changed with the static -/// method TServerSocket::SetAcceptOptions(Opt). -/// The active defaults can be visualized using the static method -/// TServerSocket::ShowAcceptOptions(). -/// TSocket *TServerSocket::Accept(UChar_t opt) { @@ -221,7 +207,7 @@ TSocket *TServerSocket::Accept(UChar_t opt) // Parse Opt UChar_t acceptOpt = fgAcceptOpt; SetAuthOpt(acceptOpt, opt); - Bool_t auth = (Bool_t)(acceptOpt & kSrvAuth); + Bool_t auth = (Bool_t)(acceptOpt & ROOT::Deprecated::kSrvAuth); socket->fSocket = soc; socket->fSecContext = 0; @@ -297,7 +283,7 @@ void TServerSocket::SetAcceptOptions(UChar_t mod) void TServerSocket::ShowAcceptOptions() { - ::Info("ShowAcceptOptions", "Use authentication: %s", (fgAcceptOpt & kSrvAuth) ? "yes" : "no"); + ::Info("ShowAcceptOptions", "Use authentication: %s", (fgAcceptOpt & ROOT::Deprecated::kSrvAuth) ? "yes" : "no"); } //////////////////////////////////////////////////////////////////////////////// @@ -327,7 +313,7 @@ Bool_t TServerSocket::Authenticate(TSocket *sock) // Locate SrvAuthenticate Func_t f = gSystem->DynFindSymbol(srvlib,"SrvAuthenticate"); if (f) - fgSrvAuthHook = (SrvAuth_t)(f); + fgSrvAuthHook = (ROOT::Deprecated::SrvAuth_t)(f); else { Error("Authenticate", "can't find SrvAuthenticate"); return kFALSE; @@ -336,7 +322,7 @@ Bool_t TServerSocket::Authenticate(TSocket *sock) // Locate SrvAuthCleanup f = gSystem->DynFindSymbol(srvlib,"SrvAuthCleanup"); if (f) - fgSrvAuthClupHook = (SrvClup_t)(f); + fgSrvAuthClupHook = (ROOT::Deprecated::SrvClup_t)(f); else { Warning("Authenticate", "can't find SrvAuthCleanup"); } diff --git a/net/net/src/TSocket.cxx b/net/net/src/TSocket.cxx index b497eac12dc22..b76a47ee0f6ba 100644 --- a/net/net/src/TSocket.cxx +++ b/net/net/src/TSocket.cxx @@ -39,6 +39,22 @@ TUnixSystem or TWinNTSystem). #include +Bool_t ROOT::Deprecated::TSocketFriend::IsAuthenticated(const TSocket &s) +{ + return s.fSecContext; +} + +void ROOT::Deprecated::TSocketFriend::SetSecContext(TSocket &s, TSecContext *ctx) +{ + s.fSecContext = ctx; +} + +ROOT::Deprecated::TSecContext *ROOT::Deprecated::TSocketFriend::GetSecContext(const TSocket &s) +{ + return s.fSecContext; +} + + ULong64_t TSocket::fgBytesSent = 0; ULong64_t TSocket::fgBytesRecv = 0; @@ -1177,7 +1193,7 @@ Bool_t TSocket::Authenticate(const char *user) } // Get an instance of the interface class - TVirtualAuth *auth = (TVirtualAuth *)(h->ExecPlugin(0)); + auto auth = (ROOT::Deprecated::TVirtualAuth *)(h->ExecPlugin(0)); if (!auth) { Error("Authenticate", "could not instantiate the interface class"); return rc; @@ -1217,7 +1233,7 @@ Bool_t TSocket::Authenticate(const char *user) // Authentication was not required: create inactive // security context for consistency - fSecContext = new TSecContext(user, host, 0, -4, 0, 0); + fSecContext = new ROOT::Deprecated::TSecContext(user, host, 0, -4, 0, 0); if (gDebug > 3) Info("Authenticate", "no authentication required remotely"); @@ -1275,8 +1291,8 @@ Bool_t TSocket::Authenticate(const char *user) /// Returns pointer to an authenticated socket or 0 if creation or /// authentication is unsuccessful. -TSocket *TSocket::CreateAuthSocket(const char *url, Int_t size, Int_t tcpwindowsize, - TSocket *opensock, Int_t *err) +TSocket *ROOT::Deprecated::TSocketFriend::CreateAuthSocket( + const char *url, Int_t size, Int_t tcpwindowsize, TSocket *opensock, Int_t *err) { R__LOCKGUARD2(gSocketAuthMutex); @@ -1361,7 +1377,7 @@ TSocket *TSocket::CreateAuthSocket(const char *url, Int_t size, Int_t tcpwindows sock = new TPSocket(eurl, TUrl(url).GetPort(), size, tcpwindowsize); // Cleanup if failure ... - if (sock && !sock->IsAuthenticated()) { + if (sock && !ROOT::Deprecated::TSocketFriend::IsAuthenticated(*sock)) { // Nothing to do except setting the error code (if required) and sock to NULL if (err) { *err = (Int_t)kErrAuthNotOK; @@ -1412,9 +1428,8 @@ TSocket *TSocket::CreateAuthSocket(const char *url, Int_t size, Int_t tcpwindows /// Returns pointer to an authenticated socket or 0 if creation or /// authentication is unsuccessful. -TSocket *TSocket::CreateAuthSocket(const char *user, const char *url, - Int_t port, Int_t size, Int_t tcpwindowsize, - TSocket *opensock, Int_t *err) +TSocket *ROOT::Deprecated::TSocketFriend::CreateAuthSocket( + const char *user, const char *url, Int_t port, Int_t size, Int_t tcpwindowsize, TSocket *opensock, Int_t *err) { R__LOCKGUARD2(gSocketAuthMutex); @@ -1443,7 +1458,7 @@ TSocket *TSocket::CreateAuthSocket(const char *user, const char *url, } // Create the socket and return it - return TSocket::CreateAuthSocket(eurl,size,tcpwindowsize,opensock,err); + return TSocketFriend::CreateAuthSocket(eurl,size,tcpwindowsize,opensock,err); } //////////////////////////////////////////////////////////////////////////////// diff --git a/net/net/src/TUDPSocket.cxx b/net/net/src/TUDPSocket.cxx index 2255345e51bb1..4f51c60704c87 100644 --- a/net/net/src/TUDPSocket.cxx +++ b/net/net/src/TUDPSocket.cxx @@ -32,7 +32,6 @@ TUnixSystem or TWinNTSystem). #include "TString.h" #include "TSystem.h" #include "TUrl.h" -#include "TVirtualAuth.h" #include "TStreamerInfo.h" #include "TProcessID.h" diff --git a/net/rpdutils/src/DaemonUtils.cxx b/net/rpdutils/src/DaemonUtils.cxx index d9b45699f5484..19d79bef87c46 100644 --- a/net/rpdutils/src/DaemonUtils.cxx +++ b/net/rpdutils/src/DaemonUtils.cxx @@ -53,7 +53,6 @@ #include "Rtypes.h" #include "Varargs.h" #include "DaemonUtils.h" -#include "TAuthenticate.h" #include "TSecContext.h" #include "TEnv.h" #include "TROOT.h" @@ -189,8 +188,8 @@ void ErrSys(int level, const char *msg, int size) Int_t SrvClupImpl(TSeqCollection *secls) { TIter next(secls); - TSecContext *nsc ; - while ((nsc = (TSecContext *)next())) { + ROOT::Deprecated::TSecContext *nsc ; + while ((nsc = (ROOT::Deprecated::TSecContext *)next())) { if (!strncmp(nsc->GetID(),"server",6)) { int rc = RpdCleanupAuthTab(nsc->GetToken()); if (gDebug > 0 && rc < 0) @@ -260,15 +259,15 @@ Int_t SrvAuthImpl(TSocket *socket, const char *confdir, const char *tmpdir, int clientprotocol = 0; rc = RpdInitSession(gService, user, clientprotocol, meth, type, ctoken); - TSecContext *seccontext = 0; + ROOT::Deprecated::TSecContext *seccontext = 0; if (rc > 0) { string openhost(socket->GetInetAddress().GetHostName()); if (type == 1) { // An existing authentication has been re-used: retrieve // the related security context - TIter next(gROOT->GetListOfSecContexts()); - while ((seccontext = (TSecContext *)next())) { + TIter next(ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)); + while ((seccontext = (ROOT::Deprecated::TSecContext *)next())) { if (!(strncmp(seccontext->GetID(),"server",6))) { if (seccontext->GetMethod() == meth) { if (!strcmp(openhost.c_str(),seccontext->GetHost())) { @@ -283,13 +282,13 @@ Int_t SrvAuthImpl(TSocket *socket, const char *confdir, const char *tmpdir, if (!seccontext) { // New authentication: Fill a SecContext for cleanup // in case of interrupt - seccontext = new TSecContext(user.c_str(), openhost.c_str(), meth, -1, - "server", ctoken.c_str()); + seccontext = new ROOT::Deprecated::TSecContext(user.c_str(), openhost.c_str(), meth, -1, + "server", ctoken.c_str()); if (seccontext) { // Add to the list secctxlist->Add(seccontext); // Store SecContext - socket->SetSecContext(seccontext); + ROOT::Deprecated::TSocketFriend::SetSecContext(*socket, seccontext); } else { if (gDebug > 0) ErrorInfo("SrvAuthImpl: could not create sec context object" diff --git a/net/rpdutils/src/error.cxx b/net/rpdutils/src/error.cxx index 92e8f31b3a759..6d182bb2771e6 100644 --- a/net/rpdutils/src/error.cxx +++ b/net/rpdutils/src/error.cxx @@ -62,7 +62,7 @@ void ResetErrno() void ErrorInfo(const char *va_(fmt), ...) { - char buf[kMAXSECBUF]; + char buf[ROOT::Deprecated::kMAXSECBUF]; va_list ap; va_start(ap,va_(fmt)); @@ -104,7 +104,7 @@ void Perror(char *buf, int size) void Error(ErrorHandler_t func, int code, const char *va_(fmt), ...) { - char buf[kMAXSECBUF]; + char buf[ROOT::Deprecated::kMAXSECBUF]; va_list ap; va_start(ap,va_(fmt)); diff --git a/net/rpdutils/src/rpdutils.cxx b/net/rpdutils/src/rpdutils.cxx index 5ef6c9f84cd63..08e9a3b127bdb 100644 --- a/net/rpdutils/src/rpdutils.cxx +++ b/net/rpdutils/src/rpdutils.cxx @@ -228,8 +228,8 @@ std::string gServName[3] = { "sockd", "rootd" }; static const int gAUTH_CLR_MSK = 0x1; // Masks for authentication methods static const int gMAXTABSIZE = 50000000; -static const std::string gAuthMeth[kMAXSEC] = { "UsrPwd", "Unsupported", "Unsupported", - "Unsupported", "Unsupported", "Unsupported" }; +static const std::string gAuthMeth[ROOT::Deprecated::kMAXSEC] = { "UsrPwd", "Unsupported", "Unsupported", + "Unsupported", "Unsupported", "Unsupported" }; static const std::string gAuthTab = "/rpdauthtab"; // auth table static const std::string gDaemonRc = ".rootdaemonrc"; // daemon access rules static const std::string gRootdPass = ".rootdpass"; // special rootd passwd @@ -248,11 +248,11 @@ static int gClientOld = 0; // msg sync for old client (<=3.05/07) static int gClientProtocol = -1; static int gCryptRequired = -1; static std::string gCryptToken; -static int gAllowMeth[kMAXSEC]; +static int gAllowMeth[ROOT::Deprecated::kMAXSEC]; static int gAnon = 0; static int gExistingAuth = 0; static int gAuthListSent = 0; -static int gHaveMeth[kMAXSEC]; +static int gHaveMeth[ROOT::Deprecated::kMAXSEC]; static EMessageTypes gKindOld; // msg sync for old client (<=3.05/07) static int gMethInit = 0; static int gNumAllow = -1; @@ -286,12 +286,12 @@ static int gSaltRequired = -1; static int gSec = -1; static int gServerProtocol = -1; static EService gService = kROOTD; -static int gTriedMeth[kMAXSEC]; +static int gTriedMeth[ROOT::Deprecated::kMAXSEC]; static char gUser[64] = { 0 }; -static char *gUserAllow[kMAXSEC] = { 0 }; // User access control -static unsigned int gUserAlwLen[kMAXSEC] = { 0 }; -static unsigned int gUserIgnLen[kMAXSEC] = { 0 }; -static char *gUserIgnore[kMAXSEC] = { 0 }; +static char *gUserAllow[ROOT::Deprecated::kMAXSEC] = { 0 }; // User access control +static unsigned int gUserAlwLen[ROOT::Deprecated::kMAXSEC] = { 0 }; +static unsigned int gUserIgnLen[ROOT::Deprecated::kMAXSEC] = { 0 }; +static char *gUserIgnore[ROOT::Deprecated::kMAXSEC] = { 0 }; //////////////////////////////////////////////////////////////////////////////// /// rand() implementation using /udev/random or /dev/random, if available @@ -1472,7 +1472,7 @@ int RpdReUseAuth(const char *sstr, int kind) // Decode subject string sscanf(sstr, "%d %d %d %d %63s", &gRemPid, &offset, &opt, &lenU, user); user[lenU] = '\0'; - if ((gReUseRequired = (opt & kAUTH_REUSE_MSK))) { + if ((gReUseRequired = (opt & ROOT::Deprecated::kAUTH_REUSE_MSK))) { gOffSet = offset; if (gRemPid > 0 && gOffSet > -1) { auth = @@ -1628,7 +1628,7 @@ int RpdCheckAuthAllow(int Sec, const char *Host) // Reset mth[kMAXSEC] nmet = 0; - for (i = 0; i < kMAXSEC; i++) { + for (i = 0; i < ROOT::Deprecated::kMAXSEC; i++) { mth[i] = -1; } @@ -1663,11 +1663,11 @@ int RpdCheckAuthAllow(int Sec, const char *Host) if (strlen(tmp) > 1) { - for (tmet = 0; tmet < kMAXSEC; tmet++) { + for (tmet = 0; tmet < ROOT::Deprecated::kMAXSEC; tmet++) { if (!rpdstrcasecmp(gAuthMeth[tmet].c_str(), tmp)) break; } - if (tmet < kMAXSEC) { + if (tmet < ROOT::Deprecated::kMAXSEC) { if (gDebug > 2) ErrorInfo("RpdCheckAuthAllow: tmet %d", tmet); } else { @@ -1683,8 +1683,8 @@ int RpdCheckAuthAllow(int Sec, const char *Host) jm = -1; if (gDebug > 2) ErrorInfo("RpdCheckAuthAllow: found method %d (have?:%d)", - tmet, (tmet >= 0 && tmet < kMAXSEC) ? gHaveMeth[tmet] : 0); - if (tmet >= 0 && tmet < kMAXSEC) { + tmet, (tmet >= 0 && tmet < ROOT::Deprecated::kMAXSEC) ? gHaveMeth[tmet] : 0); + if (tmet >= 0 && tmet < ROOT::Deprecated::kMAXSEC) { if (gHaveMeth[tmet] == 1) { int ii; for (ii = 0; ii < nmet; ii++) { @@ -1788,7 +1788,7 @@ int RpdCheckAuthAllow(int Sec, const char *Host) found = 1; retval = 1; gNumAllow = gNumLeft = nmet; - for (i = 0; i < kMAXSEC; i++) { + for (i = 0; i < ROOT::Deprecated::kMAXSEC; i++) { gAllowMeth[i] = -1; gTriedMeth[i] = 0; if (i < gNumAllow) { @@ -1834,13 +1834,13 @@ int RpdCheckAuthAllow(int Sec, const char *Host) ("RpdCheckAuthAllow: returning: %d (gNumAllow: %d, gNumLeft:%d)", retval, gNumAllow, gNumLeft); int i, jm; - for (i = 0; i < kMAXSEC; i++) { + for (i = 0; i < ROOT::Deprecated::kMAXSEC; i++) { jm = gAllowMeth[i]; if (gUserAlwLen[jm] > 0) ErrorInfo("RpdCheckAuthAllow: users allowed for method %d: %s", jm, gUserAllow[jm]); } - for (i = 0; i < kMAXSEC; i++) { + for (i = 0; i < ROOT::Deprecated::kMAXSEC; i++) { jm = gAllowMeth[i]; if (gUserIgnLen[jm] > 0) ErrorInfo("RpdCheckAuthAllow: users ignored for method %d: %s", @@ -2493,7 +2493,7 @@ void RpdInitAuth() // Reset int i; gNumAllow = gNumLeft = 0; - for (i = 0; i < kMAXSEC; i++) { + for (i = 0; i < ROOT::Deprecated::kMAXSEC; i++) { gAllowMeth[i] = -1; gHaveMeth[i] = 1; } @@ -2623,9 +2623,9 @@ int RpdUser(const char *sstr) user[ulen] = '\0'; if (nw > 5) ruser[rulen] = '\0'; - gReUseRequired = (opt & kAUTH_REUSE_MSK); - gCryptRequired = (opt & kAUTH_CRYPT_MSK); - gSaltRequired = (opt & kAUTH_SSALT_MSK); + gReUseRequired = (opt & ROOT::Deprecated::kAUTH_REUSE_MSK); + gCryptRequired = (opt & ROOT::Deprecated::kAUTH_CRYPT_MSK); + gSaltRequired = (opt & ROOT::Deprecated::kAUTH_SSALT_MSK); gOffSet = ofs; #ifdef R__SSL if (gRSASSLKey) { @@ -3230,7 +3230,7 @@ int RpdSavePubKey(const char *PubKey, int OffSet, char *user) int RpdSecureSend(char *str) { - char buftmp[kMAXSECBUF]; + char buftmp[ROOT::Deprecated::kMAXSECBUF]; char buflen[20]; int ttmp = 0; @@ -3238,7 +3238,7 @@ int RpdSecureSend(char *str) if (gRSAKey == 1) { strncpy(buftmp, str, sizeof(buftmp) - 1); - buftmp[kMAXSECBUF - 1] = '\0'; + buftmp[ROOT::Deprecated::kMAXSECBUF - 1] = '\0'; ttmp = rsa_encode(buftmp, strlen(buftmp) + 1, gRSA_n, gRSA_d); } else if (gRSAKey == 2) { #ifdef R__SSL @@ -3275,7 +3275,7 @@ int RpdSecureSend(char *str) int RpdSecureRecv(char **str) { - char buftmp[kMAXSECBUF]; + char buftmp[ROOT::Deprecated::kMAXSECBUF]; char buflen[20]; int nrec = -1; @@ -3424,9 +3424,9 @@ int RpdGenRSAKeys(int setrndinit) char buf_n[rsa_STRLEN], buf_e[rsa_STRLEN], buf_d[rsa_STRLEN]; int nAttempts = 0; - int thePrimeLen = kPRIMELENGTH; - int thePrimeExp = kPRIMEEXP + 5; // Prime probability = 1-0.5^thePrimeExp - while (notOK && nAttempts < kMAXRSATRIES) { + int thePrimeLen = ROOT::Deprecated::kPRIMELENGTH; + int thePrimeExp = ROOT::Deprecated::kPRIMEEXP + 5; // Prime probability = 1-0.5^thePrimeExp + while (notOK && nAttempts < ROOT::Deprecated::kMAXRSATRIES) { nAttempts++; if (gDebug > 2 && nAttempts > 1) { @@ -3440,7 +3440,7 @@ int RpdGenRSAKeys(int setrndinit) // Retry if equal int nPrimes = 0; - while (rsa_cmp(&p1, &p2) == 0 && nPrimes < kMAXRSATRIES) { + while (rsa_cmp(&p1, &p2) == 0 && nPrimes < ROOT::Deprecated::kMAXRSATRIES) { nPrimes++; if (gDebug > 2) ErrorInfo("RpdGenRSAKeys: equal primes: regenerate (%d times)",nPrimes); @@ -3540,7 +3540,7 @@ int RpdGenRSAKeys(int setrndinit) if (notOK) { ErrorInfo("RpdGenRSAKeys: unable to generate good RSA key pair" - " (%d attempts)- return",kMAXRSATRIES); + " (%d attempts)- return",ROOT::Deprecated::kMAXRSATRIES); return 1; } diff --git a/roottest/root/io/event/MainEvent.cxx b/roottest/root/io/event/MainEvent.cxx index bb97e320ba586..3fd786ec159f7 100644 --- a/roottest/root/io/event/MainEvent.cxx +++ b/roottest/root/io/event/MainEvent.cxx @@ -180,7 +180,7 @@ int main(int argc, char** argv) // -- Read case TFile* hfile = nullptr; if (netf) { - hfile = new TNetFile("root://localhost/root/test/EventNet.root"); + hfile = new ROOT::Deprecated::TNetFile("root://localhost/root/test/EventNet.root"); } else { hfile = new TFile(gFilename); } @@ -226,7 +226,8 @@ int main(int argc, char** argv) // This file is now becoming the current directory. TFile* hfile = 0; if (netf) { - hfile = new TNetFile("root://localhost/root/test/EventNet.root", "RECREATE", "TTree benchmark ROOT file"); + hfile = new ROOT::Deprecated::TNetFile("root://localhost/root/test/EventNet.root", "RECREATE", + "TTree benchmark ROOT file"); } else { hfile = new TFile(gFilename, "RECREATE", "TTree benchmark ROOT file"); } diff --git a/roottest/root/treeformula/references/TreeFormulaReferencesGenerator.cxx b/roottest/root/treeformula/references/TreeFormulaReferencesGenerator.cxx index e86c71dbf75fd..380993bf964cd 100644 --- a/roottest/root/treeformula/references/TreeFormulaReferencesGenerator.cxx +++ b/roottest/root/treeformula/references/TreeFormulaReferencesGenerator.cxx @@ -154,7 +154,7 @@ int main(int argc, char **argv) // Read case if (read) { if (netf) { - hfile = new TNetFile("root://localhost/root/test/EventNet.root"); + hfile = new ROOT::Deprecated::TNetFile("root://localhost/root/test/EventNet.root"); } else hfile = new TFile(filename); TTree *tree = (TTree*)hfile->Get("T"); @@ -187,7 +187,8 @@ int main(int argc, char **argv) // pictures, graphics objects, detector geometries, tracks, events, etc.. // This file is now becoming the current directory. if (netf) { - hfile = new TNetFile("root://localhost/root/test/EventNet.root","RECREATE","TTree benchmark ROOT file"); + hfile = new ROOT::Deprecated::TNetFile("root://localhost/root/test/EventNet.root","RECREATE", + "TTree benchmark ROOT file"); } else hfile = new TFile(filename,"RECREATE","TTree benchmark ROOT file"); hfile->SetCompressionLevel(comp); diff --git a/roottest/root/treeformula/schemaEvolution/MainEvent.cxx b/roottest/root/treeformula/schemaEvolution/MainEvent.cxx index b2acd45022f34..ff2fc666cedab 100644 --- a/roottest/root/treeformula/schemaEvolution/MainEvent.cxx +++ b/roottest/root/treeformula/schemaEvolution/MainEvent.cxx @@ -153,7 +153,7 @@ int main(int argc, char **argv) // Read case if (read) { if (netf) { - hfile = new TNetFile("root://localhost/root/test/EventNet.root"); + hfile = new ROOT::Deprecated::TNetFile("root://localhost/root/test/EventNet.root"); } else hfile = new TFile("Event.root"); tree = (TTree*)hfile->Get("T"); @@ -186,7 +186,8 @@ int main(int argc, char **argv) // pictures, graphics objects, detector geometries, tracks, events, etc.. // This file is now becoming the current directory. if (netf) { - hfile = new TNetFile("root://localhost/root/test/EventNet.root","RECREATE","TTree benchmark ROOT file"); + hfile = new ROOT::Deprecated::TNetFile("root://localhost/root/test/EventNet.root","RECREATE", + "TTree benchmark ROOT file"); } else hfile = new TFile("Event.root","RECREATE","TTree benchmark ROOT file"); hfile->SetCompressionLevel(comp); diff --git a/test/MainEvent.cxx b/test/MainEvent.cxx index 4ab5f991ae5fc..4e58af85a4671 100644 --- a/test/MainEvent.cxx +++ b/test/MainEvent.cxx @@ -172,7 +172,7 @@ int MainEvent(int nevent, int comp, int split, int arg4, int arg5, int enable_im // Read case if (read) { if (netf) { - hfile = new TNetFile("root://localhost/root/test/EventNet.root"); + hfile = new ROOT::Deprecated::TNetFile("root://localhost/root/test/EventNet.root"); } else hfile = new TFile(outFiles.back().c_str()); tree = (TTree*)hfile->Get("T"); @@ -216,7 +216,8 @@ int MainEvent(int nevent, int comp, int split, int arg4, int arg5, int enable_im // pictures, graphics objects, detector geometries, tracks, events, etc.. // This file is now becoming the current directory. if (netf) { - hfile = new TNetFile("root://localhost/root/test/EventNet.root","RECREATE","TTree benchmark ROOT file"); + hfile = new ROOT::Deprecated::TNetFile("root://localhost/root/test/EventNet.root","RECREATE", + "TTree benchmark ROOT file"); } else hfile = new TFile(outFiles.back().c_str(),"RECREATE","TTree benchmark ROOT file"); hfile->SetCompressionLevel(comp); diff --git a/tutorials/legacy/net/TestAuth.C b/tutorials/legacy/net/TestAuth.C deleted file mode 100644 index c1b20a5873fcf..0000000000000 --- a/tutorials/legacy/net/TestAuth.C +++ /dev/null @@ -1,275 +0,0 @@ -/// \file -/// \ingroup tutorial_net -/// Macro test authentication methods stand alone -/// -/// See `$ROOTSYS/README/README.AUTH` for additional details -/// -/// Syntax: -/// -/// ~~~ {.cpp} -/// .x TestAuth.C(,"") -/// -/// = rootd port (default 1094) -/// = login user name for the test -/// (default from getpwuid) -/// ~~~ -/// -/// MAKE SURE that rootd is running -/// -/// Example of successful output: -/// -/// ~~~ {.cpp} -/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -/// + + -/// + TestAuth.C + -/// + + -/// + Test of authentication methods + -/// + + -/// + Syntax: + -/// + + -/// + .x TestAuth.C(,"") + -/// + + -/// + = rootd port (default 1094) + -/// + = login user name for the test + -/// + (default from getpwuid) + -/// + + -/// + >>> MAKE SURE that rootd is running <<< + -/// + + -/// + See $ROOTSYS/README/README.AUTH for additional details + -/// + + -/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -/// -/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -/// + + -/// + Basic test parameters: + -/// + + -/// + Local User is : ganis -/// + Authentication Details : pt:0 ru:1 us:ganis -/// + Current directory is : /home/ganis/local/root/root/tutorials -/// + TFTP string : root://localhost:1094 -/// + + -/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -/// + + -/// + Testing UsrPwd ... + -/// ganis@localhost password: -/// + + -/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -/// -/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -/// + + -/// + Result of the tests: + -/// + + -/// + Method: 0 (UsrPwd): successful! (reuse: successful!) + -/// + + -/// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -/// ~~~ -/// -/// \macro_code -/// -/// \author - -int TestAuth(int port = 1094, char *user = "") -{ - // - // This macro tests the authentication methods - // - gROOT->Reset(); - -// Getting debug flag - Int_t lDebug = gEnv->GetValue("Root.Debug",0); - -// Useful flags - Bool_t HaveMeth[6] = {1,0,0,0,0,1}; - Int_t TestMeth[6] = {0,0,0,0,0,0}; - Int_t TestReUse[6] = {3,3,3,3,3,3}; - - -// Some Printout - printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); - printf("+ +\n"); - printf("+ TestAuth.C +\n"); - printf("+ +\n"); - printf("+ Test of authentication methods +\n"); - printf("+ +\n"); - printf("+ Syntax: +\n"); - printf("+ +\n"); - printf("+ .x TestAuth.C(,\"\") +\n"); - printf("+ +\n"); - printf("+ = rootd port (default 1094) +\n"); - printf("+ = login user name for the test +\n"); - printf("+ (default from getpwuid) +\n"); - printf("+ +\n"); - printf("+ >>> MAKE SURE that rootd is running <<< +\n"); - printf("+ +\n"); - printf("+ See $ROOTSYS/README/README.AUTH for additional details +\n"); - printf("+ +\n"); - printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n"); - -// Useful variables - -// User - TString User = user; - if (User == "") { - - UserGroup_t *u = gSystem->GetUserInfo(); - if (!u) { - printf("\n >>>> 'user' not defined: please enter a valid username:\n"); - char utmp[256] = {0}; - scanf("%s",utmp); - if (strlen(utmp)) { - User = utmp; - } else { - printf(">>>> no 'user' defined: return!\n"); - return 1; - } - } else { - User = u->fUser; - } - - } - -// Host - TString Host = "localhost"; - TString HostName = gSystem->HostName(); - -// File path string for TFTP - //TString TFTPPath = TString("root://localhost:")+ port ; - TString TFTPPath = TString("root://")+User+TString("@localhost:")+ port ; - -// Details - TString Details = TString("pt:0 ru:1 us:") + User; - -// Testing availabilities - char *p; - -// Test parameter Printout - printf("\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); - printf("+ +\n"); - printf("+ Basic test parameters: +\n"); - printf("+ +\n"); - printf("+ Local User is : %s \n",User.Data()); - printf("+ Authentication Details : %s \n",Details.Data()); - printf("+ Current directory is : %s \n",gSystem->WorkingDirectory()); - printf("+ TFTP string : %s \n",TFTPPath.Data()); - printf("+ +\n"); - printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); - -// Read local now to avoid to be later superseded - TAuthenticate::ReadRootAuthrc(); - if (lDebug > 0) - TAuthenticate::Show(); - - TFTP *t1 = 0; -// UsrPwd method - printf("+ +\n"); - printf("+ Testing UsrPwd ... +\n"); - - // Check if by any chance locally there is already an THostAuth matching - // the one we want to use for testing - THostAuth *hasv1 = 0; - THostAuth *ha = TAuthenticate::HasHostAuth(Host.Data(),User.Data()); - if (ha) { - // We need to save it to restore at the end - hasv1 = new THostAuth(*ha); - // We reset the existing one - ha->Reset(); - // And update it with the info we want - ha->AddMethod(0,Details.Data()); - } else { - // We create directly a new THostAuth - ha = new THostAuth(Host.Data(),User.Data(),0,Details.Data()); - // And add object to list so that TAuthenticate has - // a chance to find it - TAuthenticate::GetAuthInfo()->Add(ha); - } - - // Print available host auth info - if (lDebug > 0) - ha->Print(); - - { - // First authentication attempt - t1 = new TFTP(TFTPPath.Data(),2); - if (t1->IsOpen()) { - TestMeth[0] = 1; - } else { - printf(" >>>>>>>>>>>>>>>> Test of UsrPwd authentication failed \n"); - }} - - // Try ReUse - if (TestMeth[0] == 1) { - TIter next(ha->Established()); - TSecContext *ai; - while ((ai = (TSecContext *) next())) { - if (ai->GetMethod() == 0) { - Int_t OffSet = ai->GetOffSet(); - TestReUse[0] = 0; - if (OffSet > -1) { - TestReUse[0] = 1; - } - } - } - } - // Delete t1 - if (t1) delete t1; - // remove method from available list - ha->RemoveMethod(0); - - printf("+ +\n"); - printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); - - // Print available host auth info - if (lDebug > 0) - TAuthenticate::Show(); - -// Now restore initial configuration - if (hasv1) { - ha->Reset(); - ha->Update(hasv1); - } else { - TAuthenticate::GetAuthInfo()->Remove(ha); - } - if (hasv2) { - hak->Reset(); - hak->Update(hasv2); - } else { - TAuthenticate::GetAuthInfo()->Remove(hak); - } - -// Final Printout - printf("\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); - printf("+ +\n"); - printf("+ Result of the tests: +\n"); - printf("+ +\n"); - char status[4][20] = {"failed!","successful!","not testable","not tested"}; - int i = 0; - for( i=0; i<6; i++ ) { - if (HaveMeth[i] && TestMeth[i] < 2) { - if (i < 5) { - printf("+ Method: %d %8s: %11s (reuse: %11s) +\n",i, - Form("(%s)",TAuthenticate::GetAuthMethod(i)), - status[TestMeth[i]],status[TestReUse[i]]); - } else - printf("+ Method: %d %8s: %11s +\n",i, - Form("(%s)",TAuthenticate::GetAuthMethod(i)), - status[TestMeth[i]]); - } - } - Bool_t NotPrinted = kTRUE; - for( i=0; i<6; i++ ) { - if (HaveMeth[i] && TestMeth[i] > 1) { - if (NotPrinted) { - printf("+ +\n"); - printf("+ Could not be tested: +\n"); - printf("+ +\n"); - NotPrinted = kFALSE; - } - printf("+ Method: %d %8s: %11s +\n",i, - Form("(%s)",TAuthenticate::GetAuthMethod(i)), - status[TestMeth[i]]); - } - } - printf("+ +\n"); - printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); - -} diff --git a/tutorials/legacy/net/authclient.C b/tutorials/legacy/net/authclient.C deleted file mode 100644 index 48983a46d8fee..0000000000000 --- a/tutorials/legacy/net/authclient.C +++ /dev/null @@ -1,77 +0,0 @@ -/// \file -/// \ingroup tutorial_net -/// This macro should be run together with authserv.C to test -/// authentication between two remote ROOT sessions. -/// Run first the authserv.C within a ROOT session on the server -/// machine, eg. "srv.machi.ne": -/// -/// root[] .x authserv.C(3000) -/// -/// authserv accepts as argument the port where it starts listening -/// (default 3000). -/// You can then run authclient.c in a ROOT session on the client -/// machine: -/// root[] .x authclient.C("srv.machi.ne:3000") -/// -/// and you should get prompted for the credentials, if the case. -/// To start a parallel socket of size, for example, 5, enter the -/// size as second argument, ie -/// -/// root[] .x authclient.C("srv.machi.ne:3000",5) -/// -/// \macro_code -/// -/// \author - -#include "TPSocket.h" - -void authclient(const char *host = "up://localhost:3000", int sz = 0) -{ - Int_t par = (sz > 1) ? 1 : 0; - - // Parse protocol, if any - TString proto(TUrl(host).GetProtocol()); - TString protosave = proto; - - // Get rid of authentication suffix - TString asfx = proto; - if (proto.EndsWith("up") || proto.EndsWith("ug")) { - asfx.Remove(0,proto.Length()-2); - proto.Resize(proto.Length()-2); - } else if (proto.EndsWith("s") || proto.EndsWith("k") || - proto.EndsWith("g") || proto.EndsWith("h")) { - asfx.Remove(0,proto.Length()-1); - proto.Resize(proto.Length()-1); - } - - // Force parallel (even of size 1) - TString newurl = "p" + asfx; - newurl += "://"; - if (strlen(TUrl(host).GetUser())) { - newurl += TUrl(host).GetUser(); - newurl += "@"; - } - newurl += TUrl(host).GetHost(); - newurl += ":"; - newurl += TUrl(host).GetPort(); - - cout << "authclient: starting a (parallel) authenticated socket at " - << newurl.Data() << " (size: " << sz << ")" << endl; - - TSocket *s = TSocket::CreateAuthSocket(newurl.Data(),sz); - - // Print out; - if (s) - if (s->IsAuthenticated()) - cout << "authclient: auth socket: OK" << endl; - else - cout << "authclient: auth socket: failed" << endl; - - // Cleanup - if (s) { - // Remove this authentication from the token list to avoid - // later warnings - s->GetSecContext()->DeActivate("R"); - delete s; - } -} diff --git a/tutorials/legacy/net/authserv.C b/tutorials/legacy/net/authserv.C deleted file mode 100644 index aa9fcbd98e058..0000000000000 --- a/tutorials/legacy/net/authserv.C +++ /dev/null @@ -1,57 +0,0 @@ -/// \file -/// \ingroup tutorial_net -/// This macro should be run together with authclient.C to test -/// authentication between two remote ROOT sessions. -/// Run first the authserv.C within a ROOT session on the server -/// machine, eg. "srv.machi.ne": -/// -/// root[] .x authserv.C(3000) -/// -/// authserv accepts as argument the port where it starts listening -/// (default 3000). -/// You can then run authclient.c in a ROOT session on the client -/// machine: -/// -/// root[] .x authclient.C("srv.machi.ne:3000") -/// -/// and you should get prompted for the credentials, if the case. -/// To start a parallel socket of size, for example, 5, enter the -/// size as second argument, ie -/// -/// root[] .x authclient.C("srv.machi.ne:3000",5) -/// -/// -/// \macro_code -/// -/// \author - -#include "TPServerSocket.h" - -void authserv(int po = 3000) -{ - - UChar_t oauth = kSrvAuth; - - TServerSocket *ss = 0; - TSocket *s = 0; - - cout << "authserv: starting a (parallel) server socket on port " - << po << " with authentication" << endl; - - ss = new TPServerSocket(po); - - // Get the connection - s = ss->Accept(oauth); - - // Print out; - if (s) - if (s->IsAuthenticated()) - cout << "authserv: srv auth socket: OK" << endl; - else - cout << "authserv: srv auth socket: failed" << endl; - - // Cleanup - if (s) delete s; - if (ss) delete ss; -} -