Logo ROOT   6.14/05
Reference Guide
AFSAuth.h
Go to the documentation of this file.
1 // @(#)root/auth:$Id$
2 // Author: G. Ganis, Nov 2006
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_AFSAuth
13 #define ROOT_AFSAuth
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // AFSAuth //
19 // //
20 // Utility functions to acquire and handle AFS tokens. //
21 // These functions are available as separate plugin, libAFSAuth.so, //
22 // depending aonly on the AFS libraries. //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
26 // One day as default lifetime
27 #define DFLTTOKENLIFETIME (24*3600)
28 
29 extern "C" {
30 // Get AFS token for the local cell for 'usr'. The meaning of the
31 // information passed at 'pwd' depends on 'pwlen'. For 'pwlen <= 0'
32 // 'pwd' is interpreted as the plain password (null terminated string).
33 // For 'pwlen > 0', the 'pwlen' bytes at 'pwd' contain the password in
34 // for of encryption key (struct ktc_encryptionKey).
35 // On success a token is returned as opaque information.
36 // On error / failure, 0 is returned; if emsg != 0, *emsg points to an
37 // error message.
38 void *GetAFSToken(const char *usr,
39  const char *pwd, int pwlen = -1,
40  int life = DFLTTOKENLIFETIME, char **emsg = 0);
41 
42 // Verify validity an AFS token. The opaque input information is the one
43 // returned by a successful call to GetAFSToken.
44 // The remaining lifetime is returned, i.e. <=0 if expired.
45 int VerifyAFSToken(void *token);
46 
47 // Delete an AFS token returned by a successful call to GetAFSToken.
48 void DeleteAFSToken(void *token);
49 
50 // Returns a pointer to a string with the local cell. The string must
51 // not be freed or deleted.
52 char *AFSLocalCell();
53 
54 }
55 #endif
56 
#define DFLTTOKENLIFETIME
Definition: AFSAuth.h:27
char * AFSLocalCell()
Returns a pointer to a string with the local cell.
Definition: AFSAuth.cxx:239
void * GetAFSToken(const char *usr, const char *pwd, int pwlen=-1, int life=DFLTTOKENLIFETIME, char **emsg=0)
Get AFS token for the local cell for &#39;usr&#39;.
Definition: AFSAuth.cxx:93
int VerifyAFSToken(void *token)
Verify validity an AFS token.
Definition: AFSAuth.cxx:212
void DeleteAFSToken(void *token)
Delete an AFS token returned by a successful call to GetAFSToken.
Definition: AFSAuth.cxx:229