irp_gr.c revision ab023a65562e62b85a824509d829b6fad87e00b1
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright(c) 1996, 1998 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#endif /* LIBC_SCCS and not lint */
/* extern */
#include "port_before.h"
#ifndef WANT_IRS_PW
static int __bind_irs_gr_unneeded;
#else
#include <syslog.h>
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <syslog.h>
#include <irs.h>
#include <irp.h>
#include <isc/memcluster.h>
#include <isc/irpmarshall.h>
#include "irs_p.h"
#include "lcl_p.h"
#include "irp_p.h"
#include "port_after.h"
/* Types. */
/*! \file
* \brief
* Module for the getnetgrent(3) family to use when connected to a
* remote irp daemon.
* \brief
* See irpd.c for justification of caching done here.
*
*/
struct pvt {
int warned;
};
/* Forward. */
static void gr_minimize(struct irs_gr *);
/* Private */
/* Public. */
/*%
* Initialize the group sub-module.
*
*/
struct irs_gr *
return (NULL);
}
return (NULL);
}
return (gr);
}
/* Methods. */
/*%
* Close the sub-module.
*
*/
static void
}
/*%
* Gets the next group out of the cached data and returns it.
*
*/
static struct group *
char *body;
int code;
char text[256];
return (NULL);
}
return (NULL);
}
if (irp_log_errors) {
}
return (NULL);
}
if (code == IRPD_GETGROUP_OK) {
free_group(gr);
}
} else {
}
}
return (gr);
}
/*%
* Gets a group by name from irpd and returns it.
*
*/
static struct group *
char *body;
int code;
char text[256];
return (gr);
}
return (NULL);
}
return (NULL);
return (NULL);
}
if (code == IRPD_GETGROUP_OK) {
free_group(gr);
}
} else {
}
}
return (gr);
}
/*%
* Gets a group by gid from irpd and returns it.
*
*/
static struct group *
char *body;
int code;
char text[256];
return (gr);
}
return (NULL);
}
return (NULL);
return (NULL);
}
if (code == IRPD_GETGROUP_OK) {
free_group(gr);
}
} else {
}
}
return (gr);
}
/*%
* void gr_rewind(struct irs_gr *this)
*
*/
static void
char text[256];
int code;
return;
}
return;
}
if (code != IRPD_GETGROUP_SETOK) {
if (irp_log_errors) {
}
}
return;
}
/*%
* Frees up cached data and disconnects(if necessary) from the remote.
*
*/
static void
}
/* Private. */
/*%
* static void free_group(struct group *gr);
*
* Deallocate all the memory irp_unmarshall_gr allocated.
*
*/
static void
char **p;
return;
free(*p);
if (p != NULL)
free(p);
}
#endif /* WANT_IRS_GR */
/*! \file */