21 #include "RConfigure.h"
39 Int_t offset, const
char *
id,
40 const
char *token,
TDatime expdate,
void *ctx)
66 gROOT->GetListOfSecContexts()->Add(
this);
75 const char *token,
const char *
id,
102 gROOT->GetListOfSecContexts()->Add(
this);
111 fContext(sc.fContext),
112 fCleanup(sc.fCleanup),
113 fExpDate(sc.fExpDate),
117 fMethodName(sc.fMethodName),
165 if (nscl !=
this && !strcmp(nscl->GetHost(),
fHost.
Data())) {
191 Bool_t clean = (strstr(Opt,
"C") || strstr(Opt,
"c"));
195 Bool_t remove = (strstr(Opt,
"R") || strstr(Opt,
"r"));
199 gROOT->GetListOfSecContexts()->Remove(
this);
252 for (; i < (
Int_t)strlen(opt); i++) {
253 if (opt[i] < 48 || opt[i] > 57) {
264 snprintf(aOrd,10,
"%d)",ord);
266 Int_t len=strlen(aOrd);
268 strlcat(aSpc,
" ",10);
271 if (!strncasecmp(opt,
"F",1)) {
273 "+------------------------------------------------------+");
275 "+ Host:%s Method:%d (%s) User:'%s'",
284 "+------------------------------------------------------+");
285 }
else if (!strncasecmp(opt,
"S",1)) {
287 Printf(
"Security context: Method: %d (%s) expiring on %s",
291 Printf(
"Security context: Method: %d (%s) not reusable",
296 Info(
"PrintEstblshed",
"+ %s h:%s met:%d (%s) us:'%s'",
313 out =
Form(
"Method: %d (%s) expiring on %s",
319 out =
Form(
"Method: %d (%s) authorized by /etc/hosts.equiv or $HOME/.rhosts",
322 out =
Form(
"No authentication required remotely");
const char * GetHost() const
TSecContext(const TSecContext &)
copy constructor
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
void Set()
Set Date/Time to current time as reported by the system.
void AddForCleanup(Int_t port, Int_t proto, Int_t type)
Create a new TSecContextCleanup Internally is added to the list.
This class represents a WWW compatible URL.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual ~TSecContext()
Dtor: delete (deActivate, local/remote cleanup, list removal) all what is still active.
const char * GetHost() const
const char * GetMethodName() const
Bool_t IsActive() const
Check remote OffSet and expiring Date.
R__EXTERN TVirtualMutex * gROOTMutex
const char * Data() const
UChar_t mod R__LOCKGUARD2(gSrvAuthenticateMutex)
TObject & operator=(const TObject &rhs)
TObject assignment operator.
void Cleanup()
Cleanup what is still active.
virtual Bool_t CleanupSecContext(Bool_t all)
Ask remote client to cleanup security context 'ctx' If 'all', all sec context with the same host as c...
Bool_t IsA(const char *methodname)
Checks if this security context is for method named 'methname' Case sensitive.
TSecContext & operator=(const TSecContext &)
assignement operator
char * Form(const char *fmt,...)
virtual void DeActivate(Option_t *opt="CR")
Set OffSet to -1 and expiring Date to default Remove from the list If Opt contains "C" or "c"...
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract...
virtual const char * AsString(TString &out)
Returns short string with relevant information about this security context.
virtual void Print(Option_t *option="F") const
If opt is "F" (default) print object content.
ClassImp(TSecContext) ClassImp(TSecContextCleanup) TSecContext
Ctor for SecContext object.
Mother of all ROOT objects.
virtual void Add(TObject *obj)
const char * AsString() const
Return the date & time as a string (ctime() format).
const char * GetUser() const
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...