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

lcmaps_ldap.c File Reference

Interface to the LCMAPS plugins. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pwd.h>
#include <grp.h>
#include <ctype.h>
#include <errno.h>
#include "globus_gss_assist.h"
#include "lcmaps_config.h"
#include "lcmaps_modules.h"
#include "lcmaps_arguments.h"
#include "lcmaps_cred_data.h"
#include "ldap.h"

Go to the source code of this file.

Functions

int lcmaps_get_ldap_pw (const char *path, char **ldap_passwd)
 Get the LDAP password from file. More...

int lcmaps_set_pgid (const char *username, const char *pgroupname, gid_t pgroupnumber, LDAP *ld_handle, const char *searchBase)
 Sets the primary group ID. More...

int lcmaps_add_username_to_ldapgroup (const char *username, const char *groupname, gid_t groupnumber, LDAP *ld_handle, const char *searchBase)
 Adds the username to the appropriate (LDAP) group. More...


Detailed Description

Interface to the LCMAPS plugins.

Author:
Wim Som de Cerff and Martijn Steenbakkers for the EU DataGrid.
This file contains the code for the ldap LCMAPS plugin The interface consists of the following functions:
  1. plugin_initialize()
  2. plugin_run()
  3. plugin_terminate()
  4. plugin_introspect()
The following internal functions are available:
  1. lcmaps_set_pgid()
  2. lcmaps_add_username_to_ldapgroup()

Definition in file lcmaps_ldap.c.


Function Documentation

int lcmaps_add_username_to_ldapgroup const char *    username,
const char *    groupname,
gid_t    groupnumber,
LDAP *    ld_handle,
const char *    searchBase
[static]
 

Adds the username to the appropriate (LDAP) group.

This function tries to add the username to the list of usernames belonging to the group with name groupname and gid groupnumber in the posixGroup LDAP structure. If the group does not exist, -1 is returned.

Parameters:
username  the name of the user
groupname  the name of the group
groupnumber  group id number
ld_handle  handle to LDAP
searchBase  dn search base
Return values:
0  success
-1  ldap failure
1  other failure

Definition at line 1016 of file lcmaps_ldap.c.

int lcmaps_get_ldap_pw const char *    path,
char **    ldap_passwd
[static]
 

Get the LDAP password from file.

This function tries to read the LDAP password from the ldap_pw file. It also tests if the access bits of the file are correctly set.

Parameters:
path  the path to the ldap_pw file containing the password.
ldap_passwd  variable to set the password in
Return values:
0  success
1  other failure

Definition at line 1363 of file lcmaps_ldap.c.

int lcmaps_set_pgid const char *    username,
const char *    pgroupname,
gid_t    pgroupnumber,
LDAP *    ld_handle,
const char *    searchBase
[static]
 

Sets the primary group ID.

This function tries to set the primary group in the posixAccount LDAP structure for the user "username".

Parameters:
username  the name of the user
pgroupname  the name of the primary group
pgroupnumber  primary group id number
ld_handle  handle to LDAP
searchBase  dn search base
Return values:
0  success
-1  ldap failure
1  other failure

Definition at line 1255 of file lcmaps_ldap.c.


Variable Documentation

struct timeval timeout [static]
 

Initial value:

{
    (time_t) 0,
    (suseconds_t) 0
}

Definition at line 177 of file lcmaps_ldap.c.


Generated on Sat Oct 2 02:18:27 2004 for edg-lcmaps by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002