Back to index

glibc  2.9
Typedefs | Functions
publickey.c File Reference
#include <errno.h>
#include <rpc/netdb.h>
#include <rpc/auth_des.h>
#include "nsswitch.h"

Go to the source code of this file.

Typedefs

typedef int(* public_function )(const char *, char *, int *)
typedef int(* secret_function )(const char *, char *, const char *, int *)

Functions

int __nss_publickey_lookup (service_user **nip, const char *name, void **fctp) internal_function
int getpublickey (const char *name, char *key)
 libc_hidden_def (getpublickey)

Typedef Documentation

typedef int(* public_function)(const char *, char *, int *)

Definition at line 29 of file publickey.c.

typedef int(* secret_function)(const char *, char *, const char *, int *)

Definition at line 32 of file publickey.c.


Function Documentation

int __nss_publickey_lookup ( service_user **  nip,
const char *  name,
void **  fctp 
)

Here is the caller graph for this function:

int getpublickey ( const char *  name,
char *  key 
)

Definition at line 40 of file publickey.c.

{
  static service_user *startp;
  static public_function start_fct;
  service_user *nip;
  union
  {
    public_function f;
    void *ptr;
  } fct;
  enum nss_status status = NSS_STATUS_UNAVAIL;
  int no_more;

  if (startp == NULL)
    {
      no_more = __nss_publickey_lookup (&nip, "getpublickey", &fct.ptr);
      if (no_more)
       startp = (service_user *) -1;
      else
       {
         startp = nip;
         start_fct = fct.f;
       }
    }
  else
    {
      fct.f = start_fct;
      no_more = (nip = startp) == (service_user *) -1;
    }

  while (! no_more)
    {
      status = (*fct.f) (name, key, &errno);

      no_more = __nss_next2 (&nip, "getpublickey", NULL, &fct.ptr, status, 0);
    }

  return status == NSS_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 79 of file publickey.c.

{
  static service_user *startp;
  static secret_function start_fct;
  service_user *nip;
  union
  {
    secret_function f;
    void *ptr;
  } fct;
  enum nss_status status = NSS_STATUS_UNAVAIL;
  int no_more;

  if (startp == NULL)
    {
      no_more = __nss_publickey_lookup (&nip, "getsecretkey", &fct.ptr);
      if (no_more)
       startp = (service_user *) -1;
      else
       {
         startp = nip;
         start_fct = fct.f;
       }
    }
  else
    {
      fct.f = start_fct;
      no_more = (nip = startp) == (service_user *) -1;
    }

  while (! no_more)
    {
      status = (*fct.f) (name, key, passwd, &errno);

      no_more = __nss_next2 (&nip, "getsecretkey", NULL, &fct.ptr, status, 0);
    }

  return status == NSS_STATUS_SUCCESS;
}

Here is the call graph for this function: