Skip to content

Commit 0d8536d

Browse files
committed
[net] deprecate TSecContext
1 parent 59dcb99 commit 0d8536d

9 files changed

Lines changed: 36 additions & 35 deletions

File tree

core/base/inc/TVirtualAuth.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121

2222
#include "Rtypes.h"
2323

24-
class TSecContext;
2524
class TSocket;
2625

2726
namespace ROOT::Deprecated {
2827

28+
class TSecContext;
29+
2930
class TVirtualAuth {
3031

3132
public:

net/auth/inc/TRootAuth.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
#include "TVirtualAuth.h"
2626
#include "Rtypes.h"
2727

28-
class TSecContext;
2928
class TSocket;
3029

3130
namespace ROOT::Deprecated {
3231

32+
class TSecContext;
33+
3334
class TRootAuth : public TVirtualAuth {
3435

3536
public:

net/auth/src/TRootAuth.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
/// Invoked when dynamic loading is needed.
3333
/// Returns 1 on success, 0 on failure.
3434

35-
TSecContext *
35+
ROOT::Deprecated::TSecContext *
3636
ROOT::Deprecated::TRootAuth::Authenticate(TSocket *s, const char *host, const char *user, Option_t */*opts*/)
3737
{
3838
TSecContext *ctx = 0;

net/net/inc/LinkDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#pragma link C++ class TGridJobStatus+;
4444
#pragma link C++ class TGridJobStatusList+;
4545
#pragma link C++ class TGridCollection+;
46-
#pragma link C++ class TSecContext;
46+
#pragma link C++ class ROOT::Deprecated::TSecContext;
4747
#pragma link C++ class ROOT::Deprecated::TSecContextCleanup;
4848
#pragma link C++ class TFileStager;
4949
#pragma link C++ class TApplicationRemote;

net/net/inc/TSecContext.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
R__EXTERN const TDatime kROOTTZERO;
3131

3232
namespace ROOT::Deprecated {
33+
3334
class TRootSecContext;
34-
}
3535

3636
class TSecContext : public TObject {
3737

@@ -94,8 +94,6 @@ friend class ROOT::Deprecated::TRootSecContext;
9494
ClassDefOverride(TSecContext,0) // Class providing host specific authentication information
9595
};
9696

97-
namespace ROOT::Deprecated {
98-
9997
//
10098
// TSecContextCleanup
10199
//
@@ -148,6 +146,7 @@ class TPwdCtx {
148146

149147
} // namespace ROOT::Deprecated
150148

149+
using TSecContext R__DEPRECATED(6, 42, "TSecContext is deprecated") = ROOT::Deprecated::TSecContext;
151150
using TSecContextCleanup R__DEPRECATED(6, 42, "TPwdCtx is deprecated") = ROOT::Deprecated::TSecContextCleanup;
152151
using TPwdCtx R__DEPRECATED(6, 42, "TPwdCtx is deprecated") = ROOT::Deprecated::TPwdCtx;
153152

net/net/inc/TSocket.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ friend class TServerSocket;
6666
Int_t fCompress; // Compression level and algorithm
6767
TInetAddress fLocalAddress; // local internet address and port #
6868
Int_t fRemoteProtocol; // protocol of remote daemon
69-
TSecContext *fSecContext; // after a successful Authenticate call
70-
// points to related security context
69+
ROOT::Deprecated::TSecContext *fSecContext; // after a successful Authenticate call
70+
// points to related security context
7171
TString fService; // name of service (matches remote port #)
7272
EServiceType fServType; // remote service type
7373
Int_t fSocket; // socket descriptor
@@ -128,7 +128,7 @@ friend class TServerSocket;
128128
Int_t GetErrorCode() const;
129129
virtual Int_t GetOption(ESockOptions opt, Int_t &val);
130130
Int_t GetRemoteProtocol() const { return fRemoteProtocol; }
131-
TSecContext *GetSecContext() const { return fSecContext; }
131+
ROOT::Deprecated::TSecContext *GetSecContext() const { return fSecContext; }
132132
Int_t GetTcpWindowSize() const { return fTcpWindowSize; }
133133
TTimeStamp GetLastUsage() { R__LOCKGUARD2(fLastUsageMtx); return fLastUsage; }
134134
const char *GetUrl() const { return fUrl.Data(); }
@@ -153,7 +153,7 @@ friend class TServerSocket;
153153
void SetCompressionSettings(Int_t settings = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault);
154154
virtual Int_t SetOption(ESockOptions opt, Int_t val);
155155
void SetRemoteProtocol(Int_t rproto) { fRemoteProtocol = rproto; }
156-
void SetSecContext(TSecContext *ctx) { fSecContext = ctx; }
156+
void SetSecContext(ROOT::Deprecated::TSecContext *ctx) { fSecContext = ctx; }
157157
void SetService(const char *service) { fService = service; }
158158
void SetServType(Int_t st) { fServType = (EServiceType)st; }
159159
void SetUrl(const char *url) { fUrl = url; }

net/net/inc/TUDPSocket.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ friend class TServerSocket;
5151
Int_t fCompress; // Compression level and algorithm
5252
TInetAddress fLocalAddress; // local internet address and port #
5353
Int_t fRemoteProtocol; // protocol of remote daemon
54-
TSecContext *fSecContext; // after a successful Authenticate call
55-
// points to related security context
54+
ROOT::Deprecated::TSecContext *fSecContext; // after a successful Authenticate call
55+
// points to related security context
5656
TString fService; // name of service (matches remote port #)
5757
EServiceType fServType; // remote service type
5858
Int_t fSocket; // socket descriptor
@@ -110,7 +110,7 @@ friend class TServerSocket;
110110
Int_t GetErrorCode() const;
111111
virtual Int_t GetOption(ESockOptions opt, Int_t &val);
112112
Int_t GetRemoteProtocol() const { return fRemoteProtocol; }
113-
TSecContext *GetSecContext() const { return fSecContext; }
113+
ROOT::Deprecated::TSecContext *GetSecContext() const { return fSecContext; }
114114

115115
TTimeStamp GetLastUsage() { R__LOCKGUARD2(fLastUsageMtx); return fLastUsage; }
116116
const char *GetUrl() const { return fUrl; }
@@ -135,7 +135,7 @@ friend class TServerSocket;
135135
void SetCompressionSettings(Int_t settings = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault);
136136
virtual Int_t SetOption(ESockOptions opt, Int_t val);
137137
void SetRemoteProtocol(Int_t rproto) { fRemoteProtocol = rproto; }
138-
void SetSecContext(TSecContext *ctx) { fSecContext = ctx; }
138+
void SetSecContext(ROOT::Deprecated::TSecContext *ctx) { fSecContext = ctx; }
139139
void SetService(const char *service) { fService = service; }
140140
void SetServType(Int_t st) { fServType = (EServiceType)st; }
141141
void SetUrl(const char *url) { fUrl = url; }

net/net/src/TSecContext.cxx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ const TDatime kROOTTZERO = 788914800;
3737
////////////////////////////////////////////////////////////////////////////////
3838
/// Ctor for SecContext object.
3939

40-
TSecContext::TSecContext(const char *user, const char *host, Int_t meth,
41-
Int_t offset, const char *id,
42-
const char *token, TDatime expdate, void *ctx)
43-
: TObject()
40+
ROOT::Deprecated::TSecContext::TSecContext(const char *user, const char *host, Int_t meth,
41+
Int_t offset, const char *id,
42+
const char *token, TDatime expdate, void *ctx)
43+
: TObject()
4444
{
4545
R__ASSERT(gROOT);
4646

@@ -73,10 +73,10 @@ TSecContext::TSecContext(const char *user, const char *host, Int_t meth,
7373
/// Ctor for SecContext object.
7474
/// User and host from url = `user@host` .
7575

76-
TSecContext::TSecContext(const char *url, Int_t meth, Int_t offset,
77-
const char *token, const char *id,
78-
TDatime expdate, void *ctx)
79-
: TObject()
76+
ROOT::Deprecated::TSecContext::TSecContext(const char *url, Int_t meth, Int_t offset,
77+
const char *token, const char *id,
78+
TDatime expdate, void *ctx)
79+
: TObject()
8080
{
8181
R__ASSERT(gROOT);
8282

@@ -108,7 +108,7 @@ TSecContext::TSecContext(const char *url, Int_t meth, Int_t offset,
108108
////////////////////////////////////////////////////////////////////////////////
109109
///copy constructor
110110

111-
TSecContext::TSecContext(const TSecContext& sc) :
111+
ROOT::Deprecated::TSecContext::TSecContext(const TSecContext& sc) :
112112
TObject(sc),
113113
fContext(sc.fContext),
114114
fCleanup(sc.fCleanup),
@@ -126,7 +126,7 @@ TSecContext::TSecContext(const TSecContext& sc) :
126126
////////////////////////////////////////////////////////////////////////////////
127127
///assignement operator
128128

129-
TSecContext& TSecContext::operator=(const TSecContext& sc)
129+
ROOT::Deprecated::TSecContext& TSecContext::operator=(const TSecContext& sc)
130130
{
131131
if(this!=&sc) {
132132
TObject::operator=(sc);
@@ -148,14 +148,14 @@ TSecContext& TSecContext::operator=(const TSecContext& sc)
148148
/// Dtor: delete (deActivate, local/remote cleanup, list removal)
149149
/// all what is still active
150150

151-
TSecContext::~TSecContext()
151+
ROOT::Deprecated::TSecContext::~TSecContext()
152152
{
153153
Cleanup();
154154
}
155155
////////////////////////////////////////////////////////////////////////////////
156156
/// Cleanup what is still active
157157

158-
void TSecContext::Cleanup()
158+
void ROOT::Deprecated::TSecContext::Cleanup()
159159
{
160160
if (IsActive()) {
161161
CleanupSecContext(kTRUE);
@@ -187,7 +187,7 @@ void TSecContext::Cleanup()
187187
/// If Opt contains "R" or "r", remove from the list
188188
/// Default Opt="CR"
189189

190-
void TSecContext::DeActivate(Option_t *Opt)
190+
void ROOT::Deprecated::TSecContext::DeActivate(Option_t *Opt)
191191
{
192192
// Ask remote cleanup of this context
193193
Bool_t clean = (strstr(Opt,"C") || strstr(Opt,"c"));
@@ -210,7 +210,7 @@ void TSecContext::DeActivate(Option_t *Opt)
210210
/// Create a new TSecContextCleanup
211211
/// Internally is added to the list
212212

213-
void TSecContext::AddForCleanup(Int_t port, Int_t proto, Int_t type)
213+
void ROOT::Deprecated::TSecContext::AddForCleanup(Int_t port, Int_t proto, Int_t type)
214214
{
215215
auto *tscc = new ROOT::Deprecated::TSecContextCleanup(port, proto, type);
216216
fCleanup->Add(tscc);
@@ -221,15 +221,15 @@ void TSecContext::AddForCleanup(Int_t port, Int_t proto, Int_t type)
221221
/// Checks if this security context is for method named 'methname'
222222
/// Case sensitive.
223223

224-
Bool_t TSecContext::IsA(const char *methname)
224+
Bool_t ROOT::Deprecated::TSecContext::IsA(const char *methname)
225225
{
226226
return Bool_t(!strcmp(methname, GetMethodName()));
227227
}
228228

229229
////////////////////////////////////////////////////////////////////////////////
230230
/// Check remote OffSet and expiring Date
231231

232-
Bool_t TSecContext::IsActive() const
232+
Bool_t ROOT::Deprecated::TSecContext::IsActive() const
233233
{
234234
if (fOffSet > -1 && fExpDate > TDatime())
235235
return kTRUE;
@@ -243,7 +243,7 @@ Bool_t TSecContext::IsActive() const
243243
/// with cardinality "<number>"
244244
/// If opt is "S" prints short in-line form for calls within TFTP and similar
245245

246-
void TSecContext::Print(Option_t *opt) const
246+
void ROOT::Deprecated::TSecContext::Print(Option_t *opt) const
247247
{
248248
char aOrd[16] = {0};
249249
char aSpc[16] = {0};
@@ -307,7 +307,7 @@ void TSecContext::Print(Option_t *opt) const
307307
/// Returns short string with relevant information about this
308308
/// security context
309309

310-
const char *TSecContext::AsString(TString &out)
310+
const char *ROOT::Deprecated::TSecContext::AsString(TString &out)
311311
{
312312
if (fOffSet > -1) {
313313
char expdate[32];
@@ -330,7 +330,7 @@ const char *TSecContext::AsString(TString &out)
330330
/// If 'all', all sec context with the same host as ctx
331331
/// are cleaned.
332332

333-
Bool_t TSecContext::CleanupSecContext(Bool_t)
333+
Bool_t ROOT::Deprecated::TSecContext::CleanupSecContext(Bool_t)
334334
{
335335
AbstractMethod("CleanupSecContext");
336336
return kFALSE;

net/net/src/TSocket.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ Bool_t TSocket::Authenticate(const char *user)
12101210

12111211
// Authentication was not required: create inactive
12121212
// security context for consistency
1213-
fSecContext = new TSecContext(user, host, 0, -4, 0, 0);
1213+
fSecContext = new ROOT::Deprecated::TSecContext(user, host, 0, -4, 0, 0);
12141214
if (gDebug > 3)
12151215
Info("Authenticate", "no authentication required remotely");
12161216

0 commit comments

Comments
 (0)