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

lcmaps_gss_assist_gridmap.c

Go to the documentation of this file.
00001 /*                                                                                                            
00002  * Copyright (c) Members of the EGEE Collaboration. 2004.
00003  * See http://eu-egee.org/partners/ for details on the copyright holders.
00004  * For license conditions see the license file or
00005  * http://eu-egee.org/license.html
00006  */
00007 
00008 /*                                                                                                            
00009  * Copyright (c) 2001 EU DataGrid.                                                                             
00010  * For license conditions see http://www.eu-datagrid.org/license.html                                          
00011  *
00012  * Copyright (c) 2001, 2002 by 
00013  *     Martijn Steenbakkers <martijn@nikhef.nl>,
00014  *     David Groep <davidg@nikhef.nl>,
00015  *     NIKHEF Amsterdam, the Netherlands
00016  */
00017 
00029 #ifndef LCMAPS_GSS_ASSIST_GRIDMAP_C
00030 #define LCMAPS_GSS_ASSIST_GRIDMAP_C
00031 
00032 #include "lcmaps_config.h"
00033 #include <stdio.h>
00034 #include <stdlib.h>
00035 #include <string.h>
00036 #include <pwd.h>
00037 
00038 /* LCMAPS includes */
00039 #include "lcmaps.h"
00040 #include "lcmaps_gss_assist_gridmap.h"
00041 
00042 int
00043 globus_gss_assist_gridmap(
00044     char *   globusidp,
00045     char **  useridp
00046 )
00047 {
00048     FILE *   usrlog_fp=stderr;
00049     int retval;
00050 
00051     fprintf(stderr,"Using globus_gss_assist_gridmap interface of LCMAPS\n");
00052     if (useridp == NULL)
00053         return 1;
00054 
00055     *useridp = NULL;
00056 
00057     /* Initialize, do user mapping and terminate LCMAPS */
00058     retval=lcmaps_init(usrlog_fp);
00059     if (retval)
00060     {
00061         fprintf(stderr,"LCMAPS initialization failure.\n");
00062         return 1;
00063     }
00064     retval = lcmaps_run_without_credentials_and_return_username(
00065             globusidp,
00066             NULL,
00067             useridp,
00068             0,
00069             NULL);
00070     if (retval)
00071     {
00072         fprintf(stderr,"LCMAPS failed to find a username\n");
00073         return 1;
00074     }
00075 
00076     retval=lcmaps_term();
00077     if (retval)
00078     {
00079         fprintf(stderr,"LCMAPS termination failure\n");
00080         return 1;
00081     }
00082     fprintf(stderr,"globus_gss_assist_gridmap interface of LCMAPS done\n");
00083 
00084     return 0;
00085 }
00086 
00087 #endif /* LCMAPS_GSS_ASSIST_GRIDMAP_C */
00088 
00089 /******************************************************************************
00090 CVS Information:
00091     $Source: /cvs/jra1mw/org.glite.security.lcmaps-interface/src/lcmaps_gss_assist_gridmap.c,v $
00092     $Date: 2004/12/02 17:44:49 $
00093     $Revision: 1.4 $
00094     $Author: msteenba $
00095 ******************************************************************************/

Generated on Sun May 29 21:22:10 2005 for lcmaps by doxygen 1.3.5