grst_gacl.c File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <string.h>
#include <dirent.h>
#include <fcntl.h>
#include <ctype.h>
#include <strings.h>
#include <stdio.h>
#include <stdlib.h>
#include <fnmatch.h>
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include "gridsite.h"

Go to the source code of this file.

Functions

int GRSTgaclInit (void)
GRSTgaclAclGRSTgaclAclParse (xmlDocPtr, xmlNodePtr, GRSTgaclAcl *)
GRSTgaclAclGRSTxacmlAclParse (xmlDocPtr, xmlNodePtr, GRSTgaclAcl *)
GRSTgaclCredGRSTgaclCredCreate (char *auri_prefix, char *auri_suffix)
GRSTgaclCredGRSTgaclCredNew (char *type)
int GRSTgaclCredAddValue (GRSTgaclCred *cred, char *name, char *rawvalue)
int GRSTgaclCredFree (GRSTgaclCred *cred)
static int GRSTgaclCredsFree (GRSTgaclCred *firstcred)
static int GRSTgaclCredInsert (GRSTgaclCred *firstcred, GRSTgaclCred *newcred)
int GRSTgaclEntryAddCred (GRSTgaclEntry *entry, GRSTgaclCred *cred)
static int GRSTgaclCredRemoveCred (GRSTgaclCred *firstcred, GRSTgaclCred *oldcred)
int GRSTgaclEntryDelCred (GRSTgaclEntry *entry, GRSTgaclCred *cred)
int GRSTgaclCredPrint (GRSTgaclCred *cred, FILE *fp)
int GRSTgaclCredCmpAuri (GRSTgaclCred *cred1, GRSTgaclCred *cred2)
GRSTgaclEntryGRSTgaclEntryNew (void)
int GRSTgaclEntryFree (GRSTgaclEntry *entry)
static int GRSTgaclEntriesFree (GRSTgaclEntry *entry)
static int GRSTgaclEntryInsert (GRSTgaclEntry *firstentry, GRSTgaclEntry *newentry)
int GRSTgaclAclAddEntry (GRSTgaclAcl *acl, GRSTgaclEntry *entry)
int GRSTgaclEntryPrint (GRSTgaclEntry *entry, FILE *fp)
int GRSTgaclPermPrint (GRSTgaclPerm perm, FILE *fp)
int GRSTgaclEntryAllowPerm (GRSTgaclEntry *entry, GRSTgaclPerm perm)
int GRSTgaclEntryUnallowPerm (GRSTgaclEntry *entry, GRSTgaclPerm perm)
int GRSTgaclEntryDenyPerm (GRSTgaclEntry *entry, GRSTgaclPerm perm)
int GRSTgaclEntryUndenyPerm (GRSTgaclEntry *entry, GRSTgaclPerm perm)
char * GRSTgaclPermToChar (GRSTgaclPerm perm)
GRSTgaclPerm GRSTgaclPermFromChar (char *s)
GRSTgaclAclGRSTgaclAclNew (void)
int GRSTgaclAclFree (GRSTgaclAcl *acl)
int GRSTgaclAclPrint (GRSTgaclAcl *acl, FILE *fp)
int GRSTgaclAclSave (GRSTgaclAcl *acl, char *filename)
static GRSTgaclCredGRSTgaclCredParse (xmlNodePtr cur)
static GRSTgaclEntryGRSTgaclEntryParse (xmlNodePtr cur)
GRSTgaclAclGRSTgaclAclLoadFile (char *filename)
int GRSTgaclFileIsAcl (char *pathandfile)
char * GRSTgaclFileFindAclname (char *pathandfile)
GRSTgaclAclGRSTgaclAclLoadforFile (char *pathandfile)
GRSTgaclUserGRSTgaclUserNew (GRSTgaclCred *cred)
int GRSTgaclUserFree (GRSTgaclUser *user)
int GRSTgaclUserAddCred (GRSTgaclUser *user, GRSTgaclCred *cred)
int GRSTgaclUserHasCred (GRSTgaclUser *user, GRSTgaclCred *cred)
GRSTgaclCredGRSTgaclUserFindCredtype (GRSTgaclUser *user, char *type)
int GRSTgaclUserSetDNlists (GRSTgaclUser *user, char *dnlists)
static void recurse4dnlists (GRSTgaclUser *user, char *dir, int recurse_level, GRSTgaclCred *dn_cred)
int GRSTgaclUserLoadDNlists (GRSTgaclUser *user, char *dnlists)
int GRSTgaclDNlistHasUser (char *listurl, GRSTgaclUser *user)
int GRSTgaclUserHasAURI (GRSTgaclUser *user, char *auri)
GRSTgaclPerm GRSTgaclAclTestUser (GRSTgaclAcl *acl, GRSTgaclUser *user)
GRSTgaclPerm GRSTgaclAclTestexclUser (GRSTgaclAcl *acl, GRSTgaclUser *user)
GRSTgaclEntryGACLparseEntry (xmlNodePtr cur)

