Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lcmaps_utils.h File Reference

API for the utilities for the LCMAPS. More...

#include <gssapi.h>
#include "lcmaps_types.h"
#include <grp.h>

Include dependency graph for lcmaps_utils.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

CREDENTIAL FUNCTIONS

char* lcmaps_get_dn (lcmaps_cred_id_t lcmaps_credential)
 Retrieve user DN from (LCMAPS) credential. More...


FILENAME FUNCTIONS

char* lcmaps_genfilename (char *prefix, char *path, char *suffix)
 Generate an absolute file name. More...

char* lcmaps_getfexist (int n,...)
 Picks the first existing file in argument list. More...

char* lcmaps_findfile (char *name)
 Checks for file in standard directories. More...


Functions

int lcmaps_get_gidlist (const char *username, int *ngroups, gid_t **group_list)
 Finds the list of gids for user in the group file (/etc/group). More...


Detailed Description

API for the utilities for the LCMAPS.

Author:
Martijn Steenbakkers for the EU DataGrid.

This header contains the declarations of the LCMAPS utility functions:
  1. lcmaps_get_dn():
  2. lcmaps_genfilename():
  3. lcmaps_getfexist():
  4. lcmaps_findfile():
  5. lcmaps_findfile():
  6. lcmaps_get_gidlist():

Definition in file lcmaps_utils.h.


Function Documentation

char * lcmaps_findfile ( char * name )
 

Checks for file in standard directories.

The directories that are checked are:

  • current directory
  • "modules"
  • LCMAPS_ETC_HOME
  • LCMAPS_MOD_HOME
  • LCMAPS_LIB_HOME
Parameters:
name   string containing the file name
Returns:
pointer to a string containing the absolute path to the file, which has to be freed or NULL.

Definition at line 389 of file lcmaps_utils.c.

char * lcmaps_genfilename ( char * prefixp,
char * pathp,
char * suffixp )
 

Generate an absolute file name.

Given a starting prefix, a relative or absolute path, and a suffix an absolute file name is generated. Uses the prefix only if the path is relative. (Copied (and modified) from GLOBUS gatekeeper.c)

Parameters:
prefix   string containing the prefix to be prepended.
path   relative/absolute path to file name.
suffix   string containing the suffix to be appended.

Returns:
pointer to a string containing the absolute path to the file, which has to be freed.

Definition at line 247 of file lcmaps_utils.c.

char * lcmaps_get_dn ( lcmaps_cred_id_t lcmaps_cred )
 

Retrieve user DN from (LCMAPS) credential.

This function takes an LCMAPS credential as input and returns the corresponding user distinguished name (DN).

(Internal:) If the GLOBUS credential part of the LCMAPS credential is empty the user DN is already included in the LCMAPS credential.

Parameters:
lcmaps_credential   the LCMAPS credential
Returns:
a string containing the user DN

Definition at line 151 of file lcmaps_utils.c.

int lcmaps_get_gidlist ( const char * username,
int * ngroups,
gid_t ** group_list )
 

Finds the list of gids for user in the group file (/etc/group).

Returns a list of gid_t which should be freed by calling program.

Parameters:
username   the name of the user
ngroups   ptr to int which will be filled with the number of gids
group_list   ptr to an array of gid_t
Return values:
0   success
-1   realloc failure
-2   getgrent failure
1   failure

Definition at line 577 of file lcmaps_utils.c.

char * lcmaps_getfexist ( int n,
... )
 

Picks the first existing file in argument list.

Parameters:
n   the number of paths presented in the following argument list.
...   variable argument list of paths.

Returns:
filename found or NULL

Definition at line 347 of file lcmaps_utils.c.


Generated at Thu Mar 4 17:39:32 2004 for edg-lcmaps by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001