Skip to content

Commit 0476216

Browse files
committed
[core] deprecate TROOT::GetListOfSecContexts()
1 parent 0d8536d commit 0476216

5 files changed

Lines changed: 21 additions & 9 deletions

File tree

core/base/inc/TROOT.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,15 @@ namespace ROOT {
9999
UInt_t GetThreadPoolSize();
100100
}
101101

102+
namespace ROOT::Deprecated::Internal {
103+
TSeqCollection *GetListOfSecContexts(const TROOT &);
104+
} // namespace ROOT::Deprecated::Internal
105+
102106
class TROOT : public TDirectory {
103107

104108
friend class TCling;
105109
friend TROOT *ROOT::Internal::GetROOT2();
110+
friend TSeqCollection *ROOT::Deprecated::Internal::GetListOfSecContexts(const TROOT &);
106111

107112
private:
108113
Int_t fLineIsProcessing = 0; ///< To synchronize multi-threads
@@ -256,7 +261,9 @@ friend TROOT *ROOT::Internal::GetROOT2();
256261
TSeqCollection *GetListOfStreamerInfo() const { return fStreamerInfo; }
257262
TSeqCollection *GetListOfMessageHandlers() const { return fMessageHandlers; }
258263
TCollection *GetListOfClassGenerators() const { return fClassGenerators; }
259-
TSeqCollection *GetListOfSecContexts() const { return fSecContexts; }
264+
TSeqCollection *GetListOfSecContexts() const
265+
R__DEPRECATED(6, 42, "GetListOfSecContexts authentication is deprecated")
266+
{ return ROOT::Deprecated::Internal::GetListOfSecContexts(*this); }
260267
TSeqCollection *GetClipboard() const { return fClipboard; }
261268
TSeqCollection *GetListOfDataSets() const { return fDataSets; }
262269
TCollection *GetListOfEnums(Bool_t load = kFALSE);

core/base/src/TROOT.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ FARPROC dlsym(void *library, const char *function_name)
170170
#include "TWinNTSystem.h"
171171
#endif
172172

173+
TSeqCollection *ROOT::Deprecated::Internal::GetListOfSecContexts(const TROOT &r)
174+
{
175+
return r.fSecContexts;
176+
}
177+
173178
extern "C" void R__SetZipMode(int);
174179

175180
static DestroyInterpreter_t *gDestroyInterpreter = nullptr;
@@ -2835,7 +2840,7 @@ void TROOT::SetBatch(Bool_t batch)
28352840
/// interactive mode.
28362841
/// - "server:port": turns the web display into server mode with specified port. Web widgets will not be displayed,
28372842
/// only text message with window URL will be printed on standard output
2838-
///
2843+
///
28392844
/// \note See more details related to webdisplay on RWebWindowsManager::ShowWindow
28402845

28412846
void TROOT::SetWebDisplay(const char *webdisplay)

net/auth/src/TAuthenticate.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ void ROOT::Deprecated::TAuthenticate::Show(Option_t *opt)
21512151
if (sopt.Contains("s", TString::kIgnoreCase)) {
21522152

21532153
// Print established security contexts
2154-
TIter next(gROOT->GetListOfSecContexts());
2154+
TIter next(ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT));
21552155
TSecContext *sc = 0;
21562156
while ((sc = (TSecContext *)next()))
21572157
sc->Print();
@@ -2207,7 +2207,7 @@ Int_t ROOT::Deprecated::TAuthenticate::AuthExists(TString username, Int_t method
22072207

22082208
// If nothing found, try the all list
22092209
if (!secctx) {
2210-
next = TIter(gROOT->GetListOfSecContexts());
2210+
next = TIter(ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT));
22112211
while ((secctx = (TRootSecContext *)next())) {
22122212
if (secctx->GetMethod() == method) {
22132213
if (fRemote == secctx->GetHost()) {

net/auth/src/TRootSecContext.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void ROOT::Deprecated::TRootSecContext::DeActivate(Option_t *Opt)
9393
if (remove && fOffSet > -1){
9494
R__LOCKGUARD(gROOTMutex);
9595
// Remove from the global list
96-
gROOT->GetListOfSecContexts()->Remove(this);
96+
ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)->Remove(this);
9797
// Remove also from local lists in THostAuth objects
9898
TAuthenticate::RemoveSecContext(this);
9999
}

net/net/src/TSecContext.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ ROOT::Deprecated::TSecContext::TSecContext(const char *user, const char *host, I
6565
// Keep official list updated with active TSecContexts
6666
if (fOffSet > -1) {
6767
R__LOCKGUARD(gROOTMutex);
68-
gROOT->GetListOfSecContexts()->Add(this);
68+
ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)->Add(this);
6969
}
7070
}
7171

@@ -101,7 +101,7 @@ ROOT::Deprecated::TSecContext::TSecContext(const char *url, Int_t meth, Int_t of
101101
// Keep official list updated with active TSecContexts
102102
if (fOffSet > -1) {
103103
R__LOCKGUARD(gROOTMutex);
104-
gROOT->GetListOfSecContexts()->Add(this);
104+
ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)->Add(this);
105105
}
106106
}
107107

@@ -161,7 +161,7 @@ void ROOT::Deprecated::TSecContext::Cleanup()
161161
CleanupSecContext(kTRUE);
162162
DeActivate("R");
163163
// All have been remotely Deactivated
164-
TIter nxtl(gROOT->GetListOfSecContexts());
164+
TIter nxtl(ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT));
165165
TSecContext *nscl;
166166
while ((nscl = (TSecContext *)nxtl())) {
167167
if (nscl != this && !strcmp(nscl->GetHost(), fHost.Data())) {
@@ -198,7 +198,7 @@ void ROOT::Deprecated::TSecContext::DeActivate(Option_t *Opt)
198198
if (remove && fOffSet > -1){
199199
R__LOCKGUARD(gROOTMutex);
200200
// Remove from the global list
201-
gROOT->GetListOfSecContexts()->Remove(this);
201+
ROOT::Deprecated::Internal::GetListOfSecContexts(*gROOT)->Remove(this);
202202
}
203203

204204
// Set inactive

0 commit comments

Comments
 (0)