Variables

char * grst_perm_syms []
GRSTgaclPerm grst_perm_vals []


Function Documentation

GRSTgaclEntry* GACLparseEntry ( xmlNodePtr  cur  ) 

Definition at line 1416 of file grst_gacl.c.

References GRSTgaclEntryParse().

int GRSTgaclAclAddEntry ( GRSTgaclAcl acl,
GRSTgaclEntry entry 
)

Definition at line 459 of file grst_gacl.c.

References acl(), entry, GRSTgaclEntryInsert(), and NULL.

Referenced by GRSTgaclAclParse(), and GRSTxacmlAclParse().

int GRSTgaclAclFree ( GRSTgaclAcl acl  ) 

Definition at line 605 of file grst_gacl.c.

References acl(), GRSTgaclEntriesFree(), and NULL.

Referenced by GRSTgaclAclParse(), and GRSTxacmlAclParse().

GRSTgaclAcl* GRSTgaclAclLoadFile ( char *  filename  ) 

Definition at line 783 of file grst_gacl.c.

References acl(), GRST_LOG_DEBUG, GRSTerrorLog, GRSTgaclAclParse(), GRSTxacmlAclParse(), and NULL.

Referenced by GRSTgaclAclLoadforFile().

GRSTgaclAcl* GRSTgaclAclLoadforFile ( char *  pathandfile  ) 

Definition at line 931 of file grst_gacl.c.

References acl(), free(), GRSTgaclAclLoadFile(), GRSTgaclFileFindAclname(), and NULL.

GRSTgaclAcl* GRSTgaclAclNew ( void   ) 

Definition at line 589 of file grst_gacl.c.

References GRSTgaclAcl::firstentry, malloc(), and NULL.

Referenced by GRSTgaclAclParse(), and GRSTxacmlAclParse().

GRSTgaclAcl * GRSTgaclAclParse ( xmlDocPtr  ,
xmlNodePtr  ,
GRSTgaclAcl  
)

Definition at line 832 of file grst_gacl.c.

References acl(), entry, GRSTgaclAclAddEntry(), GRSTgaclAclFree(), GRSTgaclAclNew(), GRSTgaclEntryParse(), and NULL.

Referenced by GRSTgaclAclLoadFile(), and GRSTxacmlAclLoadFile().

int GRSTgaclAclPrint ( GRSTgaclAcl acl,
FILE *  fp 
)

Definition at line 617 of file grst_gacl.c.

References acl(), entry, GRSTgaclEntryPrint(), and NULL.

Referenced by GRSTgaclAclSave().

int GRSTgaclAclSave ( GRSTgaclAcl acl,
char *  filename 
)

Definition at line 631 of file grst_gacl.c.

References acl(), fclose(), fopen, fp, GRSTgaclAclPrint(), and NULL.

GRSTgaclPerm GRSTgaclAclTestexclUser ( GRSTgaclAcl acl,
GRSTgaclUser user 
)

Definition at line 1368 of file grst_gacl.c.

References acl(), GRSTgaclCred::auri, entry, flag, GRSTgaclUserHasCred(), GRSTgaclCred::next, and NULL.

GRSTgaclPerm GRSTgaclAclTestUser ( GRSTgaclAcl acl,
GRSTgaclUser user 
)

Definition at line 1323 of file grst_gacl.c.

References acl(), GRSTgaclCred::auri, entry, flag, GRST_PERM_ADMIN, GRST_PERM_WRITE, GRSTgaclUserHasCred(), GRSTgaclCred::next, and NULL.

int GRSTgaclCredAddValue ( GRSTgaclCred cred,
char *  name,
char *  rawvalue 
)

Definition at line 188 of file grst_gacl.c.

