Macro test authentication methods stand alone.
See $ROOTSYS/README/README.AUTH
for additional details
Syntax:
<port> =
rootd port (
default 1094)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
MAKE SURE that rootd is running
Example of successful output:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ +
+ +
+ +
+ +
+ +
+ <port> =
rootd port (
default 1094) +
+ +
+ +
+ +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ +
+ +
+ +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ +
+ +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ +
+ +
+ +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
int TestAuth(
int port = 1094,
char *user =
"")
{
printf(
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
printf(
"+ Test of authentication methods +\n");
printf(
"+ .x TestAuth.C(<port>,\"<user>\") +\n");
printf(
"+ <port> = rootd port (default 1094) +\n");
printf(
"+ <user> = login user name for the test +\n");
printf(
"+ (default from getpwuid) +\n");
printf(
"+ >>> MAKE SURE that rootd is running <<< +\n");
printf(
"+ See $ROOTSYS/README/README.AUTH for additional details +\n");
printf(
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n");
if (User == "") {
printf(
"\n >>>> 'user' not defined: please enter a valid username:\n");
} else {
printf(
">>>> no 'user' defined: return!\n");
return 1;
}
} else {
}
}
printf(
"\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
printf(
"+ Basic test parameters: +\n");
printf(
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
printf(
"+ Testing UsrPwd ... +\n");
} else {
}
{
} else {
printf(
" >>>>>>>>>>>>>>>> Test of UsrPwd authentication failed \n");
}}
if (
ai->GetMethod() == 0) {
}
}
}
}
printf(
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
} else {
}
} else {
}
printf(
"\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
printf(
"+ Result of the tests: +\n");
char status[4][20] = {"failed!","successful!","not testable","not tested"};
int i = 0;
for( i=0; i<6; i++ ) {
if (i < 5) {
printf(
"+ Method: %d %8s: %11s (reuse: %11s) +\n",i,
} else
printf(
"+ Method: %d %8s: %11s +\n",i,
}
}
for( i=0; i<6; i++ ) {
printf(
"+ Could not be tested: +\n");
}
printf(
"+ Method: %d %8s: %11s +\n",i,
}
}
printf(
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
}
winID h TVirtualViewer3D TVirtualGLPainter p
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
static void Show(Option_t *opt="S")
Print info about the authentication sector.
static Int_t ReadRootAuthrc()
Read authentication directives from $ROOTAUTHRC, $HOME/.rootauthrc or <Root_etc_dir>/system....
static TList * GetAuthInfo()
Static method returning the list with authentication details.
static const char * GetAuthMethod(Int_t idx)
Static method returning the method corresponding to idx.
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...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
const char * Data() const
virtual const char * HostName()
Return the system's host name.
virtual const char * WorkingDirectory()
Return working directory.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
- Author
Definition in file TestAuth.C.