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 <sys/stat.h>
#include <sys/types.h>
#include <unistd.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.

Defines

#define MAX_LOG_BUFFER_SIZE   2048

Functions

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

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

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.


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.


Define Documentation

#define MAX_LOG_BUFFER_SIZE   2048
 

Maximum logging buffer size, length of log may not exceed this number

Definition at line 135 of 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 1026 of file lcmaps_ldap.c.

References lcmaps_log(), and lcmaps_log_debug().

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 1373 of file lcmaps_ldap.c.

References lcmaps_log(), and lcmaps_log_debug().

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 1265 of file lcmaps_ldap.c.

References lcmaps_log(), and lcmaps_log_debug().


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