References GRSTgaclCred::auri, free(), GRSThttpUrlMildencode(), i, NULL, sprintf(), and value.

Referenced by GRSTgaclCredParse(), and GRSTxacmlCredParse().

int GRSTgaclCredCmpAuri ( GRSTgaclCred cred1,
GRSTgaclCred cred2 
)

Definition at line 370 of file grst_gacl.c.

References GRSTgaclCred::auri, and NULL.

GRSTgaclCred* GRSTgaclCredCreate ( char *  auri_prefix,
char *  auri_suffix 
)

Definition at line 126 of file grst_gacl.c.

References GRSTgaclCred::auri, GRSTgaclCred::delegation, i, malloc(), GRSTgaclCred::next, GRSTgaclCred::nist_loa, GRSTgaclCred::notafter, GRSTgaclCred::notbefore, NULL, and sprintf().

Referenced by GRSTgaclCredNew(), GRSTgaclCredParse(), GRSTx509CompactToCred(), and recurse4dnlists().

int GRSTgaclCredFree ( GRSTgaclCred cred  ) 

Definition at line 251 of file grst_gacl.c.

References GRSTgaclCred::auri, free(), and NULL.

Referenced by GRSTgaclCredParse(), GRSTgaclCredsFree(), GRSTgaclEntryParse(), and GRSTxacmlEntryParse().

static int GRSTgaclCredInsert ( GRSTgaclCred firstcred,
GRSTgaclCred newcred 
) [static]

Definition at line 277 of file grst_gacl.c.

References GRSTgaclCred::next, and NULL.

Referenced by GRSTgaclEntryAddCred().

GRSTgaclCred* GRSTgaclCredNew ( char *  type  ) 

Definition at line 165 of file grst_gacl.c.

References GRSTgaclCredCreate(), and NULL.

Referenced by GRSTgaclCredParse(), and GRSTxacmlCredParse().

static GRSTgaclCred* GRSTgaclCredParse ( xmlNodePtr  cur  )  [static]

Definition at line 654 of file grst_gacl.c.

References GRSTgaclCred::delegation, GRSTgaclCredAddValue(), GRSTgaclCredCreate(), GRSTgaclCredFree(), GRSTgaclCredNew(), GRSTgaclCred::nist_loa, and NULL.

Referenced by GRSTgaclEntryParse().

int GRSTgaclCredPrint ( GRSTgaclCred cred,
FILE *  fp 
)

Definition at line 335 of file grst_gacl.c.

References GRSTgaclCred::auri, GRSTgaclCred::delegation, fprintf(), GRSTgaclCred::nist_loa, and NULL.

Referenced by GRSTgaclEntryPrint().

static int GRSTgaclCredRemoveCred ( GRSTgaclCred firstcred,
GRSTgaclCred oldcred 
) [static]

Definition at line 311 of file grst_gacl.c.

References NULL.

Referenced by GRSTgaclEntryDelCred().

static int GRSTgaclCredsFree ( GRSTgaclCred firstcred  )  [static]

Definition at line 265 of file grst_gacl.c.

References GRSTgaclCredFree(), GRSTgaclCred::next, and NULL.

Referenced by GRSTgaclEntryFree(), and GRSTgaclUserFree().

int GRSTgaclDNlistHasUser ( char *  listurl,
GRSTgaclUser user 
)

Definition at line 1304 of file grst_gacl.c.

References GRSTgaclUserHasAURI().

static int GRSTgaclEntriesFree ( GRSTgaclEntry entry  )  [static]

Definition at line 428 of file grst_gacl.c.

References entry, GRSTgaclEntryFree(), and NULL.

Referenced by GRSTgaclAclFree().

int GRSTgaclEntryAddCred ( GRSTgaclEntry entry,
GRSTgaclCred cred 
)

Definition at line 295 of file grst_gacl.c.

References entry, GRSTgaclCredInsert(), and NULL.

Referenced by GRSTgaclEntryParse(), and GRSTxacmlEntryParse().

int GRSTgaclEntryAllowPerm ( GRSTgaclEntry entry,
GRSTgaclPerm  perm 
)

Definition at line 529 of file grst_gacl.c.

References entry.

Referenced by GRSTgaclEntryParse(), and GRSTxacmlEntryParse().

int GRSTgaclEntryDelCred ( GRSTgaclEntry entry,
GRSTgaclCred cred 
)

