20 #include "RConfigure.h"
37 Int_t offset, const
char *
id,
38 const
char *token,
TDatime expdate,
40 :
TSecContext(user, host, meth, offset,
id, token, expdate, ctx)
53 const char *
id,
const char *token,
55 :
TSecContext(url, meth, offset, id, token, expdate, ctx)
83 Bool_t clean = (strstr(Opt,
"C") || strstr(Opt,
"c"));
98 if (globusAuthHook != 0) {
106 Bool_t remove = (strstr(Opt,
"R") || strstr(Opt,
"r"));
110 gROOT->GetListOfSecContexts()->Remove(
this);
158 news->
Send(
"cleaning request");
166 if (all || level == 1) {
174 Info(
"CleanupSecContext",
"problems secure-sending token");
179 if (cleaned &&
gDebug > 2) {
180 char srvname[3][10] = {
"sockd",
"rootd",
"proofd"};
181 Info(
"CleanupSecContext",
182 "remote %s notified for cleanup (%s,%d)",
192 Info(
"CleanupSecContext",
193 "unable to open valid socket for cleanup for %s",
fHost.
Data());
209 for (; i < (
Int_t)strlen(opt); i++) {
210 if (opt[i] < 48 || opt[i] > 57) {
219 if (!strncasecmp(opt,
"F",1)) {
221 "+------------------------------------------------------+");
223 "+ Host:%s Method:%d (%s) User:'%s'",
232 "+------------------------------------------------------+");
233 }
else if (!strncasecmp(opt,
"S",1)) {
236 Printf(
"Security context: Method: AFS, not reusable");
238 Printf(
"Security context: Method: %d (%s) expiring on %s",
242 Printf(
"Security context: Method: %d (%s) not reusable",
247 Info(
"PrintEstblshed",
"+ %d \t h:%s met:%d (%s) us:'%s'",
264 out =
Form(
"Method: AFS, not reusable");
267 out =
Form(
"Method: %d (%s) expiring on %s",
274 out =
Form(
"Method: %d (%s) authorized by /etc/hosts.equiv or $HOME/.rhosts",
277 out =
Form(
"No authentication required remotely");
void DeActivate(Option_t *opt="CR")
Set OffSet to -1 and expiring Date to default Remove from the list If globus, cleanup local stuff If ...
static void RemoveSecContext(TRootSecContext *ctx)
Tool for removing SecContext ctx from THostAuth listed in fgAuthInfo or fgProofAuthInfo.
Int_t(* GlobusAuth_t)(TAuthenticate *auth, TString &user, TString &det)
virtual Bool_t IsValid() const
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
static GlobusAuth_t GetGlobusAuthHook()
Static method returning the globus authorization hook.
const char * GetHost() const
const char * GetMethodName() const
Bool_t IsActive() const
Check remote OffSet and expiring Date.
R__EXTERN TVirtualMutex * gROOTMutex
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TRootSecContext(const char *url, Int_t meth, Int_t offset, const char *id, const char *token, TDatime expdate=kROOTTZERO, void *ctx=0, Int_t key=1)
Ctor for SecContext object.
ClassImp(TRootSecContext) TRootSecContext
Ctor for SecContext object.
const char * Data() const
UChar_t mod R__LOCKGUARD2(gSrvAuthenticateMutex)
void Cleanup()
Cleanup what is still active.
static Int_t SecureSend(TSocket *Socket, Int_t enc, Int_t KeyType, const char *In)
Encode null terminated str using the session private key indicated by enc and sends it over the netwo...
virtual ~TRootSecContext()
Dtor: delete (deActivate, local/remote cleanup, list removal) all what is still active.
char * Form(const char *fmt,...)
void Print(Option_t *option="F") const
If opt is "F" (default) print object content.
Int_t GetProtocol() const
const char * AsString(TString &out)
Returns short string with relevant information about this security context.
const Bool_t kIterBackward
const char * AsString() const
Return the date & time as a string (ctime() format).
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...
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
static const char * GetAuthMethod(Int_t idx)
Static method returning the method corresponding to idx.