irp_gr.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 1999-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* 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 INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#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. */
/*
* Module for the getnetgrent(3) family to use when connected to a
* remote irp daemon.
*
* See irpd.c for justification of caching done here.
*
*/
struct pvt {
int warned;
};
/* Forward. */
static void gr_minimize(struct irs_gr *);
/* Private */
/* Public. */
/*
* struct irs_gr * irs_irp_gr(struct irs_acc *this)
*
* Notes:
*
* Initialize the group sub-module.
*
* Notes:
*
* Module data.
*
*/
struct irs_gr *
return (NULL);
}
return (NULL);
}
return (gr);
}
/* Methods. */
/*
* void gr_close(struct irs_gr *this)
*
* Notes:
*
* Close the sub-module.
*
*/
static void
}
/*
* struct group * gr_next(struct irs_gr *this)
*
* Notes:
*
* 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);
}
/*
* struct group * gr_byname(struct irs_gr *this, const char *name)
*
* Notes:
*
* 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);
}
/*
* struct group * gr_bygid(struct irs_gr *this, gid_t gid)
*
* Notes:
*
* 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;
}
/*
* void gr_minimize(struct irs_gr *this)
*
* Notes:
*
* 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 */