Definition at line 324 of file grst_gacl.c.

References entry, GRSTgaclCredRemoveCred(), and NULL.

int GRSTgaclEntryDenyPerm ( GRSTgaclEntry entry,
GRSTgaclPerm  perm 
)

Definition at line 543 of file grst_gacl.c.

References entry.

Referenced by GRSTgaclEntryParse(), and GRSTxacmlEntryParse().

int GRSTgaclEntryFree ( GRSTgaclEntry entry  ) 

Definition at line 414 of file grst_gacl.c.

References entry, free(), GRSTgaclCredsFree(), and NULL.

Referenced by GRSTgaclEntriesFree(), GRSTgaclEntryParse(), and GRSTxacmlEntryParse().

static int GRSTgaclEntryInsert ( GRSTgaclEntry firstentry,
GRSTgaclEntry newentry 
) [static]

Definition at line 441 of file grst_gacl.c.

References GRSTgaclEntry::next, and NULL.

Referenced by GRSTgaclAclAddEntry().

GRSTgaclEntry* GRSTgaclEntryNew ( void   ) 

Definition at line 395 of file grst_gacl.c.

References GRSTgaclEntry::allowed, GRSTgaclEntry::denied, GRSTgaclEntry::firstcred, malloc(), GRSTgaclEntry::next, and NULL.

Referenced by GRSTgaclEntryParse(), and GRSTxacmlEntryParse().

static GRSTgaclEntry* GRSTgaclEntryParse ( xmlNodePtr  cur  )  [static]

Definition at line 716 of file grst_gacl.c.

References entry, for(), GRSTgaclCredFree(), GRSTgaclCredParse(), GRSTgaclEntryAddCred(), GRSTgaclEntryAllowPerm(), GRSTgaclEntryDenyPerm(), GRSTgaclEntryFree(), GRSTgaclEntryNew(), i, if(), and NULL.

Referenced by GACLparseEntry(), and GRSTgaclAclParse().

int GRSTgaclEntryPrint ( GRSTgaclEntry entry,
FILE *  fp 
)

Definition at line 475 of file grst_gacl.c.

References entry, GRST_PERM_ADMIN, GRST_PERM_READ, GRSTgaclCredPrint(), GRSTgaclPermPrint(), i, GRSTgaclCred::next, and NULL.

Referenced by GRSTgaclAclPrint().

int GRSTgaclEntryUnallowPerm ( GRSTgaclEntry entry,
GRSTgaclPerm  perm 
)

Definition at line 536 of file grst_gacl.c.

References entry.

int GRSTgaclEntryUndenyPerm ( GRSTgaclEntry entry,
GRSTgaclPerm  perm 
)

Definition at line 550 of file grst_gacl.c.

References entry.

char* GRSTgaclFileFindAclname ( char *  pathandfile  ) 

Definition at line 873 of file grst_gacl.c.

References free(), GRST_ACL_FILE, len, malloc(), NULL, p, rindex, S_ISDIR, sprintf(), stat, strcat(), and strcpy().

Referenced by GRSTgaclAclLoadforFile().

int GRSTgaclFileIsAcl ( char *  pathandfile  ) 

Definition at line 860 of file grst_gacl.c.

References GRST_ACL_FILE, NULL, and rindex.

int GRSTgaclInit ( void   ) 

Definition at line 106 of file grst_gacl.c.

GRSTgaclPerm GRSTgaclPermFromChar ( char *  s  ) 

Definition at line 572 of file grst_gacl.c.

References i, NULL, and strcasecmp.

int GRSTgaclPermPrint ( GRSTgaclPerm  perm,
FILE *  fp 
)

Definition at line 515 of file grst_gacl.c.

References fprintf(), GRST_PERM_READ, i, and NULL.

Referenced by GRSTgaclEntryPrint().

char* GRSTgaclPermToChar ( GRSTgaclPerm  perm  ) 

Definition at line 557 of file grst_gacl.c.

References i, NULL, and p.

int GRSTgaclUserAddCred ( GRSTgaclUser user,
GRSTgaclCred cred 
)

Definition at line 984 of file grst_gacl.c.

References GRSTgaclUser::firstcred, GRSTgaclCred::next, and NULL.

Referenced by recurse4dnlists().

