ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TestAuth.C
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // Macro test authentication methods stand alone
4 //
5 // See $ROOTSYS/README/README.AUTH for additional details
6 //
7 // Syntax:
8 //
9 // .x TestAuth.C(<port>,"<user>","<krb5_princ>","<globus_det>")
10 //
11 // <port> = rootd port (default 1094)
12 // <user> = login user name for the test
13 // (default from getpwuid)
14 // <krb5_princ> = Principal to be used for Krb5 authentication
15 // in the form user@THE.REA.LM
16 // ( default: <running_user@Default_Realm with
17 // Default_realm taken from /etc/krb5.conf
18 // or the $KRB5_CONFIG file )
19 // <globus_det> = details for the globus authentication
20 // ( default: ad:certificates cd:$HOME/.globus
21 // cf:usercert.pem kf:userkey.pem )
22 //
23 // MAKE SURE that rootd is running
24 //
25 // Example of successful output:
26 //
27 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28 // + +
29 // + TestAuth.C +
30 // + +
31 // + Test of authentication methods +
32 // + +
33 // + Syntax: +
34 // + +
35 // + .x TestAuth.C(<port>,"<user>","<krb5_princ>","<globus_det>") +
36 // + +
37 // + <port> = rootd port (default 1094) +
38 // + <user> = login user name for the test +
39 // + (default from getpwuid) +
40 // + <krb5_princ> = Principal to be used for Krb5 authentication +
41 // + in the form user@THE.REA.LM +
42 // + ( default: <running_user@Default_Realm with +
43 // + Default_realm taken from /etc/krb5.conf +
44 // + or the $KRB5_CONFIG file ) +
45 // + <globus_det> = details for the globus authentication +
46 // + ( default ad:certificates cd:$HOME/.globus +
47 // + cf:usercert.pem kf:userkey.pem ) +
48 // + +
49 // + >>> MAKE SURE that rootd is running <<< +
50 // + +
51 // + See $ROOTSYS/README/README.AUTH for additional details +
52 // + +
53 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
54 //
55 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
56 // + +
57 // + Basic test parameters: +
58 // + +
59 // + Local User is : ganis
60 // + Authentication Details : pt:0 ru:1 us:ganis
61 // + Current directory is : /home/ganis/local/root/root/tutorials
62 // + TFTP string : root://localhost:1094
63 // + Krb5 Details : pt:0 ru:1 us:ganis@PCEPSFT43.CERN.CH
64 // + +
65 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66 // + +
67 // + Testing UsrPwd ... +
68 // ganis@localhost password:
69 // + +
70 // + Testing SRP ... +
71 // ganis@localhost SRP password:
72 // + +
73 // + Testing Krb5 ... +
74 // Password for ganis@PCEPSFT43.CERN.CH:
75 // + +
76 // + Testing Globus ... +
77 // Local Globus Certificates ( )
78 // Enter <key>:<new value> to change:
79 // Your identity: /O=Grid/OU=GlobusTest/OU=simpleCA-arthux.cern.ch/OU=cern.ch/CN=ganis
80 // Enter GRID pass phrase for this identity:
81 // Creating proxy ............................ Done
82 // Your proxy is valid until: Fri Oct 31 09:33:04 2003
83 // + +
84 // + Testing SSH ... +
85 // ganis@localhost's password:
86 // + +
87 // + Testing UidGid ... +
88 // + +
89 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
90 //
91 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
92 // + +
93 // + Result of the tests: +
94 // + +
95 // + Method: 0 (UsrPwd): successful! (reuse: successful!) +
96 // + Method: 1 (SRP): successful! (reuse: successful!) +
97 // + Method: 2 (Krb5): successful! (reuse: successful!) +
98 // + Method: 3 (Globus): successful! (reuse: successful!) +
99 // + Method: 4 (SSH): successful! (reuse: successful!) +
100 // + Method: 5 (UidGid): successful! +
101 // + +
102 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
103 //
104 ///////////////////////////////////////////////////////////////////////////////
105 //
106 int TestAuth(int port = 1094, char *user = "", char *krb5 = "", char *globus = "")
107 {
108  //
109  // This macro tests the authentication methods
110  //
111  gROOT->Reset();
112 
113 // Getting debug flag
114  Int_t lDebug = gEnv->GetValue("Root.Debug",0);
115 
116 // Useful flags
117  Bool_t HaveMeth[6] = {1,0,0,0,0,1};
118  Int_t TestMeth[6] = {0,0,0,0,0,0};
119  Int_t TestReUse[6] = {3,3,3,3,3,3};
120 
121 
122 // Some Printout
123  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
124  printf("+ +\n");
125  printf("+ TestAuth.C +\n");
126  printf("+ +\n");
127  printf("+ Test of authentication methods +\n");
128  printf("+ +\n");
129  printf("+ Syntax: +\n");
130  printf("+ +\n");
131  printf("+ .x TestAuth.C(<port>,\"<user>\",\"<krb5_princ>\",\"<globus_det>\") +\n");
132  printf("+ +\n");
133  printf("+ <port> = rootd port (default 1094) +\n");
134  printf("+ <user> = login user name for the test +\n");
135  printf("+ (default from getpwuid) +\n");
136  printf("+ <krb5_princ> = Principal to be used for Krb5 authentication +\n");
137  printf("+ in the form user@THE.REA.LM +\n");
138  printf("+ ( default: <running_user@Default_Realm with +\n");
139  printf("+ Default_realm taken from /etc/krb5.conf +\n");
140  printf("+ or the $KRB5_CONFIG file ) +\n");
141  printf("+ <globus_det> = details for the globus authentication +\n");
142  printf("+ ( default ad:certificates cd:$HOME/.globus +\n");
143  printf("+ cf:usercert.pem kf:userkey.pem ) +\n");
144  printf("+ +\n");
145  printf("+ >>> MAKE SURE that rootd is running <<< +\n");
146  printf("+ +\n");
147  printf("+ See $ROOTSYS/README/README.AUTH for additional details +\n");
148  printf("+ +\n");
149  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n");
150 
151 // Useful variables
152 
153 // User
154  TString User = user;
155  if (User == "") {
156 
158  if (!u) {
159  printf("\n >>>> 'user' not defined: please enter a valid username:\n");
160  char utmp[256] = {0};
161  scanf("%s",utmp);
162  if (strlen(utmp)) {
163  User = utmp;
164  } else {
165  printf(">>>> no 'user' defined: return!\n");
166  return 1;
167  }
168  } else {
169  User = u->fUser;
170  }
171 
172  }
173 
174 // Host
175  TString Host = "localhost";
176  TString HostName = gSystem->HostName();
177 
178 // File path string for TFTP
179  //TString TFTPPath = TString("root://localhost:")+ port ;
180  TString TFTPPath = TString("root://")+User+TString("@localhost:")+ port ;
181  //TString TFTPPathKrb5 = TString("root://") + HostName + TString(":")+ port ;
182  TString TFTPPathKrb5 = TString("root://") + User+ TString("@") +
183  HostName + TString(":")+ port ;
184 
185 // Details
186  TString Details = TString("pt:0 ru:1 us:") + User;
187 
188 // Testing availibilities
189  char *p;
190 
191 // TString HaveSRP = "@srpdir@";
192  if ((p = gSystem->DynamicPathName("libSRPAuth", kTRUE))) {
193  HaveMeth[1] = 1;
194  }
195  delete[] p;
196 
197 // Check if Kerberos is available
198  TString Krb5Details;
199  TString Krb5Open;
200  if ((p = gSystem->DynamicPathName("libKrb5Auth", kTRUE))) {
201  HaveMeth[2] = 1;
202  // Special details string for Kerberos
203  if (strlen(krb5) > 0) {
204  Krb5Details = TString("pt:0 ru:1 us:") + TString(krb5);
205  } else {
206  // Must determine a default ... look in config file
207  TString Krb5Conf, Realm;
208  if (gSystem->Getenv("KRB5_CONFIG")) {
209  if (!gSystem->AccessPathName(gSystem->Getenv("KRB5_CONFIG"), kReadPermission)) {
210  Krb5Conf = gSystem->Getenv("KRB5_CONFIG");
211  }
212  } else if (!gSystem->AccessPathName("/etc/krb5.conf", kReadPermission)) {
213  Krb5Conf = "/etc/krb5.conf";
214  } else {
215  printf("\n >>>> Kerberos Principal undefined\n");
216  printf("\n >>>> unable to localize Kerberos config file to build a default\n");
217  printf("\n >>>> Switching off Kerberos\n");
218  printf("\n >>>> Run again with giving the principal as 3rd argument\n");
219  printf("\n >>>> or define the variable KRB5_CONFIG with the full path \n");
220  printf("\n >>>> to the config file (usually /etc/krb5.conf)\n");
221  HaveMeth[2] = 0;
222  }
223  if (HaveMeth[2] == 1) {
224  FILE *fc = fopen(Krb5Conf.Data(),"r");
225  if (fc) {
226  char line[1024], fs1[1024], fs2[1024], fs3[1024];
227  while (fgets(line, sizeof(line), fc) != 0) {
228  int nf = sscanf(line,"%s %s %s",fs1,fs2,fs3);
229  if (nf == 3 && !strcmp(fs1,"default_realm")) {
230  Realm = fs3;
231  break;
232  }
233  }
234  Krb5Details = TString("pt:0 ru:1 us:") + User + TString("@") + Realm;
235 // Krb5Details = TString("pt:0 ru:1 us:") + User;
236  fclose(fc);
237  } else {
238  HaveMeth[2] = 0;
239  }
240  }
241  }
242  }
243  delete[] p;
244 
245 // Check if Globus is available
246  TString GlobusDetails;
247  if ((p = gSystem->DynamicPathName("libGlobusAuth", kTRUE))) {
248  HaveMeth[3] = 1;
249  // Special details string for Globus
250  GlobusDetails = TString("pt:0 ru:1 ") + TString(globus);
251  }
252  delete[] p;
253 
254 // Check if SSH available
255  if (gSystem->Which(gSystem->Getenv("PATH"), "ssh", kExecutePermission)) {
256  HaveMeth[4] = 1;
257  }
258 
259 // Test parameter Printout
260  printf("\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
261  printf("+ +\n");
262  printf("+ Basic test parameters: +\n");
263  printf("+ +\n");
264  printf("+ Local User is : %s \n",User.Data());
265  printf("+ Authentication Details : %s \n",Details.Data());
266  printf("+ Current directory is : %s \n",gSystem->WorkingDirectory());
267  printf("+ TFTP string : %s \n",TFTPPath.Data());
268  if (HaveMeth[2]) {
269  printf("+ Krb5 Details : %s \n",Krb5Details.Data());
270  }
271  printf("+ +\n");
272  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
273 
274 // Read local <RootAuthrc> now to avoid to be later superseeded
276  if (lDebug > 0)
278 
279  TFTP *t1 = 0;
280 // UsrPwd method
281  printf("+ +\n");
282  printf("+ Testing UsrPwd ... +\n");
283 
284  // Check if by any chance locally there is already an THostAuth matching
285  // the one we want to use for testing
286  THostAuth *hasv1 = 0;
287  THostAuth *ha = TAuthenticate::HasHostAuth(Host.Data(),User.Data());
288  if (ha) {
289  // We need to save it to restore at the end
290  hasv1 = new THostAuth(*ha);
291  // We reset the existing one
292  ha->Reset();
293  // And update it with the info we want
294  ha->AddMethod(0,Details.Data());
295  } else {
296  // We create directly a new THostAuth
297  ha = new THostAuth(Host.Data(),User.Data(),0,Details.Data());
298  // And add object to list so that TAuthenticate has
299  // a chance to find it
301  }
302 
303  // Print available host auth info
304  if (lDebug > 0)
305  ha->Print();
306 
307  {
308  // First authentication attempt
309  t1 = new TFTP(TFTPPath.Data(),2);
310  if (t1->IsOpen()) {
311  TestMeth[0] = 1;
312  } else {
313  printf(" >>>>>>>>>>>>>>>> Test of UsrPwd authentication failed \n");
314  }}
315 
316  // Try ReUse
317  if (TestMeth[0] == 1) {
318  TIter next(ha->Established());
319  TSecContext *ai;
320  while ((ai = (TSecContext *) next())) {
321  if (ai->GetMethod() == 0) {
322  Int_t OffSet = ai->GetOffSet();
323  TestReUse[0] = 0;
324  if (OffSet > -1) {
325  TestReUse[0] = 1;
326  }
327  }
328  }
329  }
330  // Delete t1
331  if (t1) delete t1;
332  // remove method from available list
333  ha->RemoveMethod(0);
334 
335 // SRP method
336  if ( HaveMeth[1] ) {
337  printf("+ +\n");
338  printf("+ Testing SRP ... +\n");
339 
340  // Add relevant info to HostAuth
341  ha->AddFirst(1,Details.Data());
342  if (lDebug > 0)
343  ha->Print();
344 
345  // Authentication attempt
346  t1 = new TFTP(TFTPPath.Data(),2);
347  if (t1->IsOpen()) {
348  TestMeth[1] = 1;
349  } else {
350  printf(" >>>>>>>>>>>>>>>> Test of SRP authentication failed \n");
351  }
352 
353  // Try ReUse
354  if (TestMeth[1] == 1) {
355  TIter next(ha->Established());
356  TSecContext *ai;
357  while ((ai = (TSecContext *) next())) {
358  if (ai->GetMethod() == 1) {
359  Int_t OffSet = ai->GetOffSet();
360  TestReUse[1] = 0;
361  if (OffSet > -1) {
362  TestReUse[1] = 1;
363  }
364  }
365  }
366  }
367  // Delete t1
368  if (t1) delete t1;
369  // remove method from available list
370  ha->RemoveMethod(1);
371 
372  }
373 
374 // Kerberos method
375  THostAuth *hak = 0;
376  THostAuth *hasv2 = 0;
377  if ( HaveMeth[2] ) {
378  printf("+ +\n");
379  printf("+ Testing Krb5 ... +\n");
380 
381 
382  // Check if by any chance locally there is already an THostAuth matching
383  // the one we want to use for testing
384  hak = TAuthenticate::HasHostAuth(HostName.Data(),User.Data());
385  if (hak) {
386  if (lDebug > 0)
387  printf(" >>>>>>>>>>>>>>>> Krb5: existing THostAuth found \n");
388  // We need to save it to restore at the end
389  hasv2 = new THostAuth(*hak);
390  // We reset the existing one
391  hak->Reset();
392  // And update it with the info we want
393  hak->AddMethod(2,Krb5Details.Data());
394  } else {
395  // We create directly a new THostAuth
396  hak = new THostAuth(HostName.Data(),User.Data(),2,Krb5Details.Data());
397  // And add object to list so that TAuthenticate has
398  // a chance to find it
400  }
401  if (lDebug > 0)
402  hak->Print();
403 
404  // Authentication attempt
405  t1 = new TFTP(TFTPPathKrb5.Data(),2);
406  if (t1->IsOpen()) {
407  TestMeth[2] = 1;
408  } else {
409  printf(" >>>>>>>>>>>>>>>> Test of Kerberos authentication failed \n");
410  if (strlen(krb5) > 0) {
411  printf(" >>>>>>>>>>>>>>>> details used: '%s' \n",krb5);
412  }
413  }
414 
415  // Try ReUse
416  if (TestMeth[2] == 1) {
417  TIter next(hak->Established());
418  TSecContext *ai;
419  while ((ai = (TSecContext *) next())) {
420  if (ai->GetMethod() == 2) {
421  Int_t OffSet = ai->GetOffSet();
422  TestReUse[2] = 0;
423  if (OffSet > -1) {
424  TestReUse[2] = 1;
425  }
426  }
427  }
428  }
429  // Delete t1
430  if (t1) delete t1;
431  // remove method from available list
432  hak->RemoveMethod(2);
433  }
434 
435 // Globus method
436  if ( HaveMeth[3] ) {
437  printf("+ +\n");
438  printf("+ Testing Globus ... +\n");
439 
440  // Add relevant info to HostAuth
441  ha->AddFirst(3,GlobusDetails.Data());
442  if (lDebug > 0)
443  ha->Print();
444 
445  // Authentication attempt
446  t1 = new TFTP(TFTPPath.Data(),2);
447  if (t1->IsOpen()) {
448  TestMeth[3] = 1;
449  } else {
450  printf(" >>>>>>>>>>>>>>>> Test of Globus authentication failed \n");
451  if (strlen(globus) > 0) {
452  printf(" >>>>>>>>>>>>>>>> details used: '%s' \n",globus);
453  } else {
454  printf(" >>>>>>>>>>>>>>>> using default details: \n");
455  printf(" >>>>>>>>>>>>>>>> ad:/etc/grid-security/certificates");
456  printf(" cd:$HOME/.globus cf:usercert.pem kf:userkey.pem\n");
457  }
459  if (u) {
460  if (u->fUid > 0) {
461  printf(" >>>>>>>>>>>>>>>> You are not root,");
462  printf(" you may not have the right privileges\n");
463  printf(" >>>>>>>>>>>>>>>> Make sure that the used details are correct! \n");
464  }
465  }
466  }
467 
468  // Try ReUse
469  if (TestMeth[3] == 1) {
470  TIter next(ha->Established());
471  TSecContext *ai;
472  while ((ai = (TSecContext *) next())) {
473  if (ai->GetMethod() == 3) {
474  Int_t OffSet = ai->GetOffSet();
475  TestReUse[3] = 0;
476  if (OffSet > -1) {
477  TestReUse[3] = 1;
478  }
479  }
480  }
481  }
482  // Delete t1
483  if (t1) delete t1;
484  // remove method from available list
485  ha->RemoveMethod(3);
486  }
487 
488 // SSH method
489 
490  if ( HaveMeth[4] ) {
491  printf("+ +\n");
492  printf("+ Testing SSH ... +\n");
493 
494  // Add relevant info to HostAuth
495  ha->AddFirst(4,Details.Data());
496  if (lDebug > 0)
497  ha->Print();
498 
499  // Authentication attempt
500  t1 = new TFTP(TFTPPath.Data(),2);
501  if (t1->IsOpen()) {
502  TestMeth[4] = 1;
503  } else {
504  printf(" >>>>>>>>>>>>>>>> Test of SSH authentication failed \n");
505  }
506 
507  // Try ReUse
508  if (TestMeth[4] == 1) {
509  TIter next(ha->Established());
510  TSecContext *ai;
511  while ((ai = (TSecContext *) next())) {
512  if (ai->GetMethod() == 4) {
513  Int_t OffSet = ai->GetOffSet();
514  TestReUse[4] = 0;
515  if (OffSet > -1) {
516  TestReUse[4] = 1;
517  }
518  }
519  }
520  }
521  // Delete t1
522  if (t1) delete t1;
523  // remove method from available list
524  ha->RemoveMethod(4);
525  }
526 
527 
528 // Rfio method
529  printf("+ +\n");
530  printf("+ Testing UidGid ... +\n");
531 
532  // Add relevant info to HostAuth
533  ha->AddFirst(5,Details.Data());
534  if (lDebug > 0)
535  ha->Print();
536 
537  // Authentication attempt
538  {
539  t1 = new TFTP(TFTPPath.Data(),2);
540  if (t1->IsOpen()) {
541  TestMeth[5] = 1;
542  } else {
543  printf(" >>>>>>>>>>>>>>>> Test of UidGid authentication failed \n");
544  }}
545 
546  // Delete t1
547  if (t1) delete t1;
548 
549  // remove method from available list
550  ha->RemoveMethod(5);
551 
552  printf("+ +\n");
553  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
554 
555  // Print available host auth info
556  if (lDebug > 0)
558 
559 // Now restore initial configuration
560  if (hasv1) {
561  ha->Reset();
562  ha->Update(hasv1);
563  } else {
565  }
566  if (hasv2) {
567  hak->Reset();
568  hak->Update(hasv2);
569  } else {
571  }
572 
573 // Final Printout
574  printf("\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
575  printf("+ +\n");
576  printf("+ Result of the tests: +\n");
577  printf("+ +\n");
578  char status[4][20] = {"failed!","successful!","not testable","not tested"};
579  int i = 0;
580  for( i=0; i<6; i++ ) {
581  if (HaveMeth[i] && TestMeth[i] < 2) {
582  if (i < 5) {
583  printf("+ Method: %d %8s: %11s (reuse: %11s) +\n",i,
585  status[TestMeth[i]],status[TestReUse[i]]);
586  } else
587  printf("+ Method: %d %8s: %11s +\n",i,
589  status[TestMeth[i]]);
590  }
591  }
592  Bool_t NotPrinted = kTRUE;
593  for( i=0; i<6; i++ ) {
594  if (HaveMeth[i] && TestMeth[i] > 1) {
595  if (NotPrinted) {
596  printf("+ +\n");
597  printf("+ Could not be tested: +\n");
598  printf("+ +\n");
599  NotPrinted = kFALSE;
600  }
601  printf("+ Method: %d %8s: %11s +\n",i,
603  status[TestMeth[i]]);
604  }
605  }
606  printf("+ +\n");
607  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
608 
609 }
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1213
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:865
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
TLine * line
int TestAuth(int port=1094, char *user="", char *krb5="", char *globus="")
Definition: TestAuth.C:106
#define gROOT
Definition: TROOT.h:344
Basic string class.
Definition: TString.h:137
TAlienJobStatus * status
Definition: TAlienJob.cxx:51
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Definition: TSystem.cxx:1459
Definition: TFTP.h:42
TLatex * t1
Definition: textangle.C:20
Int_t fUid
Definition: TSystem.h:150
const char * Data() const
Definition: TString.h:349
static Int_t ReadRootAuthrc()
Read authentication directives from $ROOTAUTHRC, $HOME/.rootauthrc or <Root_etc_dir>/system.rootauthrc and create related THostAuth objects.
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:839
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1575
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition: TSystem.cxx:1511
Int_t GetOffSet() const
Definition: TSecContext.h:85
TList * Established() const
Definition: THostAuth.h:110
void RemoveMethod(Int_t level)
Remove method 'meth' from the list, if there ...
Definition: THostAuth.cxx:312
TString fUser
Definition: TSystem.h:152
R__EXTERN TSystem * gSystem
Definition: TSystem.h:545
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
Definition: TEnv.cxx:494
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:675
char * Form(const char *fmt,...)
void AddMethod(Int_t level, const char *details=0)
Add method to the list.
Definition: THostAuth.cxx:279
static void Show(Option_t *opt="S")
Print info about the authentication sector.
static TList * GetAuthInfo()
Static method returning the list with authentication details.
virtual const char * HostName()
Return the system's host name.
Definition: TSystem.cxx:307
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
Definition: TSystem.cxx:1906
R__EXTERN TEnv * gEnv
Definition: TEnv.h:174
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
virtual void Add(TObject *obj)
Definition: TList.h:81
void Update(THostAuth *ha)
Update info with the one in ha Remaining methods, if any, get lower priority.
Definition: THostAuth.cxx:535
virtual void Print(Option_t *option="") const
Print object content.
Definition: THostAuth.cxx:426
Bool_t IsOpen() const
Definition: TFTP.h:93
void AddFirst(Int_t level, const char *details=0)
Add new method in first position If already in the list, set as first method 'level' with authenticat...
Definition: THostAuth.cxx:653
const Bool_t kTRUE
Definition: Rtypes.h:91
static THostAuth * HasHostAuth(const char *host, const char *user, Option_t *opt="R")
Checks if a THostAuth with exact match for {host,user} exists in the fgAuthInfo list If opt = "P" use...
static const char * GetAuthMethod(Int_t idx)
Static method returning the method corresponding to idx.
void Reset()
Remove all methods, leaving Active status and list of associted TSceContexts unchanged.
Definition: THostAuth.cxx:346