GRSTgaclCred* GRSTgaclUserFindCredtype ( GRSTgaclUser user,
char *  type 
)

Definition at line 1075 of file grst_gacl.c.

References GRSTgaclCred::auri, GRSTgaclUser::firstcred, GRSTgaclCred::next, and NULL.

int GRSTgaclUserFree ( GRSTgaclUser user  ) 

Definition at line 971 of file grst_gacl.c.

References GRSTgaclUser::dnlists, GRSTgaclUser::firstcred, free(), GRSTgaclCredsFree(), and NULL.

int GRSTgaclUserHasAURI ( GRSTgaclUser user,
char *  auri 
)

Definition at line 1309 of file grst_gacl.c.

References GRSTgaclCred::auri, GRSTgaclUser::firstcred, GRSTgaclCred::next, and NULL.

Referenced by GRSTgaclDNlistHasUser().

int GRSTgaclUserHasCred ( GRSTgaclUser user,
GRSTgaclCred cred 
)

Definition at line 1007 of file grst_gacl.c.

References GRSTgaclCred::auri, GRSTgaclUser::firstcred, GRSTgaclCred::next, GRSTgaclCred::nist_loa, and NULL.

Referenced by GRSTgaclAclTestexclUser(), and GRSTgaclAclTestUser().

int GRSTgaclUserLoadDNlists ( GRSTgaclUser user,
char *  dnlists 
)

Definition at line 1212 of file grst_gacl.c.

References GRSTgaclCred::auri, GRSTgaclUser::firstcred, free(), getenv(), GRST_DN_LISTS, GRSTgaclCred::next, NULL, and recurse4dnlists().

Referenced by GRSTgaclUserSetDNlists().

GRSTgaclUser* GRSTgaclUserNew ( GRSTgaclCred cred  ) 

Definition at line 954 of file grst_gacl.c.

References GRSTgaclUser::dnlists, GRSTgaclUser::firstcred, malloc(), and NULL.

int GRSTgaclUserSetDNlists ( GRSTgaclUser user,
char *  dnlists 
)

Definition at line 1105 of file grst_gacl.c.

References GRSTgaclUser::dnlists, free(), GRSTgaclUserLoadDNlists(), and NULL.

GRSTgaclAcl * GRSTxacmlAclParse ( xmlDocPtr  ,
xmlNodePtr  ,
GRSTgaclAcl  
)

Definition at line 256 of file grst_xacml.c.

References acl(), debugfile, entry, fclose(), fopen, fprintf(), GRSTgaclAclAddEntry(), GRSTgaclAclFree(), GRSTgaclAclNew(), GRSTxacmlEntryParse(), and NULL.

Referenced by GRSTgaclAclLoadFile(), and GRSTxacmlAclLoadFile().

static void recurse4dnlists ( GRSTgaclUser user,
char *  dir,
int  recurse_level,
GRSTgaclCred dn_cred 
) [static]

Definition at line 1115 of file grst_gacl.c.

References GRSTgaclCred::auri, close, GRSTgaclCred::delegation, free(), fstat, GRST_LOG_DEBUG, GRST_RECURS_LIMIT, GRSTerrorLog, GRSTgaclCredCreate(), GRSTgaclCredSetDelegation, GRSTgaclCredSetNistLoa, GRSTgaclCredSetNotAfter, GRSTgaclCredSetNotBefore, GRSTgaclUserAddCred(), GRSThttpUrlDecode(), i, if(), GRSTgaclCred::nist_loa, GRSTgaclCred::notafter, GRSTgaclCred::notbefore, NULL, open, opendir, readdir, s, S_ISDIR, S_ISREG, size_t, sprintf(), and stat.

Referenced by GRSTgaclUserLoadDNlists().


Variable Documentation

char* grst_perm_syms[]

Initial value:

  { "none",
                                "read",
                                "exec",
                                "list",
                                "write",
                                "admin",
                                NULL              }

Definition at line 90 of file grst_gacl.c.

Referenced by GRSTxacmlEntryParse(), and GRSTxacmlPermPrint().

GRSTgaclPerm grst_perm_vals[]

Initial value:

Definition at line 98 of file grst_gacl.c.

Referenced by GRSTxacmlEntryParse(), and GRSTxacmlPermPrint().


Generated on Tue Jul 5 16:08:13 2011 for ROOT_528-00b_version by  doxygen 1.5.1